Preface


This is a tutorial made solely for the purpose of education and it was designed for students taking Applied Math 0330. It is primarily for students who have very little experience or have never used Mathematica before and would like to learn more of the basics for this computer algebra system. As a friendly reminder, don't forget to clear variables in use and/or the kernel.

Finally, the commands in this tutorial are all written in bold black font, while Mathematica output is in normal font. This means that you can copy and paste all commands into Mathematica, change the parameters and run them. You, as the user, are free to use the scripts for your needs to learn the Mathematica program, and have the right to distribute this tutorial and refer to this tutorial as long as this tutorial is accredited appropriately.

Return to computing page for the first course APMA0330
Return to computing page for the second course APMA0340
Return to Mathematica tutorial for the second course APMA0330
Return to Mathematica tutorial for the first course APMA0340
Return to the main page for the course APMA0340
Return to the main page for the course APMA0330
Return to Part VI of the course APMA0330

Mechanical and Electrical Applications


Clear[x,y,t,z];
soln = DSolve[{x''[t] + 25 x[t] == 0, x[0] == 1, x'[0] == 0}, x[t], t]
Plot[x[t] /. soln, {t, -1, 2.5}]
s[t_] = x[t]/.soln[[1]]
Plot[s[t],{t,0,3},AxesLabel->{"t","Displacement"}]

soln = DSolve[{x''[t] + 17 x'[t] + 16 x[t] == 0, x[0] == 1, x'[0] == 5}, x[t], t];
s1[t_] = x[t] /. soln[[1]]
Out[32]= 1/5 E^(-16 t) (-2 + 7 E^(15 t))
Plot[s1[t], {t, 0, 3}, AxesLabel -> {"t", "Displacement"}]

>>>> displace1.jpg

When does the maximum excursion occur?

FindRoot[s1'[t] == 0, {t, 0}]
Out[9]= {t -> 0.101322}

What is the maximum excursion?
s1[t /. %]
Out[10]= 1.18603

soln = DSolve[{x''[t] + 2 x'[t] + 37 x[t] == 0, x[0] == -1, x'[0] == 5}, x[t], t]
Out[2]= -(1/3) E^-t (3 Cos[6 t] - 2 Sin[6 t])}}
s3[t_] = x[t] /. soln[[1]]


Clear[x,t];
soln = DSolve[{x''[t] + 2 x'[t] + 37 x[t] == 0, x[0] == -1,
x'[0] == 5}, x[t], t]
s3[t_] = x[t] /. soln[[1]]
Plot[s3[t], {t, 0, 3}, PlotRange -> {-1, 1}]

Out[19]= {{x[t] -> -(1/3) E^-t (3 Cos[6 t] - 2 Sin[6 t])}}
Out[20]= -(1/3) E^-t (3 Cos[6 t] - 2 Sin[6 t])
Out[21]=

>>>>> solution3.jpg
amplitude =
s3[t] /. c3_ Exp[c4_] (c1_ Cos[a_] + c2_ Sin[a_]) -> c3*Sqrt[c1^2 + c2^2]
Out[19]= -(Sqrt[13]/3)
Plot[{amplitude*Exp[-t], -amplitude*Exp[-t], s3[t]}, {t, 0, 3}, PlotStyle -> {Blue, Blue, Black}]

>>>>> amplitude.jpg

Forced Oscillations

 

 

 

Definition of Laplace Transform

Heaviside Function

Laplace Transform of Discontinuous Functions

Table of Laplace transforms

Inverse Laplace Transform

Convolution Integral

Residue method

Solving IVPs with Laplace transform

Nonhomogeneous ODEs

ODEs with discontinuous input

Nonconstant Coefficient IVP’s

Mechanical and Electrical Applications