A month ago, I used Mathematica to solve my experiment of the Test Technology of Mechanics Engineering. The exeriment is mainly about the Fourier Transform and verify the validity of the theory of Fourier. My code is below:
originwave[t_] :=
If[-5 <= t <= 5, t, If[t > 0, originwave[t - 10], originwave[t + 10]]];
(*the definition of SawtoothWave function*)
four periodic originwave
Column[
{Plot[originwave[t], {t, -20, 20}, PlotRange -> {-5, 5},
AspectRatio -> 1, ImageSize -> 300, AxesStyle -> Arrowheads[0.03],
AxesLabel -> {"t", "four periodic originwave"}
]},
Center]
The seven order Fourier series expansion
Column[
{Plot[Evaluate[FourierTrigSeries[originwave[t], t, 7]], {t, -20, 20},
PlotRange -> {-5, 5}, AspectRatio -> 1, ImageSize -> 300,
AxesStyle -> Arrowheads[0.03],
AxesLabel -> {"t", "The seven order Fourier series expansion"}]},
Center]
Furthermore,I encounter a problem about Taylor Series that we can use the approximate value of Maclaurin Series to replace a function. I can see the degree of closeness between them by changing the variable n. That's my trial:
Manipulate[
Show[
Plot[E^x, {x, 0, 5}, PlotStyle -> Pink],
Plot[Evaluate@Normal@Series[E^x, {x, 0, n}], {x, 0, 5},
PlotRange -> {0, 150}]],
{{n, 6}, 0, 10, 1, Appearance -> "Labeled"}]
Lastly ,the problem of plotting 2-D graph of |x|+|2x+y|=1
, below is the solution:
Plot[y /. Solve[Abs@x + Abs@(x + y) == 1, y, Reals] //
Evaluate, {x, -2, 2}, AspectRatio -> Automatic]
Summary and my confusion:
In three tasks, I am alway using the Evaluate
command. Firstly,I know this command and I will remember it when the MMA cannot give the result that I want. However, it is confusing to me that I don't know when to use it or not use it.
Can someone help me?
SawtoothWave
function in Mathematica $\endgroup$Plot[]
isHoldAll
$\endgroup$