Skip to main content
Share Your Experience: Take the 2024 Developer Survey
5 votes
Accepted

Understanding leapfrog integration algorithm

In the second code the full time stepping is given by three lines in main() ...
user9794's user avatar
  • 465
5 votes
Accepted

What happens to the $O(\cdot)$ terms when we implement the Leapfrog Integration algorithm in a programming language?

It is not really wrong, but it is bad notation. It tries to combine the description of the numerical method, which is indeed implemented without the error terms, with the truncation error of the steps....
Lutz Lehmann's user avatar
  • 6,109
4 votes

Understanding leapfrog integration algorithm

The first code is wrong if you have multiple particles that interact. Due to the structure of the loop, the interaction forces with particles at the start of the list are computed with the updated ...
Lutz Lehmann's user avatar
  • 6,109
3 votes

What would be the right approach to numerically integrate in MATLAB an improper integral with Bessel function?

I solved this by observing the behaviour of the rapidly decreasing exponential function. It dropped to zero at about $\xi = 40$. So instead of integrating it from 0 to $\infty$, I integrate it from 0 ...
ishan_ae's user avatar
3 votes
Accepted

How to modify adaptive step size Runge-Kutta cash karp algorithm for higher accuracy?

At the state of the code in OPost, there is no hope to get any solution, as the passing of arguments in the ODE function derivs is interrupted by creating a local ...
Lutz Lehmann's user avatar
  • 6,109
3 votes
Accepted

How to numerically solve differential equations involving sines, cosines and inverses of the unknown function?

A common method is to spatially discretize your ODE/PDE, then use a Newton-Raphson method to solve the resulting non-linear system. For example, let's start by replacing the second derivative with a 3 ...
helloworld922's user avatar
2 votes
Accepted

finding weak form of nonlinear differential equation for FEM simulation

First notice that $$ (k_3 - k_1)\sin(u)\cos(u)(u')^2 + (k_1\cos^2(u) + k_3\sin^2(u))u'' = ((k_1\cos^2(u) + k_3\sin^2(u))u')' + (k_1 - k_3)\sin(u)\cos(u)(u')^2. $$ I choose to rearrange our equation so ...
whpowell96's user avatar
  • 2,546
1 vote

'Integral2' error in MATLAB for invalid integrand

If you wish to evaluate this numerically there is no need to involve symbolic math, and we can just write functions; ...
Mikael Öhman's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible