Jump to content

Semi-implicit Euler method: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Added example
clarify and format
Line 3: Line 3:
Given a pair of [[differential equation]]s of the form
Given a pair of [[differential equation]]s of the form


:<math> {dx \over dt} = v(x,t) </math>
:<math> {dx \over dt} = v(t) </math>


:<math> {dv \over dt} = a(x,v,t) </math>
:<math> {dv \over dt} = a(x,v,t), </math>


and initial conditions
where ''a'' is a given function, and initial conditions


:<math> (x_0,v_0), \quad</math>
:<math> (x_0,v_0), \quad</math>
Line 17: Line 17:
:<math> x_{n+1} = x_n + v_{n+1} \Delta t \quad</math>
:<math> x_{n+1} = x_n + v_{n+1} \Delta t \quad</math>


where <math> \Delta t </math> is the timestep.
where <math> \Delta t </math> is the timestep and <math>a_n = a(x_n,v_n,t_n)</math> is the acceleration at the current timestep.


Note the difference from the Euler method: <math>x_{n+1}</math> depends on <math>v_{n+1}</math> rather than <math>v_n</math>.
Note the difference from the Euler method: <math>x_{n+1}</math> depends on <math>v_{n+1}</math> rather than <math>v_n</math>.
Line 23: Line 23:
== Example ==
== Example ==


The motion of a [[spring (device)|spring]] satisfying [[Hooke's law]] is given by
For a spring undergoing [[simple harmonic motion]] we have the following


:<math>F = -kx = ma \quad</math>
:<math> {dx \over dt} = v(t) </math>


:<math>\Rightarrow a = -{k \over m}x \quad</math>
:<math> {dv \over dt} = -{k \over m}x. \quad</math>


The Euler-Cromer algorithm for this equation is
Thus we have solutions


:<math>v_{n+1} = v_n - {k \over m}x_n\Delta t \quad</math>
:<math>v_{n+1} = v_n - {k \over m}x_n\Delta t \quad</math>


:<math>x_{n+1} = x_n + v_{n+1} \Delta t \quad</math>
:<math>x_{n+1} = x_n + v_{n+1} \Delta t. \quad</math>


== See also ===
== See also ===
Line 40: Line 40:
== References ==
== References ==


{{cite book |last= Giordano
* {{cite book |last= Giordano
|first= Nicholas J.
|first= Nicholas J.
|coauthors= Hisao Nakanishi
|coauthors= Hisao Nakanishi
|title= Computational Physics
|title= Computational Physics
|edition= 2nd
|edition= 2nd edition
|publisher= Benjamin Cummings
|publisher= Benjamin Cummings
|year= 2005
|year= 2005
|month= July
|month= July
|language= English
|isbn= 0-1314-6990-8 }}
|isbn= 0-1314-6990-8 }}
* {{cite web

| last = MacDonald
{{cite web
| last = James
| first = James
| first = MacDonald
| authorlink = http://www.physics.udel.edu/~jim
| title = The Euler-Cromer method
| title = The Euler-Cromer method
| publisher = [[University of Delaware]]
| publisher = [[University of Delaware]]

Revision as of 10:58, 4 March 2007

In mathematics, the Euler-Cromer algorithm is a modification of the Euler method for solving ordinary differential equations. It gives much better results for oscillatory solutions.

Given a pair of differential equations of the form

where a is a given function, and initial conditions

the Euler-Cromer algorithm produces an approximate discrete solution by iterating

where is the timestep and is the acceleration at the current timestep.

Note the difference from the Euler method: depends on rather than .

Example

The motion of a spring satisfying Hooke's law is given by

The Euler-Cromer algorithm for this equation is

See also =

References

  • Giordano, Nicholas J. (2005). Computational Physics (2nd edition ed.). Benjamin Cummings. ISBN 0-1314-6990-8. {{cite book}}: |edition= has extra text (help); Unknown parameter |coauthors= ignored (|author= suggested) (help); Unknown parameter |month= ignored (help)
  • MacDonald, James. "The Euler-Cromer method". University of Delaware. Retrieved 2007-03-03.