lorenz.hpp 737 B

123456789101112131415161718192021222324252627282930313233
  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. #ifndef LORENZ_HPP_
  12. #define LORENZ_HPP_
  13. #include <boost/array.hpp>
  14. struct lorenz
  15. {
  16. template< class state_type >
  17. void inline operator()( const state_type &x , state_type &dxdt , const double t ) const
  18. {
  19. const double sigma = 10.0;
  20. const double R = 28.0;
  21. const double b = 8.0 / 3.0;
  22. dxdt[0] = sigma * ( x[1] - x[0] );
  23. dxdt[1] = R * x[0] - x[1] - x[0] * x[2];
  24. dxdt[2] = x[0]*x[1] - b * x[2];
  25. }
  26. };
  27. #endif /* LORENZ_HPP_ */