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

Visual C++ Odeint integrate_const no matching overloaded function

I'm trying to use integrate_const in Visual C++, as part of a class with an overloaded operator(). Why is the compiler failing to specialize the template? size_t steps = boost::numeric::odeint::integrate_const(stepper, *this, x, tbegin, tfinal, dt,…
Salmonstrikes
  • 737
  • 1
  • 6
  • 25
0
votes
1 answer

Printing only the final odeint output

I am sorry this may appear as a pretty dumb question, but I need to ask whether it is possible to print only the final output value while solving coupled differential equations in odeint? Actually I am trying to solve two coupled differential…
0
votes
2 answers

Cannot compile C++ files with boost and odeint

I installed boost using brew install boost in order to use odeint library (the odeint webpage says : odeint is a header-only library, no linking against pre-compiled code is required). I am on Mac Yosemite 10.10.5 . Now when I cd to…
Ha Vu
  • 89
  • 1
  • 8
0
votes
1 answer

Control time step using odeint (Boost)

I am trying to learn solving ODE problem by using ODEINT library via the following example. However, when I output the result the time step is just jumping over 0; 1; 5.5; 25... Is there a way to control this time step to make it increment by "1".…
hieu
  • 135
  • 3
  • 11
0
votes
1 answer

Solving a system of ODEs backwards in time in c++

Unfortunately, I have noticed that BOOST's odeint cannot solve a system of ODEs backward in time i.e. when I change the conditions so that typedef std::vector< double > state_type; void ode_function(const state_type &x, state_type &dxdt, const…
Revist
  • 163
  • 10
0
votes
1 answer

Optimizing writing equations for odeint

I wrote the following code for a simple chemical network to be solved by odeint: def chemnet(y,t): assoc=0.1,0.001,1 oxy=0.001,0.1,0.001 f=zeros(6,float) f[0]=…
SteelAngel
  • 145
  • 7
0
votes
1 answer

Using dopri5 with odeint boost library

system of equations Hi. I want to evolve those equations in time from zero to 10^16 and initial condotions x(0)=10^8 and y(0)= 0.5. Because of the dependence of the equations on x in the denominator I think using odeint with runge_kutta_dopri5 is a…
Tcm
  • 11
  • 3
0
votes
1 answer

Python ODEINT problems with args

I am relatively new to Python and trying to use it to solve an integrator problem x' = - L * x Where L is the Laplacian Matrix, that is a matrix representation of a graph. This is part of my code: def integrate_cons(x, t, l): xdot = -l*x …
oigna
  • 121
  • 7
0
votes
2 answers

Extending type signature of System while using `boost::numeric::odeint`

The system of ode $f'(x,t) = f(x,t)$ has to have the following signature as mentioned here void sys( const state_type & /*x*/ , state_type & /*dxdt*/ , const double /*t*/ ) { // ... } It is possible to modify it to the following void sys( const…
Dilawar
  • 5,438
  • 9
  • 45
  • 58
0
votes
1 answer

TypeError: model() takes exactly 3 arguments (5 given)

odeint with following setup works fine; import numpy as np import matplotlib.pyplot as plt from scipy.integrate import odeint v0 = 10.0 k1 = 0.5 k2 = 0.35 def model(x,t): dx0 = v0 - k1*x[0] dx1 = k1*x[0] - k2*x[1] return [dx0,…
sci9
  • 700
  • 1
  • 7
  • 21
0
votes
0 answers

odepack.error: The function and its Jacobian must be callable functions

odepack.error: The function and its Jacobian must be callable functions. How so i solve this? #!/usr/bin/env python from sympy import * from scipy.integrate import odeint from matplotlib import pyplot as plt from scipy import optimize as opt…
0
votes
2 answers

ofstream Odeint output to txt file

I try to run this example from the ODEINT library to solve ODE. It just runs fine, but instead of cout the results to screen, I want to write them to a file. I add this ofstream to the code under write_cout function but it only writes the last line…
hn.phuong
  • 835
  • 6
  • 15
  • 24
0
votes
1 answer

Problems with a function and odeint in python

For a few months I started working with python, considering the great advantages it has. But recently, i used odeint from scipy to solve a system of differential equations. But during the integration process the implemented function doesn't work as…
0
votes
1 answer

How to solve this ordinary differential equation using C++ Boost odeint library

Using boost c++ odeint library, how to solve the following ordinary differential equations of motion, z'' = -n²·z. The analytical solution of the aforementioned ODE is z(t) = (z0'/n)·sin(n·t) + z0·cos(n·t). Solution attempt as per comment (Jan…
0
votes
1 answer

What do I need to do to make the odeint integrate function compile within another class?

I have been trying for several days to attempt to have ODEINT's integrate_adaptive() function compile within a class. If I take the function outside of a class and have generic function names, then the program compiles and works as required. (out is…
simonfrfr
  • 75
  • 9