Answered step by step
Verified Expert Solution
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 Please create a f program for this exercise.
EXERCISE
Use the modified Euler method with a time step of to solve the "mass on a spring" problem, and present your results in a plot similar to Figure 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 massonaspring problem. We might use the simple Euler expression to determine position,
and determine the velocity by requiring that
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
RungeKutta 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?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started