Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Exercise taken from Paul L DeVries - A first course in computational physics ( 1 9 8 4 ) . Please create a . f

Exercise taken from Paul L DeVries - A first course in computational physics (1984). Please create a .f95 program for this exercise.
EXERCISE 5.3
Use the modified Euler method with a time step of 0.1 to solve the "mass on a spring" problem, and present your results in a plot similar to Figure 5.4. How well is the energy conserved?
It might seem that a numerical method that preserves constants of the motion is inherently "better" than one that does not. Certainly, the improved and modified Euler methods are to be preferred over the simple Euler method. But this preference is derived from improvements made in the algorithm, as verified by the computation of constants of the motion, not because the constants were guaranteed to be preserved.
It is possible to construct an algorithm that preserves constants of the motion. For example, consider the mass-on-a-spring problem. We might use the simple Euler expression to determine position,
x(t0+)=x(t0)+dxdt|t0|=x(t0)+v(t0)
and determine the velocity by requiring that
E=mv22+kx22
This will give us the magnitude of the velocity, and we could obtain its sign by requiring it to be the same as that obtained from the expression
v(t0+)=v(t0)+dvdt|t0|=v(t0)-x(t0)
Runge-Kutta Methods
This algorithm is absolutely guaranteed to conserve energy, within the computer's ability to add and subtract numbers. But how good is it otherwise?
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases DeMYSTiFieD

Authors: Andy Oppel

2nd Edition

0071747990, 978-0071747998

More Books

Students also viewed these Databases questions

Question

Discuss labor unrest in China.

Answered: 1 week ago

Question

Explain union decertification.

Answered: 1 week ago

Question

Describe collective bargaining in the public sector.

Answered: 1 week ago