Seite - 141 - in Programming for Computations – Python - A Gentle Introduction to Numerical Simulations with Python
Bild der Seite - 141 -
Text der Seite - 141 -
4.3 OscillatingOne-DimensionalSystems 141
the combination of thesemethods yields an overall time-stepping scheme from tn
to tnC1 that ismuchmoreaccurate than the individualstepswhichhaveerrorspro-
portional to t and t2. This is indeed true: the numerical error goes in fact like
C t4 foraconstantC,whichmeans that theerrorapproacheszeroveryquicklyas
we reduce the timestep size, compared to theForwardEulermethod (error t),
the Euler-Cromermethod (error t) or the 2nd-orderRunge-Kutta, orHeun’s,
method(error t2).
Note that the 4th-order Runge-Kuttamethod is fully explicit so there is never
any need to solve linear or nonlinear algebraic equations, regardless of what f
looks like.However, the stability is conditionalanddependsonf . There is a large
familyof implicitRunge-Kuttamethods thatareunconditionallystable, but require
solutionofalgebraicequations involvingf ateach timestep. TheOdespypackage
has support for a lot of sophisticated explicit Runge-Kutta methods, but not yet
implicitRunge-Kuttamethods.
4.3.8 MoreEffects:Damping,Nonlinearity,andExternalForces
Ourmodelproblemu00C!2uD0 is thesimplestpossiblemathematicalmodel for
oscillating systems. Nevertheless, thismodelmakes strongdemands to numerical
methods, as we have seen, and is very useful as a benchmark for evaluating the
performanceofnumericalmethods.
Real-life applications involvemorephysical effects,which lead to adifferential
equation with more terms and also more complicated terms. Typically, one has
adampingforcef.u0/andaspring forces.u/. Both these forcesmaydependnon-
linearlyon their argument,u0 oru. In addition, environmental forcesF.t/mayact
on the system. For example, the classical pendulum has a nonlinear “spring” or
restoring force s.u/ sin.u/, andair resistanceon thependulumleads to adamp-
ing forcef.u0/ ju0ju0. Examplesonenvironmental forces includeshakingof the
ground(e.g., due toanearthquake)aswell as forces fromwavesandwind.
Withthreetypesofforcesonthesystem:F ,f ,ands, thesumofforcesiswritten
F.t/ f.u0/ s.u/. Note theminus sign in front of f and s, which indicates
that these functions are defined such that they represent forces acting against the
motion. For example, springs attached to thewheels in a car are combinedwith
effective dampers, each providing a damping forcef.u0/ D bu0 that acts against
the springvelocityu0. Thecorrespondingphysical force is then f : bu0,which
pointsdownwardswhenthespringisbeingstretched(andu0pointsupwards),while
f actsupwardswhen the spring isbeingcompressed (andu0pointsdownwards).
Figure 4.25 shows an example of amassm attached to a potentially nonlinear
spring anddashpot, and subject to an environmental forceF.t/. Nevertheless, our
generalmodelcanequallywellbeapendulumas inFig.4.26withs.u/Dmgsin
and f.Pu/ D 1
2 CDA%P jP j (whereCD D 0:4,A is the cross sectional area of the
body,and% is thedensityofair).
Newton’s second lawfor the systemcanbewrittenwith themass timesacceler-
ationon the left-handsideand the forceson the right-handside:
mu00 DF.t/ f.u0/ s.u/:
Programming for Computations – Python
A Gentle Introduction to Numerical Simulations with Python
- Titel
- Programming for Computations – Python
- Untertitel
- A Gentle Introduction to Numerical Simulations with Python
- Autoren
- Svein Linge
- Hans Petter Langtangen
- Verlag
- Springer Open
- Datum
- 2016
- Sprache
- englisch
- Lizenz
- CC BY-NC 4.0
- ISBN
- 978-3-319-32428-9
- Abmessungen
- 17.8 x 25.4 cm
- Seiten
- 248
- Schlagwörter
- Programmiersprache, Informatik, programming language, functional, imperative, object-oriented, reflective
- Kategorie
- Informatik