Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [ode]

Ordinary Differential Equations (ODEs) contain functions of only one independent variable, and one or more of their derivatives with respect to that variable. This tag is intended for questions on modeling phenomena with ODEs, solving ODEs, and other related aspects.

-1
votes
0answers
24 views

Online Parameter Estimation using Lyapunov method

I have a first order system which is described by the following differential equation: $\ \dot{x} = -a*x + b*u $ where u is the input $\ u = 5*sin(3*t) $ and also the state ...
0
votes
1answer
48 views

Online Parameter Estimation using steepest descent

I have a first order system which is described by the following differential equation: dx/dt = -a*x + b*u where u is the input <...
2
votes
1answer
28 views

Discretization with non-constant matrix containg entries form unknown vector

Consider a system of PDEs $$ \begin{cases} u_t = \nabla \cdot (D(u)\nabla u) + \frac{c}{K_U+c}u-ku\\ c_t = d_c\Delta c -\frac{\nu_U c}{K_U + c}u \end{cases} $$ with some boundary conditions. Here, $D(...
2
votes
1answer
63 views

Dormand–Prince 5(4): How to update the stepsize and make accept/reject decision?

https://en.wikipedia.org/wiki/Dormand–Prince_method I want to implement the Dormand-Prince 4(5) version to solve Initial Value problems. Using regular notation I have $A$ matrix and the $c,b,\hat{b}$ ...
5
votes
1answer
326 views

Is there a database/website with Butcher tableaus?

I have started investigating in mostly Runge Kutta and Runge Kutta Nyström methods and there one of the only differences between the methods of the same type is their Butcher tableu. For the most ...
2
votes
0answers
43 views

How to implement adaptive step size Runge-Kutta Cash-Karp?

Trying to implement an adaptive step size Runge-Kutta Cash-Karp but failing with this error: ...
3
votes
0answers
44 views

Calculate the Bloch wave

The eigenvalue problem $$\frac{d^2u}{dx^2}+2i k\frac{du}{dx}-[k^2-6\sin(x)^2]u(x)=-\mu u(x)$$ gives the first five eigenvalues with $k=0$ or $k=1$ which are $2.06$, $2.26$, $5.16$, $6.81$, and $7....
0
votes
0answers
40 views

Python ODE solver with implicit Euler method [closed]

I am looking for two python solvers using these methods: Backward (implicit) Euler method with fixed step size Backward (implicit) Euler method with adaptive step size I need the solvers to be able ...
0
votes
0answers
37 views

Time sampling changes solution

I'm currently trying to solve a problem using numerical methods. The set-up is rather long, so I apologize in advance... TL;DR: My solutions change depending on how big my steps are and I don't know ...
-1
votes
0answers
24 views

Euler's method in scilab

I trying to solve this system of equations with Euler's method $$\begin{aligned} \frac{dn_0}{dt} &= -n_0(t)W_{01}(t) + n_1(t)K_{10}\\ \frac{dn_1}{dt} &= -n_1(t)W_{12}(t) - n_1(t)K_{10} + n_2(...
3
votes
0answers
54 views

Solve ODE with non-negative and maximization constraints

My task is to solve $$\eta_k\frac{d^2C_k}{dz}(z)=-e_k, k = 1,2,3$$ $$C_k\ge0$$ $$C_1(0)=0, C_2(0)=A, C_3(0)=0$$ $$C_1(L)=B, \frac{dC_2}{dz}(L)=0, \frac{dC_3}{dz}(L)=0$$ with $$e_1 = -\beta_1-\beta_3$...
1
vote
1answer
85 views

What's the minimum step size that can be used in Euler's method before it becomes unreliable?

In particular, if Euler's method is implemented on a computer, what's the minimum step size that can be used before rounding errors cause the Euler approximations to become completely unreliable? I ...
2
votes
1answer
86 views

Formulation of the least-squares parameter estimation problem

I have a system of 10 ordinary differential equations of the form, $$\frac{dy_1}{dt} = f1(V1,k1,y1,y2)\\ \vdots \\ \frac{dy_{10}}{dt} = f_{10}(V_{10},k_{10},y_{9},y_{10}) $$ I want to estimate the ...
1
vote
1answer
386 views

What is the state of the art in solving stiff initial value problems?

I'm looking for current references on solving stiff ODEs. Most of what I know (say, BDF methods) apparently date back to the 1980's, and I feel like a lot of progress should have been made in that ...
1
vote
1answer
105 views

Solving differential equation in Python with variable coefficients (I just know the coefficients numerically)

I am trying to implement a routine to solve a differential equation in Python. Basically the kind of equation that I am interested in solving is of the form: $\displaystyle \frac{d}{dx^2} \left(x y(x)...
1
vote
0answers
15 views

Translating grid with extrusion speed

I am putting into MATLAB code the equations that describe a plastic extrusion process. From a paper, I found I should use a spatial grid that translates with the extrusion speed, being the reference ...
0
votes
2answers
108 views

Non-linear Boundary Value Problem. How to compute the Jacobian?

Consider a Boundary Value Problem: $$ \delta u''+u(u'-1) =0 \Leftrightarrow u''=\frac{-u(u'-1)}{\delta}=:f(t,u',u), \\ u(0)=a, u(1)=b $$ $\delta,a,b$ are known parameters. I want to implement Newton'...
3
votes
1answer
123 views

What does the exponential function mean in numerical ODE solving formulas?

I'm trying to read papers on numerical ODE algorithms and I always seem to stumble upon huge amounts of exponentials multiplied by each other. For example in New families of symplectic splitting ...
3
votes
1answer
64 views

What is ABA and BAB schemes when talking about numerical integrators

I have read a lot about numerical integrators (ode solvers) lately and tried reading a few papers but I have stumbled upon something that I can't understand and it's something called ABA and BAB. ...
6
votes
2answers
110 views

Efficient approach for solving matrix plus diagonal matrix system that varies in time

When solving a system of ODEs, as part of a preconditioner, I get the system $(A + D(t))x = b(t)$ where $A$ is a sparse matrix and $D(t)$ is diagonal. I'm currently solving this by taking the LU-...
0
votes
1answer
79 views

Actual global error vs theoretical global error: How to combine theory with practice

I have implemented an Adams Bashforth 4 method to solve an Initial Value Problem for an ODE and I am testing it against the test equation: $y'=\lambda y$ with $y(0)=1$ with the exact solution: $y(t)=...
2
votes
1answer
151 views

Mass Matrix and how to handle it (ODEs) - References

I'm interested in a good reference/paper about how to handle numerically a mass-matrix system as \begin{align} \mathbf{M}(t,y)\dot{y} =F(y,t) \end{align} I know that such a problem can be solved by ...
0
votes
0answers
37 views

Discrete maximum principle for discretized ODE

I discretized the following ODE using central finite differences for 1st and 2nd derivatives: $$u''-bu'=f(u), x\in (0,1)\\u(0)=1, u'(1)=0\\ b>0, f:\mathbb{R_{\ge 0}}\to \mathbb{R}_{\ge 0}$$ The ...
0
votes
0answers
20 views

Non linear Parametric BVP with inequalities

Consider a non linear ode in dimension $10$: $\dot x = f(t,x,\lambda)$ where $\lambda$ is a vector of $p$ parameters. Consider a boundary value problem of the form : $\dot x(t) = f(t,x(t),\lambda)$ ...
1
vote
1answer
57 views

Adam Bashforth 4 method: how to determine starting values and stil keep the the order of accuracy

I am using an Adam Bashforth 4 method to solve an IVP problem so I need other numerical method to estimate the first 3 values. I am very much interested in finding a way to estimate the first 3 values ...
0
votes
1answer
66 views

Combining multiple coupled 1st order equations in python

I'm having serious troubles with solving translating 3 coupled differential equations into python. The 3 DE's stem from a 4th order DE used to calculate the bending moment of an underwater pipeline ...
0
votes
1answer
75 views

Unexpected solutions solving an ODE using odeint

I am trying to solve a system of 8 coupled differential equations using scipy's odeint. I have already written my code and it runs fine, but the solutions I get are completely different from what I ...
3
votes
1answer
51 views

Numerical solving Lotka-Volterra ODE in R

Aim: I am trying to numerically solve a Lotka-Volterra ODE in R, using de sde.sim() function in the sde package. I would like to use the ...
1
vote
0answers
72 views

SDE solver in python: manual determination of integrator step size (dt)

Aim: I am trying to solve a system of SDEs, while using the SDEint package in python 3.x. It is a system of SDEs adapted from and inspired by the Zombie Apocalypse ...
0
votes
1answer
97 views

calculating integral for an ODE system

I have an ODE system defining a mathematical model of a biological system, say $$ \frac{da}{dt}=f_1(a,b,\ldots,z,p)\\ \frac{db}{dt}=f_2(a,b,\ldots,z,p)\\ \cdots\\ \frac{dz}{dt}=f_n(a,b,\ldots,z,p) $$ ...
0
votes
1answer
62 views

Approximation of ODE solution using Taylor series methods

This is my first post on here, so please excuse mistakes if any. I am trying to plot out the difference between two ODE solvers based on Taylor series: 1st order acccurate: $x(t_0 + h) = x(t_0) + ...
3
votes
1answer
117 views

Derivation of backward differentiation formulas(BDF)

I have been reading upon numerical techniques that are used to solve stiff ordinary differential equations. From the description given here, I could follow the steps till equation (5). I am finding ...
1
vote
1answer
41 views

Wrong results for $2$ stage multistep method $y_{n+2} - y_n = h\left[(1/3)f_{n+2} + (4/3)f_{n+1} + (1/3)f_n\right]$

I need to fix a code to utilise the $2$ stage multistep method : $$y_{n+2} - y_n = h\left[(1/3)f_{n+2} + (4/3)f_{n+1} + (1/3)f_n\right]$$ Since this is an implicit method, I used a Newton-Raphson ...
4
votes
0answers
65 views

Solution of constrained system of ODEs

Can someone point me in a direction to solve this kind of integral constrained system of ODEs. \begin{align} &\int_0^{1/2}\dot{y}^2(t)=p\\ &2\lambda_1\ddot{y}(t)+\pi cos(\pi y(t))=0\\ &y(...
-1
votes
1answer
90 views

Scipy Two-point Boundary value Problem

Nonlinear ODE Statement I would like to use scipy to solve the following: u'' + (u')^2 = sin(x) u(0)=0, u(1)=1 where u = u(x). Approach I am looking at the ...
1
vote
1answer
93 views

Shooting method implementation

I have a trouble of defining a Jacobian matrix for my problem. Basically, I have 4 differential equations to be solved. $$ \begin{aligned} \dot x_1(t)&=x_2(t)\\ \dot x_2(t)&=p_2(t)−\sqrt 2 ...
4
votes
1answer
140 views

ODE: should Euler implicit be more accurate than Euler explicit for a given computational step?

I am aware than Euler explicit is conditionally stable, and Euler implicit is unconditionally stable. And I am aware that it is probably pointless to use Euler implicit with a small computational step ...
5
votes
1answer
111 views

Numerical solution of two coupled nonlinear eigenvalue problems

I would like to numerically solve the following system of coupled nonlinear differential equations: $$ -\frac{\hbar^2}{2m_a} \frac{\partial^2}{\partial x^2}\psi_a + V_{ext}\psi_a + \left( g_a |...
3
votes
1answer
200 views

Step-size selection for an Trapezoidal Method ODE solver (ode23t)

I was reading the documentation of the MatLab ODE solver ode23t, and I've seen that the trapezoidal rule is used. Moreover, the error is estimated by ...
1
vote
0answers
88 views

How to solve an implicit ODE with forward Euler?

Consider the implicit ODE $$ M(y)\dot{y} = F(t,y) $$ If $M$ is non-singular for all $y$ How to use the forward-Euler method to numerically solve for $y$ without inverting $M(y)$? I only came out ...
3
votes
3answers
149 views

How well do explicit Runge-Kutta “tableau” methods compare to the state of the art ODE solvers and when do they fail?

How well do explicit Runge-Kutta "tableau" methods compare to the state of the art ODE solvers and when do they fail? I've been reading Butcher's ODE book and he does a good job at introducing ...
2
votes
1answer
95 views

Euler Method Instability. Why?

I am currently enjoying writing computational codes as a hobby. Right now I've worked out an Euler method and results are pretty good with up to $x=1$. Over $x=1$, instability starts to kick in. May I ...
3
votes
1answer
93 views

Ordinary differenial equation with numerical right hand side

I'm interested in solving a differential equation in which I don't know the analytical form of the right hand side, I only know its numerical value for a finite set of values of the independent ...
0
votes
1answer
42 views

How do I find the default ODE solver tolerances in Matlab?

You can set the Absolute or Relative ODE solver tolerances in Matlab with the options structure from an odeset command. But how do I find the default values for the ...
1
vote
1answer
149 views

Integrating direct dynamics form more than 1 second does not give back the correct result

I am trying to simulate a robot manipulator dynamics in SciLab. Basically, I generated a step function that has constant acceleration for half of the time and then the same acceleration but negative ...
10
votes
1answer
132 views

Are there shortcuts for numerically approximating systems of ordinary differential equations when autonomous?

Existing algorithms for solving ODEs handle functions $\frac{dy}{dt} = f(y, t)$, where $y \in \mathbb R^n$. But in many physical systems, the differential equation is autonomous, so $\frac{dy}{dt} = f(...
4
votes
2answers
116 views

Estimating error at mid timesteps for Runge-Kutta methods

When a timestep $h$ is rejected using a Runge-Kutta pair, such as Dormand–Prince, the algorithm resumes from the same initial point $t$ with a smaller timestep. A different idea is to resume at an ...
1
vote
1answer
134 views

Can a second-order ODE be “inconsistent” with its boundary conditions?

I am trying to solve a set of coupled, nonlinear ODEs. The only dependent variable is a 1-dimensional spatial coordinate, let's call it $x$. For now, I've managed to approximate away some of the ...
2
votes
0answers
82 views

Solving an ODE from many starting points

I have a situation where I'm interested in solving the same ODE many times, from different initial locations. More precisely, I'm interested in solving an ODE of the form \begin{align} \frac{dx}{dt} &...
4
votes
1answer
297 views

Solving for a set of coupled ODEs to get correct variable values

My question is about how I can solve a coupled system of ODE's, and print out the variables in a plot. I am solving for an q value and an e value, seen in this set of coupled ODE's below: $$ \begin{...