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
1answer
283 views

Comparison between CashKarp Method and Dormand Prince Method - Runge Kutta Method

Can Cash Karp Method be used for integrating a nonsmooth solution ?. Because Dormand Prince method gives an error while integrating nonsmooth solution How can nonsmooth function can be integrated? I ...
4
votes
1answer
563 views

What is the case of trade-off in different Runge Kutta methods

There are so many Runge Kutta methods, including Dormand-Prince 45 Cash-Karp 54 Fehlberge 78 Is there any comparison between them? What is each approach sacrificing? What is the general trade-off ...
0
votes
2answers
255 views

Matlab: ode45 loop

I have to solve this equation $$\ddot{x}x = -\frac{3}{2}\dot{x}^2 + \frac{\dot{x}}{h} + \sin(t)$$ where $h$ is defined by $$h = \left(\frac{\dot{x}}{h}\right)^{1/3} + \frac{\dot{x}}{h}$$ My idea ...
2
votes
0answers
458 views

Scaling step size in adaptive runge-kutta method

I'm developing my own generic Runge-Kutta solver, and I'm currently implementing the adaptive step-size routine. I say generic because I want to be able to test different RK implementations by only ...
-1
votes
1answer
317 views

Which ODE solver in Matlab allows me to advance in just one timestep only

[t,y] = odeXX(odefun,tspan,y0) I have a solver odeXX, and the tspan = [0 0.0001]. It seems that for any ode solver in MATLAB, they integrate by breaking ...
0
votes
1answer
542 views

How to properly implement Backwards Euler on a system of bodies

I have a system of two bodies, $b^i$ and $b^j$, each in position $\vec{p}^i = (x^i, y^i)$ and $\vec{p}^j = (x^j, y^j)$. The two are connected via spring and I'd like to know, given their states at ...
0
votes
1answer
418 views

Use of scipy sparse in ode solver

I am trying to solve a differential equation system $$x´=Ax\quad \text{with } x(0) = f(x)$$ in Python, where $A$ indeed is a complex sparse matrix. For now i have been solving the system using the ...
3
votes
1answer
259 views

Runge Kutta solution blows up for a first order ODE with very large coefficients

I am solving a first-order ODE: $\frac{\partial \rho }{\partial t} = -a \rho^2 + b |A(t)|^2 \rho +c|A(t)|^{2m}$ This is the evolution of the plasma density in the presence of a laser pulse (complex ...
-2
votes
2answers
119 views

Numerically solving differential equations, the domain is very long, [0, +10^6), so the calculating time is very long

Is there any method to deal with this problem? I am using Mathematica to solve the differential equations, but the calculating time is so long because of the large domain $x\in[0,10^{6})$. In fact I ...
1
vote
0answers
85 views

The Schrodinger equation for time-dependent Hamiltonian after one timestep, taking exponential or use ode solver?

The Schrodinger equation for time-dependent Hamiltonian is $$i\hbar\frac{d}{dt}\psi(t) = H(t)\psi(t) \, .$$ Assuming I knew $\psi(t)$, I want to know $\psi(t+\Delta t)$. Should I take exponential ...
3
votes
1answer
123 views

Will the numerical solving of the differential equation be wrong if I take the step too small? [closed]

If I take the step too large I will get error, while if I take the step too small I also get an error. In my case, instead of seeing the function decreasing, i have it increasing if I take the step ...
0
votes
1answer
351 views

Implementing odespy for system of PDEs

After trying to use RK4 to solve the below system of equations, it appears the output had large and fast oscillations even with an adaptive time step I incorporated using the Cash-Karp method. I am ...
7
votes
1answer
665 views

Why does LSODA fail to integrate the logistic function?

I'm comparing some of the different ODE integrators in scipy.integrate.ode on solving the logistic function: $$x(t) = \frac{1}{1+e^{-rt}}$$ $$\dot{x} = rx(1-x)$$ ...
2
votes
1answer
327 views

Object falling with air resistance using Runge-Kutta

I am not very familiar with differential equations, nor physics in general. I am trying to program an object falling with air resistance with the use of a numerical algorithm called Runge-Kutta. The ...
-2
votes
1answer
219 views

Solving a differential equation using numerical methods and matlab

(a) Consider the following differential Equation $$Y'(t)=\frac{1}{1+t^{2}}-2[Y(t)]^2$$ $$Y(0)=0$$ The exact solution is $$Y(t)=\frac{t}{1+t^2}$$ Using the Euler method to solve the following ...
1
vote
2answers
3k views

Multiple Coupled Differential Equation solution in Python

I have 4 ordinary differential equations that are coupled. The variables in the 4 equations are functions of time and space and one of them is second order in space. \begin{equation} \frac{ \partial ...
0
votes
1answer
70 views

Solving ODEs of Switched Systems using MATLAB ODE suite

I have the following code to execute: $X$ = [0;0;0;0]; $sw$ = 0; ...
2
votes
3answers
112 views

Solving ODE with multiple equilibriums

Consider an ODE of the form: $$ u'(t)=-\frac{1}{\varepsilon}u(u-\frac{1}{2})(u-1) $$ with the initial value $$ u(0)=u_0. $$ Here $\varepsilon>0$ is a constant. It is easy to verify that $u\equiv0$ ...
4
votes
1answer
999 views

How to find conditional Lyapunov exponents

For a synchronized ODE system,I wanted to know if there is a program code in MATLAB available for plotting the conditional Lyapunov exponent. For example, synchronization of identical Rossler system ...
2
votes
1answer
3k views

Comparison of velocity Verlet and leapfrog algorithms

Many sources present the Euler, Verlet, velocity Verlet, and leapfrog algorithms for integrating Newton's equations. Based on the order of accuracy, it is agreed that velocity Verlet, Verlet, and ...
4
votes
1answer
184 views

Solve an ODE with positivity-preserving property unconditionally

I have an ODE for a scalar function $u=u(t)$ of the form: $$ \frac{du}{dt}=L(u). $$ Here the function $L=L(u)$ satisfies: $$ L(0)=0, \quad L'(u)\le0. $$ Then it is easy to see that the solution $u=u(t)...
3
votes
1answer
290 views

Computational time not proportional to integration interval in ODE-solver?

I am running octave and i have been trying ode45, ode54, ode23 etc to integrate the equation ` $$Q''(t) = B\cos(Q)\sin(\omega t)$$ $$Q(t=0)=0.$$ When the time interval to be integrated increases, the ...
1
vote
0answers
38 views

How come the use of delay differential equations in model parameter estimation better than ordinary differential equations? [closed]

in systems biology why is the use of delay differential equations better than ordinary differential equations i.e. compartment models in delay modelling? is there a data independence angle in models ...
0
votes
2answers
92 views

Integrating a dynamical system until an algebraic condition is satisfied

I have a model given by a system of differential equations $$ \frac{dy}{dt}=f(y)$$ with $y=(y_1,y_2,y_3)$ and $f:\mathbb{R}^3 \to \mathbb{R}^3$. The system works as follows : integrate the ode's ...
3
votes
2answers
218 views

Determine numerical infinity for Schrodinger equation $−\psi''(x) + x^ 2 \psi(x) = E\psi(x)$

Consider the following Schrodinger equation for the harmonic oscillator with real $x$: $$ −ψ''(x) + x^ 2 ψ(x) = Eψ(x). $$ I solve the last equation using shooting method and implicit Runge-Kutta ...
8
votes
3answers
4k views

ODEs vs DAE vs ADE?

I am totally confused between ODEs which I am familiar with, and differential algebraic equations (DAE) and Algebraic Differential Equations (ADE). Are they the same but just different names or what ...
5
votes
2answers
6k views

How to implement Newton's method for solving the algebraic equations in the backward Euler method

Can you explain me how does the backward Euler method works? I have seen the formula and try to understand the method, but what I can't understand is why and how to use the Newton-Rapson method. Do ...
1
vote
0answers
61 views

How to solve bring my implicit equation to closed form? [duplicate]

I have a simulated system as shown in the following image: $L_0$ is attached to two other bodies $L_1$ and $L_2$. Furthermore, body $L_3$ is also in the simulation (it is attached to $L_2$ but that ...
3
votes
1answer
1k views

Switch between 2 equations to be given to ODE using events

I am trying to simulate a system with bilinear stiffness described by the following equations: $25\ddot{x}+15\dot{x}+330000x = p(t)$ if $x < 0.00072$ $25\ddot{x}+15\dot{x}+930000x = p(t)$ if $x &...
1
vote
0answers
77 views

What is the best option in terms of library or software to solve this system of hyperbolic PDEs?

I want to solve a system of coupled nonlinear 1-D PDE $(\partial_{tt} + \alpha\partial_t)u_i(x,t)=\partial_{xx}(\sum_{j=1}^{j<i}ju_j(x,t)+i\sum_{j=i}^{n}u_j(x,t))-\sin(u_i(x,t))+f$, using method of ...
-1
votes
1answer
91 views

Why is this method for simulating a system of springs and masses unstable?

I have a computer simulation system of bodies connected by springs, so their movement is governed by: $x_{n+1} = x_n-\Delta tk(x_n-r)$ Where $r$ is the idea distance between every two bodies, and $\...
2
votes
1answer
163 views

Methods for solving $x'=Ax+b$ for small, sparse, singular $A$

I am in the process of building a robotics physics engine. I have been using the Linear ODE $x' = Ax + b$ for the core of my physics integration, but have never found a really good solution method for ...
2
votes
1answer
128 views

Problem with Richardson extrapolation method for weak convergence in SDE

I have implemented the Richardson extrapolation of the Euler-Maruyama method to 4th order, to estimate the moments of SDE. The Euler-Maruyama works, and I would expect the Richardson extrapolation to ...
7
votes
2answers
328 views

Numerical investigation of stability of motion (confinement)

I am trying to find the required specifications of a RF trap, in which a proton can be confined.(trap dimensions, voltage frequency and amplitude used, etc). I have to solve the equations of motion ...
4
votes
2answers
291 views

Accuracy of numerical methods in finding eigenvalues

I have a problem with assesing the accuracy of my numerical calculation. I have a 2nd order ODE. It is an eigenvalue problem of the form: $$ y'' + ay' + \lambda^2y = 0, $$ and the boundary condiations ...
5
votes
1answer
59 views

Projection on Stiefel manifold after integration step

A few days ago, I asked how constraints like $A^T A = I$ can be implemented if one wishes to integrate differential equations of the form $\dot{A}=f(A,t)$. Kirill was so kind to point out that a ...
3
votes
1answer
120 views

Integration of differential equation with orthogonality constraint

Lets say I have a system of differential equations which has the form $$\dot{C}_{\alpha,\beta,m} = f_{\alpha,\beta,m}(C_{\alpha,\beta,1},\ldots,C_{\alpha,\beta,N};t).$$ The $f$s are some functions of ...
2
votes
0answers
149 views

How to obtain the reduced model from a subspace projection method?

I have a system of ordinary differential equations (ODEs). It is a large system that has dozens of equations and hundreds of parameters. I wish to reduce its size so it becomes computationally more ...
7
votes
1answer
312 views

Richardson extrapolation for strong rate of convergence of SDE

Is it possible to apply Richardson extrapolation with Euler-Maruyama scheme to improve strong rate of convergence of stochastic differential equations?
1
vote
1answer
201 views

Solving stiff equations in Mathematica

I have problem to solve stiff equations. Any idea on how to solve this? I have tried "StiffSwitching" but it didnt work. Im solving this using Mathematica 10. Here is my code. Im sorry if I wrote the ...
1
vote
1answer
1k views

Solving second order SDE with Gaussian white noise for first time derivative in Matlab

I'm having trouble solving a second order differential equation with Gaussian white noise. The equation I'm solving follows the form: $$Ax'' + Bx' + \sin(x) = i + i_{n}$$ where $i_{n}$ is the ...
8
votes
1answer
555 views

Which numerical methods preserve time reversal symmetry?

If I have a physical system which contains a time reversal symmetry (for example a Hamiltonian $H(x,p)=p^2/2m + V(x)$ with $V(x)$ real) and I want to solve the differential equations which describe ...
-3
votes
1answer
201 views

How can I solve stiff equations by method of line (MOL)?

I want to solve 7 coupled equations.I use method of line(MOL) and discrete the equation in Length and radius and convert them to a system of ODEs in time.and use ode15s to solve them in MATLAB. But an ...
1
vote
1answer
436 views

Shooting method - Matlab ODE

I'm trying to solve these equations of hypersonic adiabatic flow over a flat plate. I did all the simplifications and got these equations for the stagnation point flow. $$\left(Cf''\right)' + f f'' = \...
3
votes
0answers
105 views

Numerically solving geodesic differential equations with a priori knowledge of the Riemann curvature tensor

The geodesic differential equations are given as \begin{align} \frac{d^2 x^j}{ds^2} + \Gamma^{\phantom{h}j}_{h\phantom{j}k}\frac{dx^h}{ds}\frac{dx^k}{ds} = 0, \end{align} where the $\Gamma^{\phantom{...
1
vote
1answer
117 views

Fixed-step ODE solver with variable order?

I am interested in fixed-step simulation of an ODE. The methods I know of are either variable-step with prescribed error tolerance or fixed-step without error control. Are there methods known which ...
7
votes
1answer
131 views

Solving an ODE beyond existence. What's happening?

As an example for an ODE course I used the ODE $$ y' = \frac{y}{x} + \frac{1}{\cos(\tfrac{y}{x})} $$ to illustrate domains of existence. Standard substitution $z=y/x$ turns the equation to $$ z' = \...
2
votes
1answer
408 views

BDF methods for implicit-explicit method

Are there BDF formulas like the ones given here but one that can be used with implicit-explicit discretization? The right hand side in those formulas is supposed to be implicitly discretized at the ...
5
votes
1answer
62 views

Solving an ODE while maintaining weak positivity and weak monotonicity

I have a system of $N$ ODEs of the form, $$ M(z,F(z)) \cdot F'(z) = \Phi(z,F(z)) $$ where the mass matrix is $M(z,F): R\times R^N \to R^{N\times N}$ and $\Phi(z,F):R\times R^N \to R^N$ is (potentially)...
3
votes
0answers
188 views

Spectral Collocation (or Weighted Residual) Methods to solve Stiff ODEs?

I have a system of ODEs which is (at least moderately) stiff. Consider the class of spectral collocation methods https://en.wikipedia.org/wiki/Spectral_method or the related class of weighted ...