Questions tagged [ode]

An ODE (ordinary differential equation, in contrast to partial differential equation) is a differential equation containing a function or functions of exactly one independent variable.

An ODE (ordinary differential equation, in contrast to partial differential equation) is a differential equation containing a function or functions of exactly one independent variable. Equations of this type can be solved numerically or analytically.

1902 questions
0
votes
0 answers

How to implement three initial conditions in a second order ODE solver in Matlab?

Disclaimer: I am new to matlab. I have a set of two coupled ODEs for two variables y1 and y2. And I have the following ICs: y1(0), y2(0), dy1(0)/dt, dy2(0)/dt, d^2y2(0)/dt^2 , d^2y1(0)/dt^2 d^2y2/dt^2 = f(y2, dy2/dt, d^2y1/dt^2) d^2y1/dt^2 = f(y1,…
Vikash
  • 115
  • 1
  • 11
0
votes
0 answers

Set a value manually at intermediary times in scipy.solve_ivp

I am simulating chemical reactions. That involves simple ODE systems, which I solve with scipy.solve_ivp as shown below (here I convert species y[0] into y[1] at a fixed rate). import matplotlib as plt import scipy as sp import numpy as np def…
Mowgli
  • 101
0
votes
0 answers

python integrate ode with fixed time step

I would like to integrate a vector ODE in python with fixed time-step (and also a fixed amount of fuction-evaluations per time step). As far as I know this is not possible with scipy.odeint (when I put hmin=x=hmax, it still does more evaluations at…
0
votes
1 answer

Fit specific set of parameters in ODEs model in R

I am working on a model with 8 ODEs, and want to fit some of the parameters (not all) based on observed data I have on just 3 of the 8 state variables. This is my code: library("FME") library("deSolve") library("lattice") # Model construction and…
Tomas Marina
  • 73
  • 10
0
votes
0 answers

How can i plot the variable stepsize ODE solver chooses in matlab?

im trying to plot the stepsize for ODE45 and ODE15s against x but I have no clue how to find the values for each step size. any ideas?
0
votes
0 answers

Trying to use perl Math::GSL::ODEIV

I am trying to use the perl module Math::GSL::ODEIV - the perl interface to the Gnu Scientific Library. I can follow the example given in the GSL docs to solve the van der Pol diff. Equation. However I am unable to see how to translate to the perl…
0
votes
0 answers

representing a thermal model in Matlab using ODEs

I am working on simulating an AC just like what's been shown in this link. I have managed to convert it into an AC by flipping some equations and re-initializing some values. Now, I need to make it in Matlab to able to let my system work smoothly…
Isra
  • 155
  • 1
  • 12
0
votes
1 answer

Numerical solution of ODE with fixed condition at the final time with Python

I'm trying to solve an ODE of the form x'=f(x), x(T)=x_{T} in python using scipy.integrate.odeint. However, this has the form: scipy.integrate.odeint(func, y0, t,...), where y0 is the vector of initial conditions. I do not have an initial vector,…
FerCimat
  • 3
  • 2
0
votes
0 answers

Why do i get "Error using vertcat" in Matlab ode45 solver?

I have the following function to be solved by ODE45 solver of Matlab: function f = odefun(t, y) global mu ft % y = [a, h, k, p, q, L, lla, lh, lk, lp, lq, lL]; a = y(1); h = y(2); k = y(3); p = y(4); q = y(5); L = y(6); lla = y(7); lh = y(8); lk =…
Esi
  • 13
  • 6
0
votes
1 answer

Tensorflow Odeint

I've a system that i need to use a graph to solve this function. RLC Series - ODE equation I'm trying to use tf.contrib.integrate.odeint(), however, this function can only get first order ODE, so I divided in two Differential equations. Here is what…
brunoto
  • 91
  • 9
0
votes
1 answer

Python - Using odeint with an integral in the ODE

I'm working with an ODE of the form: a*dv/dt + (b+k1)*v + c*integral_0->t_(vdt) = k1*v1 + k2*integral_0->t_(v1dt) I'm trying to implement odeint to get a solution for this system, but I'm not sure how to do that with an integral in the ODE. v1 is a…
Spuds
  • 148
  • 1
  • 2
  • 13
0
votes
1 answer

Python ODE45 IndexError: list assignment out of range

I am trying to duplicate an ODE script I have running in Matlab to Python. Here is the Matlab script: t0 = 0; tfinal = 25; q1 = 1; q2 = 1; q1dot = 0; q2dot = 0; % ODE variables times = [t0 tfinal]; stateVars=[q1 q1dot q2 q2dot]; % ODE45 options =…
RocketSocks22
  • 391
  • 1
  • 4
  • 20
0
votes
0 answers

Finite difference/Euler method for system of ODE IVP in Fortran 90/95?

I think there might be similar question asked (I didn't find any though). Is there any Fortran 90/95 code to solve coupled ODEs IVP using finite difference or Euler method (I do believe it is available, I didn't find though)? I have about 150…
user50695
  • 3
  • 2
0
votes
1 answer

Scipy: excessive odeint work

I have a first order ODE system: f(x) = x_i ** 2 - x_i for all i (I'm working on 3 dimensions for now). This is how I've defined it: lower, upper = -10, 10 def xdot(__xs, t): return [__xs[i] ** 2 - __xs[i] for i in range(len(__xs))] x0 = [1.2,…
xiyukagif
  • 13
  • 1
0
votes
1 answer

Python SciPy ODE solver not converging

I'm trying to use scipy's ode solver to plot the interaction between a 2D system of equations. I'm attempting to alter the parameters passed to the solver by the following block of code: # define maximum number of iteration steps for ode solver…
Adam G.
  • 75
  • 11