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
4
votes
1 answer

Modelling a quantum harmonic oscillator/SHM

I need help to figure out why my ground state graph for b) looks wrong, here's the question in full: (I thought posting it in full would give context to the method I'm trying to use) (a) Consider a square potential well with ()=0 in between two…
user5056300
4
votes
1 answer

Erasing previous data/plots in Julia (Plots.jl, GR backend)

I have solved an ODE in Julia describing the motion of a particle, and I have saved the coordinates and respective time in an array. I would like to create an animated gif image of a plot with the particle along the solved trajectory, but to do that…
Sato
  • 1,013
  • 1
  • 12
  • 27
4
votes
2 answers

Solution from SciPy solve_ivp contains oscillations for a system of first-order ODEs

I'm trying to solve a system of coupled first-order ODEs: where Tf for this example is considered constant and Q(t) is given. A plot of Q(t) is shown below. The data file used to create the time vs Q plot is available at here. My Python code for…
wigging
  • 8,492
  • 12
  • 75
  • 117
4
votes
1 answer

How to call GEKKO correctly from Matlab

I found a function for calling python from Matlab. So, I tried to use this function for calling GEKKO package from Matlab for solving ODE. I have gotten an error for defining a gekko option (remote=true) as function or variable. I opened Matlab with…
Junho Park
  • 997
  • 4
  • 12
4
votes
1 answer

A possible bug in odeint <-> interp1d interplay?

I'm relatively new to python and scipy, being a convert from MATLAB. I was doing a quick test of the odeint function in scipy.integrate, and came across this potential bug. Consider the following snippet: from scipy import * from scipy.integrate…
Luis E.
  • 841
  • 11
  • 15
4
votes
1 answer

Scipy ODE time steps going backward

I've looked around on Stackoverflow, but could not find anything that would answer my question. Problem Setup: I am trying to solve a system of stiff ODEs using scipy.integrate.ode. I've reduced the code to the minimal working example: import scipy…
Vasily
  • 73
  • 5
4
votes
3 answers

Best Free Ordinary Differential Equation Library in .net

I'm looking for a library to solve ODE for my university thesis' project... The library I'd like to find had to have this features: Event Calculus (something like a continuous calculus stopped by internal event, like constraint reached and other…
Ziba Leah
  • 2,484
  • 7
  • 41
  • 60
4
votes
2 answers

solve ordinary differential equation with time dependent coefficients in python (odeint)

I would like to solve a system of 7 ordinary differential equations (ODEs) with 15 time dependent coefficients using scipy's odeint function. I store my coefficients in a dictionary so that I can access them by Key names within the function (func)…
burtphil
  • 178
  • 2
  • 9
4
votes
1 answer

Internal working of scipy.integrate.ode

I'm using scipy.integrate.ode and would like to know, what happens internally when I get the message UserWarning: zvode: Excess work done on this call. (Perhaps wrong MF.) 'Unexpected istate=%s' % istate)) This appears when I call ode.integrate(t1)…
Fred_UB
  • 49
  • 2
4
votes
1 answer

multidimensional Euler's method python

So I have coded a function for Euler's method. However, I want it to be able to use initial conditions with arbitrary dimensions. So for example, currently my functions works using this: >>>Euler(f, x0, t0, h, N) where x0 is a float. However I…
4
votes
1 answer

How to display Matlab's ode45 results in real time?

Let's suppose that we have the following solver for a system of first-order ODEs: % func.m function dydt = func(t,y) dydt = [y(2); (1-y(1)^2)*y(2)-y(1)]; and the main code: % solver.m tspan=0:1:10; [t,y] = ode45(@func,tspan,[2; 0]); How…
Andreas K.
  • 9,282
  • 3
  • 40
  • 45
4
votes
0 answers

Solving ODE with scipy.integrate.ode and scipy.integrate.odeint give different results

I am trying to solve a simple ODE with both odeint and ode methods of SciPy. The example I am using is the disease spread (I will later try to solve my more complex ODEs). The function should look like this: My odeint code gives results that are…
wmac
  • 1,023
  • 1
  • 16
  • 34
4
votes
1 answer

Numerically Solving ODE with SciPy

I'm stuck with applying scipy.integrate.odeint to the following very simple ODE: y(t)/dt = y(t) + t^2 and y(0) = 0 The solution computed by SciPy is not correct (most likely b/c I confuse something here) - particularly the solution does not meet…
Raffael
  • 19,547
  • 15
  • 82
  • 160
4
votes
0 answers

MatLab ODE start/stop conditions for ode15i

I was searching for ways to terminate MATLAB ode when it meets a particular condition. I found the answer in this topic MatLab ODE start/stop conditions, where the use of 'events' was discussed. However this applies to ode45 and when I attempted to…
4
votes
1 answer

Solving vector ordinary differential equations in python with scipy odeint

I'm trying to solve and ode that involves vectors and can't come out with a feasible answer. So i split it into 6 components, one for each time derivative of a component, and one for each time derivative of a velocity component. The first value…
Greg Castaldi
  • 355
  • 1
  • 4
  • 11