Code Monkey home page Code Monkey logo

lorenz's Introduction

Lorenz System

A simple C programming exercise: implement the functions in lorenz.c!

Getting started

The Lorenz system code can be run without any external dependencies, but viewing the results with the provided view.py script requires a few common packages from the scientific Python stack. The simplest way to get your own scientific Python stack working is probably to install an Anaconda distribution. It will contain all you need to run the view.py script and more.

However, two functions in lorenz.c must be implemented before the code will work. The first, initialize_system, sets initial x, y, and z values for a set of points. (Points near x,y,z = 1,1,1 make good initial values.) The second, step_system, steps each point forward by a given time step. Both functions operate in-place by modifying values in arrays for x, y, and z; importantly, however, they do so by passing the arrays as parameters, not by declaring the arrays as external (global) varibles.

After implementing the functions, the code can be compiled with the provided Makefile. In a bash-like shell and with the required scientific Python dependencies, running

you@computer:~$ make
you@computer:~$ ./lorenz
you@computer:~$ python view.py

will simulate the Lorenz system and display an animation of the results. If you re-run the simulation, be sure to remove the created lorenz_xyz.out files first. If you want additionally to remove the files created during compilation, invoke

you@computer:~$ make clean

to do so.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.