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
1 vote
1 answer
60 views

Accurately solving system of differential equations

So I am trying to solve two equations simultaneously. The goal is to find values for $\frac{de}{dt}$ and $\frac{d}{dt}$ which are the rates of change of the variables $a$ and $e$. I am then ...
user avatar
-2 votes
0 answers
59 views

Using Implicit Euler Method with Newton-Raphson method

So I'm following this algorithm and here is my attempt: ...
user avatar
  • 1
2 votes
2 answers
104 views

Adaptive computation in neural ODEs

I have been reading the neural ODE paper and I understand that neural ODEs have a continuous depth model structure. And I understand the fact that they are especially very useful for time-series data. ...
user avatar
  • 23
-2 votes
0 answers
40 views

Setting up boundary conditions to solve PDEs using method of lines

Objective: To add boundary/initial conditions (BCs/ICs) to a system of ODEs I have used the method of lines to convert a system of PDEs into a system of ODEs. The ODEs themselves involve a lot of ...
user avatar
0 votes
1 answer
29 views

Get the equilibrium value in coupled ode by python

I am dealing with a coupled ODE. I have already plotted the solutions out using odeint, but I want to get the value of equilibrium. The ode looks like this: ...
user avatar
0 votes
0 answers
67 views

How to solve spatially discretised PDEs (method of lines) in solve_ivp or ODEint?

I can discretise the spatial domain of a system of PDEs using the method of lines, converting the system of PDEs to a system of ODEs (with a time derivative only). These equations (for context they ...
user avatar
0 votes
0 answers
69 views

How to estimate stability and stiffness of a system of coupled ODEs?

I'm running into issues with Python/Julia ODE solvers requiring prohibitively small timesteps to evolve a system of 4 coupled ODEs (the order of magnitude of the state variables and time unit span ~40-...
user avatar
2 votes
1 answer
94 views

Boundary value problem with singularity and boundary condition at infinity

I'm trying to solve the following boundary value problem on $[0,\infty]$: $$f^{\prime \prime}=-\frac{1}{r} f^{\prime}+\frac{1}{r^{2}} f+m^{2} f+2 \lambda f^{3}$$ $$f(0)=0 \ ; f(\infty)=\sqrt{-m^2/(2\...
user avatar
4 votes
0 answers
92 views

Stiff ODE solver in the web browser

I'd like to make a web application that lets people play with solving ODE systems, changing parameters with sliders etc. but instead of doing the computations on the server side, solving the equations ...
user avatar
  • 421
0 votes
1 answer
78 views

How to deal with solving coupled ODE systems where variables are updated multiple times within each timestep?

I'm solving a system of coupled ODEs using Euler integration for simplicity. To make this concrete, please see the (extremely simplified) minimal working example below in Python. Imagine we have a box ...
user avatar
-1 votes
1 answer
34 views

What is the ERRCON parameter in rkqs?

Ive take a course in computational physics and was asked to implement some numerical methods to solve ODES. I was reading up on the algorithms described in the textbook: NUMERICAL RECIPES IN FORTRAN. ...
user avatar
2 votes
1 answer
142 views

How to use an adaptive step size in boost::odeint

This is a combination of these two previous questions: How to get ODE solution at specified time points? Stop integration in odeint with stiff ode I need to solve the following differential equation ...
user avatar
2 votes
1 answer
98 views

Can't solve second order differential equation with scipy

Most of my knowledge about numerically solving differential equations is long forgotten. Unfortunately I stumbled upon a physics problem where I need to do exactly that. I'm trying to describe the ...
user avatar
  • 31
1 vote
0 answers
54 views

Solving 1D Advection Equation Using Midpoint-Rule and Finite-Differences

I want to solve the advection equation ($v_0 \in \mathbb R$) $$ \frac{\partial f}{\partial t} + v_0 \frac{\partial f}{\partial x} = 0 $$ using 2nd order Runge Kutta like the midpoint rule for the time ...
user avatar
  • 241
1 vote
1 answer
68 views

solving a Algebraic Differential Equation in Julia using modelingToolKit.JL

I'm trying to solve a differential algebraic equation in Julia's modelingTookKit.JL, where the vector field has the form f(X) = 0. I found an example of a DAE in the below link modelingToolkit.JL DAE](...
user avatar
10 votes
2 answers
856 views

Why is RK45 used as the "default" method for non-stiff ODEs rather than a multistep one?

From what I read, the "default" go-to method for non-stiff ODEs is the Dormand-Prince Runge-Kutta pair; for instance, in Matlab docs, "Most of the time, ...
user avatar
2 votes
1 answer
56 views

Algorithm to numerically determine whether my computed solution for a 1st order ODE is stable/unstable?

We were given an assignment where we had to determine the numerical solution of Dahlquist's equation $\dot x$ = $\lambda x$, ($\lambda$ = $-7$) for time steps ${0.5,0.25,0.125}$ using explicit euler ...
user avatar
0 votes
0 answers
72 views

Solving an apparently tricky geodesic BVP in Matlab

I want to be able to solve the BVP $$\ddot \mu_k = -\frac{\mu_k}{2} \left ( \sum_{i=1}^n \frac{\dot \mu_i^2}{\mu_i} - \frac{\dot \mu_k^2}{\mu_k^2} + \frac{ \left [ \sum_{i=1}^n \dot \mu_i \right ]^2}{\...
user avatar
7 votes
0 answers
87 views

How do we approximate the numerical error a numerical scheme (e.g Runge Kutta, Euler etc) makes without having access to an analytical solution?

So I recently encountered this question in my head while taking my Scientific Computing class, where the lecturer talked about computing numerical error of a scheme. My guess would be that we take a ...
user avatar
1 vote
1 answer
86 views

solve_ivp doesn't work with toms748

I have the following code ...
user avatar
  • 123
2 votes
1 answer
160 views

SciPy odeint giving different results with matrix multiplication

I've asked this at stackoverflow but maybe this community will have a better idea of the answer. I'm currently trying to develop a function that performs matrix multiplication while expanding a ...
user avatar
  • 123
3 votes
1 answer
113 views

Solving and Plotting Mutualism Model in Python

I am a beginner in programming. I need to program a mutualism model of two species in python that would solve and graph using the following equations: $$ \frac{dN_1}{dt} = N_1(r_1 - e_1N_1 + \alpha _{...
user avatar
1 vote
0 answers
79 views

Solving general initial value problem $\mathbf{f}(\mathbf{x}, \mathbf{x'}, t)=\mathbf{0}$

The common form of initial value problem that can be solved using ODE integrator is $$ \mathbf{x'}=\mathbf{g}(\mathbf{x}, t) $$ where $\mathbf{x'}=\partial\mathbf{x}/\partial t$. The initial ...
user avatar
  • 171
1 vote
0 answers
41 views

Anyway to escape ODEintWarning (scipy)?

I am trying to fit a differential equation to some data and obtain the parameters of the underlying model. This requires me to try out various parameter values, but this often gives me an ...
user avatar
  • 23
1 vote
0 answers
70 views

How to apply Neumann boundary conditions in Newton's method [closed]

Suppose that I have a very long and tedious set of differential equations. After discretization, I can get a mapping $f:\mathbb{R}^N \to \mathbb{R}^N$ such that solutions $\phi =(\phi_0,...,\phi_{N-1})...
user avatar
2 votes
2 answers
90 views

How are consistency constraints maintained in Circuit Simulation?

I have always taken for granted circuit simulators and I didn't spend time understanding now. I wish to understand better now. Normally when you forward simulate ODE systems there is a single dynamic ...
user avatar
3 votes
2 answers
186 views

Is there a Python version of the ODE tool pplane?

This is the same question as this one, except for Python instead of Mathematica. Basically, the MATLAB software PPLANE is a staple in ODE courses. Is there a Python equivalent? I don't know much about ...
user avatar
4 votes
2 answers
130 views

Backward Euler + Quasi Newton(Broyden) method fails to solve Van der Pol's equation(Stiff ODE)

The first guess is using the forward Euler approach. The first jacobian is using finite differences. Then NR method is used to solve for the next iteration and Broyden's method is used to update the ...
user avatar
2 votes
1 answer
85 views

Implicit integrator for ODE with quadratic right-hand side

I have an ODE for an unknown $x(t):[0,\infty)\to\mathbb R^n$ of the following form: $$ x_i'(t)=a_i^\top x(t) + x(t)^\top Q_i x(t), $$ for $i\in\{1,\ldots,n\}$. Here, the vectors $a_i\in\mathbb R^n$ ...
user avatar
1 vote
2 answers
379 views

Recommendations for ODE solvers for stiff equations

I'm continuing the research of a former Ph.D. student in my group requiring the solution of a system of ODEs. On a technical note, they wrote: The system of Boltzmann equations behaves numerically ...
user avatar
7 votes
1 answer
389 views

Why is the central difference method dispersing my solution?

I am solving numerically the ODE $\ddot x(t)=-c\dot x(t) -\sin(x(t))+F\cdot \cos(\omega t), \;\dot x(0)=x(0)=0$ for $t\in [0,20\pi]$ on an $N=2000$ dimensional grid. I am working on Python, and I ...
user avatar
2 votes
1 answer
221 views

Solving stiff ODEs: Dealing with Jacobian terms which take too long to compute with finite differences

I have a system of PDEs describing atmospheric chemistry and transport. I use finite-differences to make my system of PDEs into a system of ~10,000 ODEs. I then integrate the ODEs forward in time with ...
user avatar
4 votes
1 answer
127 views

Parameters estimation with fewer variables than parameters

I am trying to estimate parameters, 4 of them, by fitting a system of 3 ordinary differential equations. I am using a model published that was using 3 parameters and gave a good fit to the data, and I ...
user avatar
  • 141
3 votes
2 answers
206 views

How to solve the integral-like energy equation with Sagdeev potential numerically in Python?

I am trying to numerically solve equation (6) of Lakhina 2021 in Python. The equation is $$\frac{1}{2}\left(\frac{d \phi}{d\xi}\right)^2 + S(\phi, M) = 0\, .$$ The Sagdeev potential expression is ...
user avatar
  • 43
0 votes
0 answers
53 views

What is the most common loss function used with collocation methods for differential equations

I was looking at the Cheney and Kincaid book (6th edition) on numerical methods, with respect to collocation method for differential equations. Now for linear systems of ODES, collocation is just a ...
user avatar
  • 255
0 votes
0 answers
52 views

Plotting the motion of a positive charge in a cylindrically symmetric magnetic field

I want to plot the motion of a positive charge in a cylindrically symmetric magnetic field. I am assuming a cylinder around the z-axis, with the magnetic field going in clockwise direction. The B-...
user avatar
4 votes
1 answer
149 views

How can i solve these Coupled differential Equations?

I am trying to solve this with odeint module. But the first equation is function of second equation. If i ignore dw/dz in first equation and second equation is function of first one. I can solve it ...
user avatar
2 votes
1 answer
168 views

Why can bad jacobians sometimes works better for implicit ODE method?

I'm solving a system of stiff ODEs describing atmospheric chemistry and transport. I am using CVODE BDF from Sundials Computing. I have two ways to approximate the jacobian: Allow CVODE to ...
user avatar
3 votes
1 answer
78 views

Quantify difference between two discrete 1D solutions

I have an ordinary differential equation that is solved as an initial value problem using different numerical schemes. I end up with several discrete time signals that should display a reasonably ...
user avatar
  • 139
1 vote
2 answers
108 views

ODE adaptive time stepping: is it bad to use "timescales of change" to select timestep size

Suppose you want to approximately solve a system of ODEs, using some numerical method (Euler, RK, BDF, whatever): $\frac{du}{dt} = f(u)$ To do this you need to select time steps which solve the ODEs ...
user avatar
3 votes
1 answer
200 views

Time discretization Navier Stokes equation

This question is a follow-up of this one. The weak form of Navier Stokes equation is (assuming $v,q$ test functions for the velocity and the pressure, respectively) $$(\frac{du}{dt},v)_{\Omega} + (\...
user avatar
  • 289
-1 votes
1 answer
234 views

Using ODE to plot particle-motion with scipy.integrate.solve_ivp

My Problem: A positively charged particle (mass = 2 * 10-27 kg) is moving along the x-axis. It is travelling in a homogenous magnetic field such that the field axis in z-direction. The energy of the ...
user avatar
2 votes
1 answer
111 views

Solving chain of ODE in Julia

I am solving two different ODE whose solutions need to be matched. I am currently doing this by hand, which works great, but I would like to automatise this process. The second ODE takes one of its ...
user avatar
3 votes
0 answers
82 views

Solving PDEs: What is the best way to deal with non-banded/dense jacobians?

I have a system of PDEs describing atmospheric chemistry and transport. I use finite-differences to make my system of PDEs into a system of ~10,000 ODEs. I then integrate the ODEs forward in time with ...
user avatar
-2 votes
2 answers
102 views

numerical solution for differential equation

I have these 3 equations and i want to solve them with numerical methods. so I am using scipy library but I don't know how to solve 3 equations together. R, g, sigma and density are constants. \begin{...
user avatar
2 votes
0 answers
64 views

A JAVA solver for ODEs with boundary conditions (BVP)

I need to solve a system of linear first order ODEs with boundary conditions in JAVA. I was wondering if any of you know of a JAVA package with the capability of solving a boundary value problems? (i....
user avatar
  • 21
0 votes
0 answers
149 views

Path constraints for state variables - fmincon, ODE45

My problem lies in constraining state variables (look for 23,24,25). I am currently using ODE45 to solve equations and fmincon to find best control variable.How would you go about solving this? Here ...
user avatar
5 votes
2 answers
590 views

Specifying ode solver options to speed up compute time

I'm specifying the 'JPattern', sparsity_pattern in the ode options to speed up the compute time of my actual system. I am sharing a sample code below to show how I ...
user avatar
  • 581
3 votes
1 answer
98 views

Preferred application for shooting method

Every now and then there are questions asked in this site related to the shooting method for boundary value problems (see 1, 2, 3). Nevertheless, in some of the cases that I have seen here, the ...
user avatar
  • 7,902
1 vote
1 answer
128 views

ODE Instability with sinh and cosh functions in Julia

I want to solve the first-order differential equation $$ \begin{align} \frac{d\alpha}{d\phi} = \frac{\phi \sigma^2 \sin(2d\alpha)+2d\sinh(\sigma^2\alpha \phi)}{-\alpha \sigma^2 \sin(2d\alpha) +2d\...
user avatar

1
2 3 4 5
10