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

Error C2582 Boost ODEINT when using iterator-based integration

For a project I am working on I need to use an iterator-based solution in order to stop the integration when certain conditions are met. It looks like the following code, when applied to our specific situation, will work. When using Visual Studio…
0
votes
1 answer

Having problems with ODEINT in python

I am relatively new to Python and trying to use it to solve a second order nonlinear differential equation, specifically the Poisson-Boltzmann equation in an electrolyte. phi''(r) + (2/r)*phi'(r) = (k^2)*sinh(phi(r)) Essentially it describes the…
0
votes
0 answers

Behavior of thrust odeint make_zip_iterator with make_tuple, when argument vectors are of different size

When using odeint with thrust, I am developing an observer that will generate a histogram of state-variables while solving many initial condition problems in parallel. The initial conditions problems run in parallel, populating a device_vector with…
weemattisnot
  • 889
  • 5
  • 16
0
votes
0 answers

Python odeint, solution returning array of initial conditions

See code below import numpy as np from scipy.integrate import odeint # Define constants U = 1000 a = 5 Ta0 = (37+273) V_tot = 6 FA0 = 14.7 CA0 = 9.3 deltaCp = 0 Hrx_T = -6900 …
Alex
  • 1
0
votes
1 answer

In a ODEINT + THRUST observer, receiving error that expression must be a modifiable lvalue

I have been working on extending / modifying the thrust + odeint example [code,documentation] that varies systematically a parameter, and observes the effects. I am having a strange error, where when I try to modify certain variables that should be…
weemattisnot
  • 889
  • 5
  • 16
0
votes
1 answer

Odeint graph plot of bz reaction not giving correct graph result

I think the problem might be in 'func' but I cant find it. The graph I get is just a red line at 0. I'm trying to get the plot of z and y concentration over time for a Belousov–Zhabotinsky reaction. # -*- coding: utf-8 -*- from __future__ import…
0
votes
1 answer

How do I improve the speed of this code? (Solving ODEs with scipy.integrate.odeint)

I am trying to solve a relatively large ODE system with scipy.integrate.odeint module. I already implemented the code and I can solve the equation correctly. But the process is very slow. I profile the code and I realized that almost most of the…
Amir
  • 1,087
  • 1
  • 9
  • 26
0
votes
1 answer

Parametric plot of solution of 2x2 diff. system in python, Mathematica

I've implemented a solution to the following system of equations dy/dt = -t*y(t) - x(t) dx/dt = 2*x(t) - y(t)^3 y(0) = x(0) = 1. 0 <= t <= 20 firstly in Mathematica and afterwards in Python. My code in Mathematica: s = NDSolve[ {x'[t] == -t*y[t] -…
0
votes
1 answer

Having trouble with odeint in python

I am trying to write a script to solve an ODE in python and graph the result. I am using scipy.integrate.odeint for this task. I followed a simple tutorial and modified my code to work with the ODE that I want to solve import numpy as np import…
0
votes
0 answers

How to modify the initial conditon inside the function scipy odeint

When i try to solve a differential equation, I have found that the initial condition is different from before. The initial condition is : f(0)=0,f'(a)=0, unlike the condition f(0)=0,f'(0)=b the function odeint parameter y0 : array Initial condition…
fuping peng
  • 3
  • 1
  • 3
0
votes
1 answer

Simple 2d system (using array) with odeint does not compile

I'm running g++ 4.7 on Mint 12 with boost 1.55. I'm trying to solve a simple 2d system of ode with odeint -- following the 1d example here: 1d. The 1d example compiles alright in both the original version and the amended version from the answer. …
0
votes
0 answers

Stiff System with OdeInt with a constant in the change

I have a stiff system which I want to integrate with integrate_adaptive and a controlled rosenbrock4 stepper from (boost::) odeint. For the most conditions I can predict a good first time step, but for some it fails "for sure" I assume the problem…
MagunRa
  • 543
  • 4
  • 13
0
votes
1 answer

How to include derivative inside scipy odeint?

I am keep getting a long list of errors when I include a derivative function in a simple differential equation as illustrated in the following code. What am I doing wrong? import numpy as np from scipy.misc import derivative from scipy.integrate…
amaity
  • 267
  • 1
  • 3
  • 15
0
votes
1 answer

Canot compile C++ which uses odeint from boost

I'm on Ubuntu 12.04 & had some boost fies already in /usr/include. I did a sudo apt-get install libboost-all-dev and that installed a lot of files too. I don't want to remove this boost and install from source as several other packages depend on…
user2913814
0
votes
1 answer

Why is odeint time evolving these two differently in python?

I have two programs, one that can take in N coupled ODEs and one that uses 2 coupled ODEs. In the case that I input the 2 same ODEs into both codes, with the same time span, I get different answers. I know the correct answer, so I can deduce that my…
bynx
  • 760
  • 2
  • 8
  • 19