Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Include Page

...

MATLAB Google Analytics

...

MATLAB Google Analytics
Include Page
Spring-Mass System - Panel
Spring-Mass System - Panel

Exercise

Modify the code from the tutorial to make a plot showing the effect of the no. of time-steps n on the Euler's method solution. Use the following two values for n: 100 and 200. Make two calls to the Euler function for the two different time-steps.

...

  1. n=100 solution
  2. n=200 solution
  3. Analytical solution

Use a different line style and color for each curve. Modify the legend to suitably label the three curves. Change the axis limits as necessary.

...

We suggest that you create a copy of the code from the tutorial and work with that.

Submit your modified code and plot.


*Go to Spring-Mass Tutorial Start-page *Comments

Go to all MATLAB Learning Modules