Page - 149 - in Programming for Computations – Python - A Gentle Introduction to Numerical Simulations with Python
Image of the Page - 149 -
Text of the Page - 149 -
4.3 OscillatingOne-DimensionalSystems 149
Fig.4.31 Effect ofnonlinear (left)and linear (right) springonsliding friction
U_0 = 0.1
V_0 = 0
T = 2
dt = T/5000.
u, v, t = EulerCromer(f=f, s=s, F=F, m=m, T=T,
U_0=U_0, V_0=V_0, dt=dt)
plot_u(u, t)
Running thesliding_frictionfunctiongivesus the results inFig. 4.31with
s.u/Dk˛ 1 tanh.˛u/ (left) and the linearizedversion s.u/Dku (right).
4.3.12 AfiniteDifferenceMethod;Undamped,LinearCase
Weshall nowaddressnumericalmethods for the second-orderODE
u00C!2uD0; u.0/DU0; u0.0/D0; t 2 .0;T ;
without rewritingtheODEasasystemoffirst-orderODEs. Theprimarymotivation
for“yetanothersolutionmethod”is that thediscretizationprinciplesresult inavery
good scheme, andmore importantly, the thinking around the discretization canbe
reusedwhensolvingpartial differential equations.
The main idea of this numerical method is to approximate the second-order
derivativeu00 by a finite difference. While there are several choices of difference
approximations to first-order derivatives, there is one dominating formula for the
second-orderderivative:
u00.tn/ u nC1 2unCun 1
t2 : (4.74)
Theerror in this approximation isproportional to t2. Letting theODEbevalidat
somearbitrary timepoint tn,
u00.tn/C!2u.tn/D0;
back to the
book Programming for Computations – Python - A Gentle Introduction to Numerical Simulations with Python"
Programming for Computations – Python
A Gentle Introduction to Numerical Simulations with Python
- Title
- Programming for Computations – Python
- Subtitle
- A Gentle Introduction to Numerical Simulations with Python
- Authors
- Svein Linge
- Hans Petter Langtangen
- Publisher
- Springer Open
- Date
- 2016
- Language
- English
- License
- CC BY-NC 4.0
- ISBN
- 978-3-319-32428-9
- Size
- 17.8 x 25.4 cm
- Pages
- 248
- Keywords
- Programmiersprache, Informatik, programming language, functional, imperative, object-oriented, reflective
- Category
- Informatik