Delta Banner

Mathematics & Science Learning Center
Computer Laboratory

 

Applications of Differential Equations

A Suspended Wire

(continued from last page...)

This time the result is a little more obscure:

NDSolve[{y''[x]==(0.5/40)*Sqrt[1+(y'[x])^2], y[0]==0, y'[0]==0}, y[x], {x,-5,5}]

NDSolve Solution

The result is in the form of an InterpolatingFunction, which is something we've seen before, specifically in the numerical solvers laboratory. From experience, we know that though it may look a little strange, it is possible to use this solution for most of the usual purposes, i.e. we can substitutes values into it, and we can plot its graph. Recall that the {-5., 5.} specified in the solution tells us the domain upon which it may be used. (The solution is invalid outside of -5 ≤ x ≤ 5.)

We were asked to plot a graph of the wire in the instructions to the original problem, so we'd better get on with the job. Before we can use the function properly it needs to be retrieved from within the replacement rule that Mathematica provides as an answer. Again we use the "[[1,1,2]] trick." We're going to issue the command:

wire1=%[[1,1,2]]

which says to get the previous result (the percent sign, %, means previous result, remember?), and take its first row, first column, second part, and read the result into a new variable called wire1.

Go back to Mathematica now, and try this command right after where you left off.

Welcome back. Let's move on to making the graph...


Compass If you're lost, impatient, want an overview of this laboratory assignment, or maybe even all three, you can click on the compass button on the left to go to the table of contents for this laboratory assignment.
 
 

ODE Laboratories: A Sabbatical Project by Christopher A. Barker

©2017 San Joaquin Delta College, 5151 Pacific Ave., Stockton, CA 95207, USA
e-mail:
cbarker@deltacollege.edu