Brian Silverman | 7c33ab2 | 2018-08-04 17:14:51 -0700 | [diff] [blame^] | 1 | /* |
| 2 | * lorenz.hpp |
| 3 | * |
| 4 | * Copyright 2011 Mario Mulansky |
| 5 | * Copyright 2012 Karsten Ahnert |
| 6 | * |
| 7 | * Distributed under the Boost Software License, Version 1.0. |
| 8 | * (See accompanying file LICENSE_1_0.txt or |
| 9 | * copy at http://www.boost.org/LICENSE_1_0.txt) |
| 10 | */ |
| 11 | |
| 12 | |
| 13 | #ifndef LORENZ_HPP_ |
| 14 | #define LORENZ_HPP_ |
| 15 | |
| 16 | #include <boost/array.hpp> |
| 17 | |
| 18 | struct lorenz |
| 19 | { |
| 20 | template< class state_type > |
| 21 | void inline operator()( const state_type &x , state_type &dxdt , const double t ) const |
| 22 | { |
| 23 | const double sigma = 10.0; |
| 24 | const double R = 28.0; |
| 25 | const double b = 8.0 / 3.0; |
| 26 | dxdt[0] = sigma * ( x[1] - x[0] ); |
| 27 | dxdt[1] = R * x[0] - x[1] - x[0] * x[2]; |
| 28 | dxdt[2] = x[0]*x[1] - b * x[2]; |
| 29 | } |
| 30 | }; |
| 31 | |
| 32 | |
| 33 | #endif /* LORENZ_HPP_ */ |