Solutions

Files can be input into Mathematica using
    SetDirectory["c://path//to//files"]
    << "file.m"
Note that you can't use the referring technique %n when giving input from a file. Also, the outputs of substitution expressions are automatically suppressed. Otherwise, you can pretty much write ordinary Mathematica code in your file.

In[59]:=

(*1*)Clear[f, x] ; f[x_] = Sin[10Cos[x]] ; Plot[f[x], {x, -Pi, Pi}]

[Graphics:../HTMLFiles/ex07_solutions_56.gif]

Out[61]=

⁃Graphics⁃

In[62]:=

(*2*)Clear[m, x, t, g, k, s] ; m = 1. ; g = 0.1 ; k = 1.5 ; s = 0.1 ; ᡝ ... 0, x[0] s, x '[0] 0}, x[t], t], 1] ; Plot[x[t]/.sol, {t, 0, 20}]

[Graphics:../HTMLFiles/ex07_solutions_59.gif]

Out[65]=

⁃Graphics⁃


Created by Mathematica  (April 10, 2007) Valid XHTML 1.1!