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.

learn more… | top users | synonyms

1
vote
0answers
36 views

Finite Difference Method for an ODE with Neumann and Robin boundary condition

Consider the following bvp: $-u''(x)+3u'(x)+u(x)=f(x) \quad in\quad \Omega=[0,1]$ $u'(0)=\alpha$ $u'(1)+2u(1)=\beta$ I have a Neumann at $x = 0$ and a Robin condition at $x = 1$. I refer to the ...
3
votes
1answer
43 views

Solve implicit ODE numerically in orbit simulation

I'm trying to plot the orbit of a compact binary star system where general relativistic effects become important. I'm using post-Newtonian approximation and I want to solve the orbit numerically based ...
7
votes
1answer
77 views

Forcing an ODE solver to preserve the norm

I have an ODE of the form $$ \frac{dy}{dt} = -i H y \enspace .$$ where $y$ is a complex vector and $H$ is a time dependent Hermitian matrix. The norm of the solution $y(t)$ at any point in time ...
-2
votes
2answers
78 views

Ways to solve numerically differential equations in C [closed]

I have to solve numerically a differential equation in C. The equation is: How can I write some code to solve it? Are there some numerical methods (Runge-Kutta maybe?) to solve it? A colleague ...
-1
votes
1answer
61 views

Is iteration an efficient algorithm in this case? [closed]

My task in numerical analysis is We are interested in finding values of β0 for which z(x) = 2500. Use an efficient algorithm to determine the rays which pass through the receiver. Now I'm ...
2
votes
0answers
36 views

Rank deficient Jacobian in discretized periodic solutions to autonomous ODE

I'm trying to numerically find periodic solutions to different systems of autonomous nonlinear ordinary differential equations. I decided to use a finite difference scheme and solve the resulting ...
9
votes
2answers
102 views

How can I numerically solve an ODE to $N$ provably correct digits?

Suppose we have an initial value problem of the form $$ \frac{\mathrm{d} \mathbf{x}}{\mathrm{d} t} = f(\mathbf{x}) \qquad \mathbf{x}(0) = \mathbf{x}_0 $$ where $\mathbf{x}_0 \in \mathbb{R}^n$ is known ...
2
votes
1answer
42 views

General heuristics for making a choice “dopri5”, and “lsoda”?

With scipy, I have the choice of using "lsoda": Real-valued Variable-coefficient Ordinary Differential Equation solver, with fixed-leading-coefficient ...
0
votes
0answers
47 views

system of coupled nonlinear ODEs with complex coefficients

I am interested in numerically solving the following system of coupled ODEs $$\left(i-\frac{1}{2\Omega}f_{m,n}\right) \frac{d a_{m,n}(t)}{dt} =E_{m,n}^{\text{kin}}(t) + ...
0
votes
0answers
43 views

Quick scheme for separable first-order ODE

I'm trying to integrate an incredibly simple ODE: $$ y'(x) = -f(y),\quad y(0) = y_0 \ , $$ from $x=0$ to $x=1$. This is a decay type of equation, $f$ is the (variable) decay rate and $y$ is the ...
2
votes
1answer
69 views

RK4 giving wrong result [closed]

I am trying to numerically solve a simple second order differential equation $x'' = -x$. I used a new variable $x'=v$, so I have two equations. While it seems simple, it somehow produces a result ...
4
votes
3answers
112 views

Numerical solution of IVP for linear ODE with variable coefficient blows up

Cross posted in Mathematica.SE, I'll try to rephrase it in a more general way here. A friend of mine showed me this initial value problem (IVP) for a linear ordinary differential equation (ODE) with ...
2
votes
0answers
152 views

Help implementing 1D (ODE) discontinuous Galerkin method

I think I made a mistake in calculating the system matrix $\bf H$ described below, I need help figuring out what went wrong. I'm trying to apply a discontinuous Galerkin method to approximate the ...
3
votes
1answer
101 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 ...
-1
votes
1answer
45 views

How do I stop negative numbers and error message: " Failure at t=3.562559e+03. Unable to meet integration tolerances

I am using 8 ODEs in Matlab to simulate the effect of asymptomatic infections in the epidemiology of a vector borne disease. Searching the parameter space under certain settings produces negative ...
7
votes
2answers
82 views

Initializing implicit linear multistep methods

A sixth order backward differentiation formula (BDF) need six (five plus initial value) previous solutions to get started. How I can get these previous solutions? I need a method accurate to sixth ...
0
votes
0answers
32 views

Solving stiff system of ODEs with deSolve package in R (vode to ode15s conversion)

I am trying to solve a large system of stiff ODEs (92 states, 207 parameters) using deSolve package in R (I am using the vode solver currently). I am getting the ...
0
votes
0answers
87 views

parallel computatioan of a PDE in MATLAB

I want to solve a 1-D PDE $(\partial_{tt} + \alpha\partial_t)u(x,t)=\partial_{xx}u(x,t)-\sin(u(x,t))+f$, using method of lines and for this I defined a spatial grid of about n~1000 points. Since my ...
1
vote
2answers
187 views

How to solve ODEs with constraints using BVP4C?

I am using BVP4C to solve a system of ODEs which is as follows. \begin{equation} \left\{ \begin{aligned} \frac{\partial f(x,y)}{\partial x} &- ...
0
votes
0answers
26 views

Solving the Wilberforce pendulum using Runge-Kutta method [duplicate]

I'm writing a program in C++ (almost from scratch) for solving the coupled equations that rise from the Wilberforce pendulum: $m\ddot{z}+kz+\frac{1}{2}\epsilon \theta = 0$ $I\ddot{\theta}+\delta ...
0
votes
1answer
49 views

What are some tips on developing a problem-specific ODE solver?

I have a small system of stiff ODEs describing a chemical reaction. The right-hand side is quite complicated, as well as the Jacobian. This equation will be solved many times with different initial ...
1
vote
0answers
43 views

Can variational formulations be solved using series solutions?

What I specifically mean is, given some functional $F\left[\mathbf{x}\right]$ which is stationary with respect to $\dot{\mathbf{x}}=f(\mathbf{x})$ and some boundary or initial conditions, can one ...
5
votes
1answer
57 views

Quantify integration error of scipy ode / ODEPACK

I am trying to integrate a 2nd order ODE with potential several singularities using the lsoda solver wrapped in scipy.integrate.ode(). I would like to put an error bar on the solution or at least ...
1
vote
1answer
143 views

Step-wise finite element formulations: can this be done?

Given the functional: $$ F[\mathbf{x}]=\frac{1}{2}[\mathbf{x}^{\text{T}} * D(\mathbf{x})]-\frac{1}{2}[\mathbf{x}^{\text{T}} * \mathbf{Ax}]-\frac{1}{2}\mathbf{x}^{\text{T}}(0)\mathbf{x}(t) $$ Where ...
4
votes
1answer
170 views

Why are functional representations of systems important in numerical applications?

I tried asking a similar question in SE.Physics, and I got some information regarding the abstract side of this, but I figured I should post here to get more complete information about the numerical ...
0
votes
0answers
14 views

Forcing variables to take specific values in ode15s [duplicate]

I am solving a system of ODE's. Instead of using M * dC/dt = F(C,t), I would like to specify the jacobian and instead use M * dC/dt = J * C. Since the problem has Dirichlet type boundary condition, i ...
-1
votes
1answer
95 views

Dirichlet boundary condition

I am trying to solve ODEs in matlab using ode15s. Instead of specifying ODEs in the format M * dC/dt = f(C,t) where C is a function of x and t. I want ...
3
votes
0answers
51 views

Large residual when integrating 2nd order ode close to singularity with SciPy ode / ODEPACK

I am trying to integrate a 2nd order ODE with a singularity at close to the initial condition. Why do I get large residuals when I plug-in the result of my integration back into the ODE? The equation ...
0
votes
0answers
50 views

octave code 'events' ode45 error

I am running code in Octave that uses the odepkg 0.8.4. The first .m file called 'poin2.m' is used for getting a Poincare plot. The ode45 command in this file calls the 'spp.m' function. ...
5
votes
2answers
136 views

How to impose boundary conditions on eigenfunction problems?

I am trying to solve for the eigenfunctions of a (1D) differential operator using finite differences: $$A \, f(x) = \lambda f(x)$$ Here is an example in Python where $A = \partial_x^4$: ...
3
votes
1answer
239 views

BDF2 and TR-BDF2: what is better?

What method of numerical solving ODEs is better? BDF2 or TR-BDF2? Namely, what advantages has TR-BDF2 over BDF2? The BDF2 method requires the values of $y_{n-1}$ and $y_n$ for computing $y_{n+1}$ ...
1
vote
1answer
63 views

methods for a peculiar BVP system

Consider the following system defined on the open interval (-1, 1): $y_1' = c y_3 \\ y_2' = c y_4 \\ y_3' = -f(y_1, y_2)y_2 \\ y_4' = f(y_1, y_2)y_1 $ given $ y_3(-1) = 0 = y_3(1) \\ ...
3
votes
3answers
323 views

Dynamically ending ODE integration in SciPy

I have a light ray moving through space-time, i.e. a curve in R⁴, parametrized by some variable λ. The exact trajectory, i.e. the coordinate functions $x^μ(λ)$ of the curve are given by some ODE ...
3
votes
0answers
51 views

Is it normal to expect the error of simulation of a damped harmonic oscillator to decrease as the damping factor decreases?

I am simulating a damped harmonic oscillator using the RK4 method of numerical integration. I am comparing the simulated results with the analytical ones (for the free evolution case) and obtaining ...
1
vote
1answer
119 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
231 views

How to solve an ode with stochastic time-dependent input

I am trying to repeat an example I found in a paper. I have to solve this ODE: $25 \ddot{x} + 15 \dot{x} + 330000 x = p(t)$ where $p(t)$ is a white noise sequence band-limited into the 10-25 Hz ...
2
votes
0answers
65 views

How to tell if symplectic integrator is more suitable for my problem, and what are downsides?

This question follows another one that I have already asked. My intention was to use a classical Runge-Kutta 45 method to solve ODEs of my system. However, I have seen recommendations for using ...
1
vote
1answer
258 views

How can I call the Boost C++ odeint Runge-Kutta integrator for a system of ODEs?

I would like to use Boost C++ odeint Runge-Kutta integrator on a system that looks like this : $$\ddot x = - \frac A{||x||^3} * x $$ $ x $ is a vector in 3D space, so basicaly $ x(i, j, k) $ $ ...
1
vote
1answer
588 views

Nonlinear ODE to solve Duffing's equation

I am trying to solve the Duffing's equation in MATLAB. $ m\ddot{y}+c\dot{y}+ky+k_{3}y^{3} = f(t) $ where $ f(t) = A \sin{\omega t}$ To do that I wrote a function to be given to the ode45. ...
-2
votes
1answer
97 views

Solving electron density function for Hydrogen and drawing in 3D

I recently stumbled upon interesting site that has interactive 3D representation of radial electron distribution (atomic orbital). here is the url: ...
0
votes
1answer
399 views

2D cross section from 3D surface

I am trying to apply the "restoring force surface" method to a dynamic linear system. The idea behind this method is that, knowing acceleration, displacement, velocity and input force it is possible ...
6
votes
2answers
142 views

How does the L-stability or A-stability of a scheme relate to its ability to preserve a quadratic invariant?

I am working with the simple example of an oscillator: $$(1) \; \; \ddot{u} + u = 0, \; \; u(0) = u_0$$ I know that Forward Euler does not preserve an invariant of the above system: $$(2) \; \; ...
2
votes
0answers
71 views

Solvers for stiff initial value ODEs with sparse Jacobian

What ODE solvers are optimized for solving stiff systems with sparse Jacobian? Such systems appear, for instance, when a parabolic PDE is discretized in space using typical finite difference or finite ...
-1
votes
1answer
57 views

Libraries with the method of lines for parabolic PDEs [closed]

Could you please advise some programs or libraries for solving parabolic PDEs (or its systems) in 1D, 2D and 3D, for example, with the method of lines? The system of parabolic PDEs can be nonlinear in ...
1
vote
1answer
181 views

Matlab equivalent of scipy's 'vode' and 'zvode' ode routines

In python I have used the ode method from scipy.integrate. There I used the vodeintegrator ...
3
votes
2answers
482 views

scipy odeint - Excess work done on this call

I'm newbie both in calculus and Python/Scipy so I apologize if this question is too dumb. I'm trying to model flow between two pressure vessels. Let's say we have two points and a link between them ...
-2
votes
1answer
889 views

Runge-Kutta 4th order for 4 coupled first order differential equation [closed]

I have to solve 4 coupled first order differential equations for $f(t)$ ,$g(t)$, $h(t)$ and $w(t)$ witch are only functions of $t$ , but for every reference link a function of 3 variables is assumed ...
2
votes
1answer
181 views

Solving large, non-linear systems of ODEs numerically: what do I need to consider in order to figure out which solver to use?

I would prefer recommendations that don't require the use of proprietary tools (such as Matlab). I know of two ODE solving options for the Python ecosystem: PyDSTool (Dopri, Radau, other Runge-Kutta ...
0
votes
1answer
31 views

Why might the time taken to compute the solution of an ODE system over some interval increase non-linearly with increasing size of interval?

Currently, my problem requires me to solve a system a large system of non-linear ODEs (up to ~5000). So far, I have been using scipy.integrate.odeint as my ...
1
vote
1answer
41 views

Possible to reduce effort needed to solve non-linear ODEs by taking some coefficients/parameters as constant over small time intervals?

So far, I have been using scipy.integrate.odeint as my "workhorse" ODE solver. My current problem requires that I solve a large system (up to ~5000) ODEs. Here's ...