Optimizing Euler Method for Differential Equations with Large Coefficients

Click For Summary
SUMMARY

The discussion focuses on optimizing the Euler Method for approximating solutions to second-order differential equations, specifically in the context of forces affecting an object's velocity and position. The equations provided include mass-damping-spring dynamics, represented as m d²y/dt² + b dy/dt + ky = Fo sin(νt). The user correctly derives expressions for v_{n+1} and y_{n+1} based on known values but encounters unexpected results, potentially due to large coefficients relative to the chosen time step of 0.02. The advice given emphasizes the importance of adjusting the time step to improve accuracy.

PREREQUISITES
  • Understanding of second-order differential equations
  • Familiarity with the Euler Method for numerical approximation
  • Basic knowledge of Fortran programming for implementation
  • Concept of time step sensitivity in numerical methods
NEXT STEPS
  • Explore adaptive time-stepping techniques to enhance Euler Method accuracy
  • Learn about the Runge-Kutta methods for improved numerical solutions
  • Investigate the impact of coefficient magnitudes on numerical stability
  • Review Fortran libraries for solving differential equations efficiently
USEFUL FOR

Students and professionals in applied mathematics, engineering, and physics who are working with numerical methods for solving differential equations, particularly those using the Euler Method in computational simulations.

BeeKay
Messages
16
Reaction score
0

Homework Statement


Hello,

I have a question about using Eulers Method to approximate a solution to a differential equation. The problem lists forces that would be applied on an object and influences its velocity and therefore its position. I believe I am doing the Euler method correct to approximate what the "new velocity" would be, but based on somewhat wonky results I want to confirm if I am making an error using the Euler Method ( or in the Fortran code, but I feel like that is fine).

Homework Equations


m \frac{d^ {2}y}{dt^2} + b \frac{dy} {dt} + ky = F_{o} sin(νt), y(0) = y_{o}, \frac{dy} {dt} = ˙y_{o}. when t=0

\frac{dy} {dt} = v, y(0) = y_{o},

\frac{dv} {dt} = \frac{− k} {m} y − \frac {b} {m} v + \frac {F_{o}} {m} sin(νt), v(0) = ˙y_{o}

\frac {y_{n+1} − y_{n}} {∆t} = v_{n},

\frac{v_{n+1} − v_{n}} {∆t} = \frac {− k }{m} y_{n} − \frac {b} {m} v_{n} + \frac {Fo} {m} sin(νt_{n}),

t_{n+1} = t_{n + ∆t}

The Attempt at a Solution


The way I interpreted it was to first find \frac{v_{n+1} − v_{n}} {∆t} by find it at the initial values. If I use 0.02 as the timestep, I solved by substituting in the initial given y value and v value. Some other parameters were given, but they would not be changing. I multiplied this entire solution by the time step to find how much the velocity changed in that time. I then added this change to the original velocity. From there, I am a little confused as to how it applies to the position estimation. If \frac {y_{n+1} − y_{n}} {∆t} = v_{n},, then shouldn't I just take the solution to \frac{v_{n+1} − v_{n}} {∆t} = \frac {− k }{m} y_{n} − \frac {b} {m} v_{n} + \frac {Fo} {m} sin(νt_{n}), multiply it by the timestep, and then add it to the previous y value? Thanks in advance and sorry if I messed up LaTeX. If you need more information about the problem or my process, let me know.
 
Physics news on Phys.org
Hello BK,

You have a second order differential equation and have worked it around to two expressions for ##v_{n+1}## and ##y_{n+1}## in terms of the known ##v_n## and ##y_n##. I think that's correct. So "do the step"!

If the results are wonky, perhaps the coefficients are a bit big for the time step ?
 

Similar threads

Replies
0
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 18 ·
Replies
18
Views
3K
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
6K
  • · Replies 7 ·
Replies
7
Views
5K
  • · Replies 3 ·
Replies
3
Views
4K