Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

...

Let's visualize our results by making a plot of the mass position x vs. time using the steps shown in the video below.

HTML
Wiki Markup
{html} <iframe width="600" height="338" src="//www.youtube.com/embed/ixSPeMxjODw?rel=0" frameborder="0" allowfullscreen></iframe> {html}


Create Professional-Looking Plot

...


The following video shows you how to implement this template.

HTML
Wiki Markup
{html} <iframe width="600" height="338" src="//www.youtube.com/embed/6i0-X9h9bjM?rel=0" frameborder="0" allowfullscreen></iframe> {html}


Note that we use the variable h for the plot handle in the above video. But we have also used h for the time step. Oops! In this case, this doesn't cause an error since plotting occurs at the end. But it'd be better to call the plot handle, say, hplot in your code.

We next change the axis limits from the default using the axis function so that our curve fills up more of the plot area.

HTML
Wiki Markup
{html} <iframe width="600" height="338" src="//www.youtube.com/embed/E77XSRcjfcE?rel=0" frameborder="0" allowfullscreen></iframe> {html}


Add Analytical Solution to Plot

First, we form the necessary arrays from the analytical solution.

HTML
Wiki Markup
{html} <iframe width="600" height="338" src="//www.youtube.com/embed/DAlTSfTfJl0?rel=0" frameborder="0" allowfullscreen></iframe> {html}


Second, we add a curve corresponding to the analytical solution to our figure.

HTML
Wiki Markup
{html} <iframe width="600" height="338" src="//www.youtube.com/embed/k9cojj_oETU?rel=0" frameborder="0" allowfullscreen></iframe> {html}


Lastly, we add a legend to label the curves.

HTML
Wiki Markup
{html} <iframe width="600" height="338" src="//www.youtube.com/embed/trTvzt3cVIo?rel=0" frameborder="0" allowfullscreen></iframe> {html}



Go to Step 4: Function Creation

...