- odeint-v2.zip
- odeint-v2
- boost
- numeric
- doc
- index.html
- Jamroot
- libs
- numeric
- odeint
- code_analyzer
- doc
- concepts.qbk
- concepts
- controlled_stepper.qbk
- dense_output_stepper.qbk
- error_stepper.qbk
- implicit_system.qbk
- observer.qbk
- state_algebra_operations.qbk
- state_wrapper.qbk
- stepper.qbk
- symplectic_system.qbk
- system.qbk
- concepts_old.qbk
- details.qbk
- examples_table.qbk
- extend.qbk
- getting_started.qbk
- html
- boostbook.css
- phase_lattice_2d_0000.jpg
- phase_lattice_2d_0100.jpg
- phase_lattice_2d_1000.jpg
- solar_system.jpg
- Jamfile
- make_controlled_table.qbk
- make_dense_output_table.qbk
- odeint.qbk
- reference.xml
- reference_integrate_functions.qbk
- reference_old.qbk
- reference_steppers.qbk
- stepper_table.qbk
- tutorial.qbk
- tutorial_chaotic_system.qbk
- tutorial_harmonic_oscillator.qbk
- tutorial_solar_system.qbk
- tutorial_special_topics.qbk
- tutorial_stiff_systems.qbk
- tutorial_thrust_cuda.qbk
- examples
- ideas
- performance
- regression_test
- test
- test_external
- README
- tex
- TODO
|
#include <iostream>
#include <boost/array.hpp>
#include "euler.hpp"
#include "size_adjuster.hpp"
using namespace std;
typedef boost::array< double , 3 > state_type;
const double sigma = 10.0;
const double R = 28.0;
const double b = 8.0 / 3.0;
void lorenz( const state_type &x , state_type &dxdt , double t )
{
dxdt[0] = sigma * ( x[1] - x[0] );
dxdt[1] = R * x[0] - x[1] - x[0] * x[2];
dxdt[2] = x[0]*x[1] - b * x[2];
}
int main()
{
explicit_euler< state_type , initially_resizer > euler;
//you would use never_resizer for arrays, but just to show that no resizing is called
//even with initially_resizer I use this one here.
state_type x;
x[0] = 1.0; x[1] = 1.0; x[2] = 2.0;
euler.do_step( lorenz , x , 0.0 , 0.1 );
cout << x[0] << " " << x[1] << " " << x[2] << endl;
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.