I have piecewise function A which is defined as shown below. When I plot piecewise in Mathematica I could not able to see any points after x=3.5, but If I evaluate the A I am getting value. I am bit confused and curious why it is happening? Am I using the piecewise function properly?
z1 = 1;
z2 = 2;
z3 = 3;
L = 4;
a1 = -0.0664623 Cos[1.52648 x] + 0.0664621 Cosh[1.52648 x] +
0.0736429 Sin[1.52648 x] - 0.0736415 Sinh[1.52648 x]
a2 = 0.0706263 Cos[1.52648 (-1 + x)] -
0.0012975 Cosh[1.52648 (-1 + x)] +
0.0696575 Sin[1.52648 (-1 + x)] - 0.0317435 Sinh[1.52648 (-1 + x)]
a3 = 0.0727183 Cos[1.52648 (-2 + x)] -
0.0727174 Cosh[1.52648 (-2 + x)] - 0.413845 Sin[1.52648 (-2 + x)] +
0.267041 Sinh[1.52648 (-2 + x)]
a4 = -0.410217 Cos[1.52648 (-3 + x)] +
0.410216 Cosh[1.52648 (-3 + x)] + 0.585447 Sin[1.52648 (-3 + x)] -
0.192384 Sinh[1.52648 (-3 + x)]
A = Piecewise[{{a1, x <= z1}, {a2, z1 <= x <= z2}, {a3,
z2 <= x <= z3}, {a4, x >= z3}}]
Plot[A, {x, 0, L}]
Plot
has a lot of hidden calculating going on. Part of this tries to decide what range to plot. If you change your code toPlot[A, {x, 0, L},PlotRange->All]
it will show you everything out to 4. You can look upPlotRange
to see how to give it even more precise instructions. $\endgroup${a4, True}
instead{a4, x >= z3}
and takeL=5
to check difference. $\endgroup$