Questions tagged [odeint]

Odeint is a modern C++ library for numerically solving Ordinary Differential Equations.

Odeint is designed in a very flexible way such that the algorithms are completely independent of the underlying containers and even from the basic algebraic computations. That means odeint works not only with the standard containers like vector< double > or array< double , N > but also nicely cooperates with many other libraries.

Odeint can solve ODEs on GPUs by using nVidia's CUDA technology.

512 questions
5
votes
1 answer

Halt scipy odeint on first error

Edit: This problem is due to a bug, fixed in Scipy 0.15 As I'm developing and testing code, I may make a simple error, like a NameError. When I use scipy.integrate.odeint, odeint will print the error message, but keep integrating for however many…
Alex Szatmary
  • 3,431
  • 3
  • 21
  • 30
4
votes
1 answer

Do controlled error steppers in boost odeint support complex data types?

I encountered a problem with the odeint library using a controlled error stepper together with a complex state type. The code from the example with the complex stuart landau equation, I modified such that it includes an adaptive integrator. The code…
Schnarco
  • 183
  • 4
4
votes
1 answer

How to solve a differential equation for different initial conditions

I want to solve a differential equation continuously by changing the initial conditions only. I have tried a lot but didn't find any suitable process to do that properly. Can anyone please share any idea about that. For your kind consideration I'm…
Photon
  • 159
  • 3
  • 12
4
votes
1 answer

Solution for differential equation is completly different in boost::odeint and scipy.integrate

I am trying to port my rapid prototyping from python to C++. I try to test the notation with a simple differential equation, but the results are very different for starting value [2,0]. Python is declining, while the C++ solution is rising…
atec01
  • 43
  • 2
4
votes
1 answer

extract values from function used by odeint scipy python

I have the following script to calculate dRho using odeint. P_r = 10e5 rho_r = 900 L = 750 H = 10 W = 150 A = H * W V = A * L fi = 0.17 k = 1.2e-13 c = 12.8e-9 mu = 2e-3 N = 50 dV = V/N dx = L/N P_in = P_r rho_in = rho_r P_w = 1e5 rho_w =…
MD'
  • 105
  • 7
4
votes
0 answers

Saturation limits/controlling output scipy's odeint using sympy/pydy

I'm using PyDy to create the system of ODE's for three-body system as such: right_hand_side = pydy.codegen.generate_ode_function( forcing_vector, model.coordinate_symbols, model.speed_symbols, model.constant_symbols, …
Kyle
  • 71
  • 5
4
votes
1 answer

Can I integrate with scipy's odeint until a local max is found?

This is my first question on here, so please go easy on me. I'm wondering if there is a way to integrate an ODE system only until a local max of a specified variable is found. Here is some more detail: Let's call our ODE system dX/dt = F(X) where…
JBOT
  • 41
  • 4
4
votes
1 answer

role of get_unit_value in boost ODEINT

In the following code from Boost library: template struct get_unit_value_impl { static T value(const T &t) { return t; } typedef T result_type; }; ... template typename…
torbani
  • 85
  • 5
4
votes
3 answers

Calling another function overload

I am heading to understand odeint from c++ boost library and I need to know which part does what. In boost/numeric/odeint/integrate/integrate_adaptive.hpp, there is a function called integrate_adaptive. This function has a few overloads. The…
barej
  • 1,330
  • 3
  • 25
  • 56
4
votes
1 answer

Creating a controlled stepper in odeint using OpenMP

I try to construct an controlled stepper with boost::odeint using the openmp_range_algebra typedef vector< complex< double > > state_type; typedef runge_kutta_dopri5< state_type > error_stepper_type; typedef controlled_runge_kutta<…
Vergilius
  • 41
  • 2
4
votes
2 answers

Comparison of odeint's runge_kutta4 with Matlab's ode45

I would like to use runge_kutta4 method in the odeint C++ library. I've solved the problem in Matlab. My following code in Matlab to solve x'' = -x - g*x', with initial values x1 = 1, x2 = 0, is as follows main.m clear all clc t = 0:0.1:10; x0 = [1;…
CroCo
  • 5,531
  • 9
  • 56
  • 88
4
votes
2 answers

Scipy odeint with banded Jacobian matrix

I'm integrating a system of stiff ODE's using SciPy's integrate.odeint function. As the integration is non-trivial and time consuming I'm also using the corresponding jacobian. By rearranging the equations I can define the jacobian to be a banded…
jakeret
  • 101
  • 7
4
votes
1 answer

Second order differential equation using C++ Boost odeint library

Using boost c++ odeint library, is it possible to solve a second order differential equation defined as follows ? m*x''[i] + x'[i] = K*\sum{j=1,N} sin(x[j] - x[i]), where i = 1,2,3..N. m = 1, K = 1 where initial value of x is an vector or array of…
ADK
  • 259
  • 2
  • 17
4
votes
1 answer

does boost odeint have a leapfrog algorithm?

I am using boost::odeint and so far I was using the runge_kutta4 stepper. Now I would like to switch to a leapfrog method, e.g. my iteration step should look like: f(t+dt) = f(t-dt) - p * f(t) So I need a multistep method, but I am a bit lost with…
user1304680
  • 700
  • 2
  • 5
  • 18
4
votes
2 answers

odeint (c++) - downsample observations

Sorry if this is a simple question - but is there a "best practice" for downsampling the evolution of the state variables in odeint? Below, I've copied a nice example for building an "observer" to log the state variables provided in this article…
digbyterrell
  • 3,449
  • 2
  • 24
  • 24
1
2
3
34 35