MATLAB Answers

I have discovered that in solving ordinary differential equations things can get very easy if we use micro-intervals (intervals divided by 10 000 or more) and very rough methods like Euler's , to get the same accuracy as when using complex methods.

43 views (last 30 days)
Carlos Steinstrasser
Carlos Steinstrasser on 15 Jul 2019
Edited: Jan on 22 Jul 2019
ODEs of any order with initial conditions can be solved easely "using micro-intervals (intervals divide by more than a 1000) associated with Euler's method - definition of derivative -, can lead to great accuracy. I have a batch of scripts that can prove that. (study1, study2 ......). The simplicity is the great asset. Is this known ?
Bjorn Gustavsson
Bjorn Gustavsson on 19 Jul 2019
OK, I can help explain the equation. As you've understood it is a simple system of first order equations. It is, however, not at al related to Maxwell's equations, it is the Newtonian equation of motion:
Further, you are correct in that an explicit Euler-method can be used. That is not the question here. The question is whether Euler-methods are suitable for this problem. For these kind of clean physical problems we know that there are constants of motion that should be conserved. Here the total energy is fixed - in this case only the kinetic energy of the single particle, i.e. should be constant, the particle should neither gain nor loose energy, mening the speed should be constant. This requirement is something that is in no way a given for general-purpose ODE-methods, Euler, R-K or other schemes, but a complementary abd completely different physcis-based requirement. For this ODE-schemes like the Størmer-Verlet or Boris-mover are preferable. So this question falls outside from Jim Rigg's eplanation above.
The equation as implemented above are in normalized units such that the gyro-period is , the first two components are for the time-derivative of particle position (x and y) and the two last components are the corresponding accellerations.

Sign in to comment.

Answers (1)

Jan on 19 Jul 2019
Yes, this is known for a long time already. As Euler has known already and as you learn in the first year of numerical maths, the local truncation error of the Euler method is proportional to h^2. This means that reducing the step size will decrease the local truncation error also. In addition this will increase the number of function evaluations and the accumulated rounding errors. For many real world problems the later effect will dominate the run time and the total error of the computed trajectory. E.g. the ODEs to simulate the deformation of a car during a crash can include thousands or millions of variables and a function evaluation can take seconds or minutes. Then it is a bad idea to reduce the step size by a factor of 10'000. In addition this can let the accumulated rounding error explode. In consequence the Euler method is not used for scientific applications, but higher order methods with a smart step size control to find the minimal total error.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!