Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

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.

Filter by
Sorted by
Tagged with
-2
votes
0answers
25 views

Are 2nd spatial derivatives useful for integrating ODEs?

In discussion of adaptive integrators for ODEs, I see a lot of discussion of how second derivatives in time can be approximated using finite differences, i.e., take several steps, and use numerical ...
2
votes
3answers
83 views

What is the flaw in my stability analysis?

The ODE $${d^2x\over dt^2}=-kx; k>0$$can be converted in the system of linear equations as $$\begin{align} {dx\over dt} & =v\\ {dv\over dt} &= -kx\\ \end{align}$$ Using Euler’s method, ...
0
votes
0answers
22 views

solving electron motion in undulator by Boris method

I am trying to use Boris scheme to solve the electron trajectory in undulator. The undulator field I used is: $$B_x = b_0\sin(2\pi \tfrac{z}{\lambda_u})$$ where $b_0 = \dfrac{2\pi c_{0}K}{q m_{e} \...
2
votes
1answer
58 views

Numerical solution to parametrized second order ODE with nonuniform coefficients

I am trying to solve numerically the following second order linear ODE: $a \frac{\partial^2 u}{\partial x^2} + \frac{\partial u}{\partial x} \frac{\partial a}{\partial x} + b u =0$, on the domain $[...
1
vote
1answer
45 views

ODE Event detection for calculating multiple roots of continuous sinusoidal equation

Hey everyone I have a paper that has a method for computing rise and set times of a satellite given a closed form solution. It is a complicated sinusoidal function and the paper has a method to ...
1
vote
1answer
63 views

How to Break Coupled ODEs down to first order for Runge-Kutta

My question might seem a bit simple. I am trying to solve a system of ODEs using Runge-Kutta method. I am having difficulty breaking down the equations into a system of first order ones required ...
2
votes
1answer
44 views

Passing data as arguments in ODE45

I need to import data from file in order to describe the structure of a network. I used the following: weights = readtable('weights192.txt'); W = weights{:,:}; ...
3
votes
2answers
79 views

ode45 with matrix initial conditions

EDIT: We have a coupled system of 10 ode each. The coupling presents in the last equation. I thought about using a matrix 10 by 2 as initial conditions. I also followed a similar question with the ...
7
votes
1answer
118 views

Eigenvalue-like problem with coupled ODEs

I am looking at the following system of ODEs: \begin{array}{r}{\left[c_{2}(k)-\partial_{\tau}^{2}\right] \varphi_{2}\left(\tau \right)=f_{21}(\tau) \varphi_{1}\left(\tau \right)} \\ {\left[c_{1}(k)-...
2
votes
0answers
35 views

Equivalent of multiple-scale analysis for a linear ODE

I came across the method of multiple-scale analysis and was intrigued, because I am trying to solve a linear ODE with multiple characteristic timescales. When I apply the method as described, say, ...
1
vote
0answers
37 views

How to deal with a huge system of ODEs in Boost ODEINT?

I am using the C++ library ODEint, which is part of Boost, to solve an extremely large system of coupled ODEs - in particular 1975 equations with large rational functions in the coefficients. In the ...
0
votes
0answers
31 views

Solutions in Ngspice do not converge to right value

I recently noticed while using Ngspice that the solution converges to a deviated value if the number of iterations per unit period for a square wave is less than 100, i.e. if I am using a square wave ...
3
votes
1answer
72 views

Good reference on the implementation and limitations of SDIRK methods

For the solution of many PDE, implicit high-order time integration schemes are required. I am specifically interested in schemes that do not require a constant time step. I am well acquainted with ...
0
votes
0answers
46 views

A non linear ode with boundary conditions at infinity

I want to solve the non-linear ODE $$\frac{d^2}{dx^2}y=a(y+y^3)$$ With the boundary conditions that $$\lim_{x\to \pm \infty} y(x) =0$$ I am not aware of any analytical method for solving this kind ...
2
votes
0answers
46 views

Can Taylor methods be used effectively on stiff ODEs?

Cleve Moler has stated that "all numerical methods for stiff odes are implicit." However, I don't know whether this statement is a mathematical fact, or an simply an observation. Moreover, many ...
2
votes
0answers
66 views

How to solve $y(x) y'''(x)=f(x)$

I have a PDE of the form $\partial_t y(x,t)+\partial_x(y(x) y'''(x)-f(x))=0$, where $f(x)=\cos(x)$. Suppose a stable equilibrium exists, and I want to find the steady-state solution $y(x) y'''(x)=f(x)...
15
votes
5answers
1k views

Why does the numerical solution of an ODE move away from an unstable equilibrium?

I wish to simulate the behaviour of a double-pendulum-like system. The system is a 2-degrees-of-freedom robot manipulator that is not actuated and will, therefore, behave mostly like a double-pendulum ...
6
votes
1answer
88 views

Going back in time in an initial value problem

Consider an initial value problem (IVP) $y'=f(t,y)$ with the initial value given by $y(t=0) = 0$. If I need to find $y(t^*)$, hence finding the path for $y$ in $t \in [0,t^*]$ and $t^*<0$; is the ...
5
votes
1answer
95 views

What are systematic ways of approximating a non-smooth (non-continuously differentiable) system dynamic to be n-smooth?

I have a system dynamic that is non-smooth because it has several signum and absolute value functions in it (three-tank level control). I can obviously choose different sigmoid functions to ...
4
votes
1answer
86 views

$L^\infty$ stability property of an ODE

Suppose we have the initial-value problem on $(0,L)$: $$ \frac{d u(x)}{d x} = f(x) u(x),\, \qquad x\in\Omega,\,~~ u(0) = u_0, $$ I am reading a claim that says if we multiply the ODE by $u$ and ...
2
votes
1answer
47 views

Symplectic linear multistep method?

I'm doing a gravitational n-body simulator and I'm thinking of implementing linear multistep methods like Adam-Bashforth. But is there any symplectic multistep methods?
0
votes
0answers
44 views

Computing Trajectory Equations of Kerr Geodesics

I want to numerically solve the trajectory equations of a Kerr geodesic given by wikipedia in Matlab. The trajectories look like: I implemented the equations and solved it with the standard Runge-...
2
votes
1answer
235 views

Forward and backward integration — cause of errors

I write a test program to integrate foward on $[0,T_f]$ and then backward on $[T_f,0]$ from the endpoint of the forward integration an Hamiltonian system: $$ \dot q(t) = \frac{\partial H}{\partial p}(...
0
votes
0answers
25 views

Finding the polynomial for the solution of an ODE

I’m stuck trying to solve part (b) and (c) of the below problem, but part (b) is the one of main concern here as I think (c) should follow easily once (b) is completed. I don’t know where to start ...
1
vote
0answers
44 views

Finite dimensional optimization problem over dynamical system

I am interested in solving numerically the following mathematical problem Consider an ode of the form $$ \dot q(t) = f(q(t),t_1,\ldots, t_N),\qquad t\in [0,T], $$ where $q\in \mathbb{R}^n$ is the ...
7
votes
1answer
128 views

Is there any explicit symplectic Runge-Kutta method?

As far as I know, all the symplectic Runge-Kutta methods are implicit which need to solve non-linear equations during the calculation. Is there any explicit method? If not, why?
1
vote
1answer
55 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
38 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
125 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
342 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
62 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
56 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
39 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 ...
3
votes
0answers
64 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
89 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
97 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
415 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
144 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
17 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
135 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
128 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
68 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
113 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
81 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
161 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
39 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
23 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
67 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
80 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
98 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 ...