The Stack Overflow podcast is back! Listen to an interview with our new CEO.

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
7
votes
2answers
621 views

How to decide stability of Runge-Kutta method for non-linear ODE?

I'm working on a parameter study of Duffing's equation $\ddot x + \delta \dot x + \alpha x + \beta x^3 = \gamma \cos{\omega t},$ where $\delta, \alpha, \beta, \gamma$ and $\omega$ are real ...
6
votes
1answer
145 views

Are there high order symplectic methods for $y'=f(y)$?

Are there high order energy-conserving or symplectic methods for solving $y'=f(y)$?
14
votes
4answers
1k views

Optimal ODE method for fixed number of RHS evaluations

In practice, the runtime of numerically solving an IVP $$ \dot{x}(t) = f(t, x(t)) \quad \text{ for } t \in [t_0, t_1] $$ $$ x(t_0) = x_0 $$ is often dominated by the duration of evaluating the right-...
5
votes
1answer
953 views

Code to numerically integrate a system of first-order ODEs

I need to solve the following system of differential equations. When I have the solutions for $n_f$ and $v$, I need to find and plot $J=-e_\cdot n_{f} \cdot v$. I wrote a code in matlab with all ...
2
votes
1answer
72 views

Can you give me a detailed description of (spetral) deferred correction method?

I have just read "Accelerating the convergence of spectral deferred correction methods". The link is here: http://www.unc.edu/~junjia/papers/sdcgmres.pdf‎. But I wonder how to understand deferred ...
1
vote
1answer
239 views

ODE Solving in SCILAB

I have a certain ODE problem which needs to be solved using Scilab. dx(1)/dt=k*x(1)-x(5) dx(2)/dt=k2*x(2)-k1*x(1) dx(3)/dt=k1*[x(2)-x(3)] dx(4)/dt=k1*[x(3)-x(4)] ...
5
votes
1answer
167 views

Modern alternatives to DRESOL Riccati solver

I am looking for a modern version or an alternative to the DRESOL package for differential matrix Riccati equations. The main issue that the original package uses single-precision type ...
3
votes
2answers
293 views

Nanoseconds vs. picoseconds in numerical quantum problems with Matlab ODEs

Hello there and thanks for taking a look at this problem. This problem is related to my previous question and I will therefore use a similar introduction from, Choice of step size using ODEs in ...
12
votes
3answers
3k views

Choice of step size using ODEs in matlab

Hey there and thanks for giving time to look at my question. This is a updated version of my question which I posted earlier in physics.stackexchange.com I'm currently studying a 2D exciton spinor ...
1
vote
0answers
229 views

Block Backward Differentiation Formula (BBDF), on order 4 formula

I am trying to implement a program the numerical method to solve ODE called Block BDF as explained in this article: https://waset.org/journals/waset/v38/v38-49.pdf As it is variable step-size, I need ...
3
votes
1answer
326 views

Heat transfer in pipe

I have a gas (assuming air) at $T$ = 500 K that enters a cylindrical pipe. The outlet target temperature is 330 K. There will be heat transfer via: Forced convection from the gas to the inside of the ...
11
votes
2answers
854 views

How do you improve the accuracy of a finite difference method for finding the eigensystem of a singular linear ODE

I am attempting to solve an equation of the type: $ \left( -\tfrac{\partial^2}{\partial x^2} - f\left(x\right) \right) \psi(x) = \lambda \psi(x) $ Where $f(x)$ has a simple pole at $0$, for the ...
1
vote
1answer
97 views

Solving an ODE without a boundary condition [closed]

I have an ODE without a boundary condition: $\small\left(\frac{d}{dr}C(r)\right)^4-2C(r)\left(\frac{d^2}{dr^2}C(r)\right)\left(\frac{d}{dr}C(r)\right)^2+2\left(\frac{d}{dr}C(r)\right)C(r)^2\left(\...
8
votes
2answers
752 views

How to solve the stiff equation in this Restricted Three Body Problem numerically?

I've come across a stiff equation in solving the Circular Restricted Three Body Problem. [An object is moving considering the effect of the gravitational forces caused by two gravitational sources ...
6
votes
2answers
2k views

Intermediate values (interpolation) after Runge-Kutta calculation

I have a numerical ODE simulation that I computed at fixed time step $h$ using a 4-th order Runge-Kutta method (RK4), producing a series of results $(x_1,y_1), (x_2,...
0
votes
1answer
145 views

Spring damper model does not work very well

I'm trying to model a spring damper system from a tutorial that I've found on this site. If I use the exact same parameters as the ones in the tutorial the system is not stable. I've downloaded the ...
1
vote
0answers
30 views

Combining trend estimation and constrained Marquart fit

This title certainly needs some clarification: I need to compute parameters $a_i$ for a helper function $f(\vec{a};k)$ (for grid interpolation) which is fitted to a number of values $y_k$ which are ...
5
votes
3answers
213 views

Is there a way to reduce aberration in computations of planets' trajectories?

I don't think the title is very accurate , sorry for that. I simulate bodies in space using two timestep: the TIMESTEP is the Δt wich I use to make the calculation and XTIME is the number of times ...
26
votes
3answers
2k views

How does one test a numerical ODE solver implementation?

I'm about to start working on a software library of numerical ODE solvers, and I'm struggling with how to formulate tests for the solver implementations. My ambition is that the library, eventually, ...
4
votes
1answer
510 views

Solving Coupled ODE eigenvalue problem

I've been trying to find some resources that would help me figure out how to numerically solve a coupled system of ODEs which is also an eigenvalue problem. The system is something like: $ \tag{1} ...
15
votes
3answers
1k views

Numerical methods for discontinuous r.s. ODEs

what are state of art methods for numerical solution of ODEs with discontinuous right side? I'm mostly interested piecewise-smooth right side functions, e.g. sign. I'm trying to solve the equation of ...
3
votes
2answers
100 views

Best form for a system of ODEs to solve with Runge_kutta

Recently when I was solving a system of ODEs using runge-Kutta method , I got much different results when I transformed the variables from spherical coordinates ($r$ and $\theta$ ) to cylindrical ...
2
votes
2answers
1k views

Solver error in SciPy/LSODA with a very specific parameter set

I'm implementing a very simple Susceptible-Infected-Recovered model with a steady population for an idle side project - normally a pretty trivial task. But I'm running into solver errors using either ...
9
votes
4answers
357 views

Reference request: Rigorous analysis of algorithms for PDE and ODE

I'm interested in suggestions for book references on the subject of numerical PDE and ODE, in particular, a rigorous analysis of such methods in a manner written for professional mathematicians. It ...
11
votes
3answers
1k views

Numerically stable explicit solution of small linear system

I have an inhomogeneous linear system $$ Ax=b $$ where $A$ is a real $n\times n$ matrix with $n\leq 4$. The nullspace of $A$ is guaranteed to be of zero dimension so the equation has a unique ...
3
votes
0answers
92 views

Dissipation and symplectic manifolds

I'm working on an API for simulation of port-Hamiltonian systems. As far as I understand it, a Hamiltonian system is symplectic if it is power conserving, and so including resistive elements would ...
5
votes
3answers
241 views

which numerical method for ode with mixed BCs

I've got a second order nonlinear ODE (nothing fancy), but the BC are a little odd to me: $y'(0) = 0$ $y \rightarrow y_a$ as $x \rightarrow \infty$ What's a good numerical method for solving this? ...
2
votes
0answers
93 views

System of non-linear ODEs and estimating unspecified initial conditions on Maple 12

I have the following 1st order equations and need to solve them using Maple 12. There are unspecified initial conditions and can only be estimated through the Newton raphson method. My problem is how ...
4
votes
1answer
214 views

How do I solve an ODE Two-Point Boundary Value Problem?

I have a feeling my question is a very basic one, but I am not at all well versed in computational sciences. My equations are of the form: $$ y \in \mathbb{R}^3 \\ \dot{y}(t) = f(y(t)) \\ y_1(0) = a ...
1
vote
1answer
485 views

How to apply a Galerkin finite element method to a linear, one-dimensional boundary value problem

I have the following boundary value problem: $$-(\alpha u')' + \gamma u = f $$ in $\Omega = (a,b)$ with b.c. $u(a) = u(b) = 0$ and $\alpha > 0, \gamma ≥ 0$ and $f:(a,b) \to \Re $ The weak ...
6
votes
5answers
2k views

What other method can be used to solve differential equations except ode functions in Matlab?

Recently I am taking advantage of the ode45, as well as ode23s, ode15s solvers in ...
12
votes
1answer
215 views

Algorithms for linear system of ODEs

I wonder: what is the best algorithm to solve \begin{equation} \frac{du}{dt} = Au \end{equation} Where $A$ is a real $n\times n$ matrix. A is not explicitly time dependent, usually sparse but not ...
11
votes
4answers
6k views

solving coupled ODEs with initial-value and final-value constraints

The essence of my question is the following: I have a system of two ODEs. One has an initial-value constraint and the other has a final-value constraint. This can be thought of as a single system with ...
7
votes
5answers
565 views

What algorithm for solving a set of stiff ODEs would be easiest to port to high precision floating point arithmetic?

I want to solve a relatively small system of stiff ODEs (< 10 first-order equations) using high precision floating point arithmetic (using MPFR or alike). What would be the easiest algorithm to ...
8
votes
2answers
6k views

Solving non-linear singular ODE with SciPy odeint / ODEPACK

I want to solve the Lane-Emden isothermal equation [PDF, eq. 15.2.9] $$\frac{d^2 \!\psi}{d \xi^2} + \frac{2}{\xi} \frac{d \psi}{d \xi} = e^{-\psi}$$ with the initial conditions $$\psi(\xi = 0) = 0 \...
4
votes
1answer
321 views

Convert ODE into discrete probabilistic model

how can I turn an ODE equation into a discrete probabilistic model? I take for example the Verhulst equation for the growth of a population. $$\frac{dP}{dt} = rP(1-P/K)$$ I was thinking to simulate ...
9
votes
3answers
149 views

Numerics: How do I renormalize the following ODE

This question is more about how to tackle a problem numerically. In a small project I wanted to simulate the coorbital motion of Janus and Epimetheus. This is basically a three body problem. I ...
9
votes
5answers
2k views

Symbolic solution of a system of 7 nonlinear equations

I've got a system of ordinary differential equations - 7 equations, and ~30 parameters governing their behavior as part of a mathematical model of disease transmission. I'd like to find the steady ...
11
votes
4answers
483 views

Runge-Kutta and Reusing Datapoints

I am trying to implement the fourth order Runge-Kutta method for solving a first order ODE in Python i.e. $\frac{dy}{dx} = f(x,y)$. I understand how the method works, but am trying to write an ...
10
votes
3answers
837 views

Can I use an explicit time stepping scheme to determine numerically whether an ODE is stiff?

I have an ODE: $u'=-1000u+sin(t)$ $u(0)=-\frac{1}{1000001}$ I know that this particular ODE is stiff, analytically. I also know that if we use an explicit (forward) time stepping method (...
17
votes
4answers
4k views

The definition of stiff ODE system

Consider an IVP for ODE system $y'=f(x,y)$, $y(x_0)=y_0$. Most commonly this problem is considered stiff when Jacobi matrix $\frac{\partial f}{\partial y}(x_0,y_0)$ has both eigenvalues with very ...
5
votes
3answers
985 views

Implementing Euler's method for initial value ODEs

In my physics class, I had to calculate the trajectory of a projectile that was fired (very fast) with $v_0$ in an angle off a planet (radius $R$, mass $M$) from the surface. The projectile would ...
12
votes
2answers
2k views

Is there an open source set of ODE solvers for C that use the native C99 complex type?

I've been using GSL as the foundation of many of my simulations, but it's a little bit overkill for my purposes and it defines its own complex type for legacy reasons. Rather than code my own Runge-...