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
3
votes
0 answers

Running scipy.odeint through multiple cores

I'm working in Jupyter (Anaconda) with Python 2.7. I'm trying to get an odeint function I wrote to run multiple times, however it takes an incredible amount of time. While trying to figure out how to decrease the run time, I realized that when I…
Greg Castaldi
  • 355
  • 1
  • 4
  • 11
3
votes
1 answer

ODEint: adaptive integration with arbitrary precision

Is it possible for ODEint to use adaptive integration routines with arbitrary precision arithmetic? For example, I'd like to use the Boost multiprecision libraries with the integrate_adaptive() function with a controlled stepper. The ODEint…
nielsw
  • 33
  • 3
3
votes
1 answer

Controlling output limits in Scipy's ODEINT

I have the following simplified pseudocode setup which involves a system of ODEs, which I attempt to solve with scipy's odeint. from scipy.integrate import odeint def diff_func(y, time, parms): # Do stuff with parms that depends upon y and t. …
Oniow
  • 307
  • 1
  • 12
3
votes
1 answer

wrong output of boost::odeint with custom tensor data structure

Based on @Piotr Skotnicki answer here I have defined the following data type: #ifndef TENSOR_HPP #define TENSOR_HPP #include #include #include namespace nex { template struct seq…
Bociek
  • 1,195
  • 2
  • 13
  • 28
3
votes
1 answer

How to plot the Eigenvalues when solving matrix coupled differential equations in PYTHON?

Lets say we have three complex matrices and a system of coupled differential equations with these matrices. import numpy, scipy from numpy import (real,imag,matrix,linspace,array) from scipy.integrate import odeint import matplotlib.pyplot as…
string
  • 102
  • 1
  • 11
3
votes
1 answer

TypeError when using scipy.integrate.odeint

I'm trying to solve a set of coupled differential equations using scipy.integrate.odeint. However when I try to run the program I get the following error: TypeError: Cannot cast array data from dtype('O') to dtype('float64') according to the rule…
David VdH
  • 237
  • 2
  • 7
3
votes
1 answer

ODEINT Unable to Call on Function

so I am attempting to solve a system of three ODEs and developed the following code to solve them using ODEint. But when I run, ODEint has an issue calling on my function for the system of equations. from scipy.integrate import odeint #initial…
3
votes
1 answer

Accurate multidimensional integral using boost odeint

What is the recommended way to calculate a multidimensional integral using boost odeint with high accuracy? The following code integrates f=x*y from -1 to 2 but the error relative to an analytic solution is over 1 % (gcc 4.8.2, -std=c++0x): …
user3493721
  • 185
  • 6
3
votes
1 answer

Integral control system does not behave properly

Yesterday I posted a question here: ValueError and odepack.error using integrate.odeint() which I thought had been successfully answered. However I have since noticed a couple of things. When running this program it does not tend towards the…
Dan Oberlam
  • 2,435
  • 9
  • 36
  • 54
3
votes
3 answers

ValueError and odepack.error using integrate.odeint()

I'm trying to write an equation to model and then plot an integral control system (specifically regarding cruise control). However I'm receiving two errors whenever I run it: ValueError: object too deep for desired array odepack.error: Result from…
Dan Oberlam
  • 2,435
  • 9
  • 36
  • 54
3
votes
1 answer

odeint simple 1d ode example does not compile

I try to run odeint examples in boost_1_54_0 on Debian Squeeze g++4.4 Lorenz system works fine, but Simple 1d ode: #include #include using namespace std; using namespace boost::numeric::odeint; /* we solve…
cpp
  • 3,743
  • 3
  • 24
  • 38
3
votes
1 answer

How to handle discontinuity with odeint

I want to know what would be the best (computationally efficient, good-looking code) way to handle discontinuity using odeint. Is there any example code? I am simulating something like a feedback controlled motor whose angle is measured digitally by…
user22097
  • 229
  • 3
  • 13
3
votes
1 answer

how to control the order of bulirsch_stoer method in boost::odeint?

I am using boost::numeric::odeint ODE solvers and have a question about them. The instructions says bulirsch_stoer is a Stepper with step size and order control. Besides, the order is a variable the user could change. I look at the header file but…
XYZ
  • 53
  • 7
3
votes
2 answers

Two point boundary with odeint

I am trying to solve two point boundary problem with odeint. My equation has the form of y'' + a*y' + b*y + c = 0 It is pretty trivial when I have boundary conditions of y(x_1) = y_1 , y'(x_2) = y_2, but when boundary conditions are y(x_1) = y_1 ,…
Eugene B
  • 995
  • 2
  • 12
  • 27
3
votes
1 answer

NumPy odeint output extra variables

What is the easiest way to save intermediate variables during simulation with odeint in Numpy? For example: def dy(y,t) x = np.rand(3,1) return y + x.sum() sim = odeint(dy,0,np.arange(0,1,0.1)) What would be the easiest way to save the…
Ross B.
  • 986
  • 9
  • 14