I want to plot height[time]
function for different values of M
and g
. This function contains a[2]
which needs to be found. I had two-coupled algebraic equation for a[2]
and t[2]
. I used Solve
to solve that system and it worked. However the issue starts at that point, when I execute below code, it does not produce a graph. I did something wrong, but the question is "where". Please see below;
p01[x_] := Integrate[2*a[2]/k*1/(x - c) + t[2]/k , {x, 0, x},Assumptions -> 0 < x < c] + 1/2
p02[x_] := Integrate[2*a[2]/k*1/(x - c) + t[2]/k , {x, 1, x},Assumptions -> c < x < 1]
first[x_] := Integrate[p01[x], {x, 0, c}, Assumptions -> 0 < c < 1]
second[x_] := Integrate[p02[x], {x, c, 1}, Assumptions -> 0 < c < 1]
third[x_] := Integrate[(x - c)*p01[x], {x, 0, c}, Assumptions -> 0 < c < 1]
fourth[x_] := Integrate[(x - c)*p02[x], {x, c, 1}, Assumptions -> 0 < c < 1]
Solve[2*M*a[2] == first[x]+second[x] - M*g && 2*M*i*t[2] ==third[x]+fourth[x], {a[2], t[2]}]
c = 0.4; k = 1; i = 0.2;
a[0] = k*c*(1 - c);
t[0] = k*(1 - 2*c);
height[time_] := a[0] + time^2*a[2]
plot4 = Block[{M = {0, 0.1, 1, 10}, g = {0, 0.1, 1, 10}},
Plot[Evaluate@height[time], {time, 0, 1}, AxesOrigin -> {0, 0},
PlotStyle -> {Red, Green, Blue, Black}]]
b
toc
. It was a typo. Anyway it still does not work. Also a big thank you for the second part of your comment about dividing sol[[1,1]] . So is sol[[2,1]] for t[2] then?? $\endgroup$