Howdy! I'm new to the forums, but I'm having some trouble with a script I'm writing, so I thought I'd see if the community can help. I'm solving a set of second order differential equations using NDSolve and I'm trying to extract the maximum values of a specific one of the interpolating functions produced, but I keep getting an error message saying something along the lines of "the function value {0.132074} is not a real number at {t} = {2.}". I know that the function exists at that point because it is continuous and I can put t=2 in to get that value out.
Any ideas on how to get the value to resolve? Any help is appreciated!
Code below:
\[Omega] = 1;
k = 100000;
M = 10000;
F = {x1''[t] == -k/M (2*x1[t] - x2[t]) - k/M Cos[\[Omega] t],
x2''[t] == -k/M (2*x2[t] - x1[t] - x3[t]),
x3''[t] == -k/M (2*x3[t] - x2[t] - x4[t]),
x4''[t] == -k/M (2*x4[t] - x3[t] - x5[t]),
x5''[t] == -k/M (2*x5[t] - x4[t] - x6[t]),
x6''[t] == -k/M (2*x6[t] - x5[t] - x7[t]),
x7''[t] == -k/M (x7[t] - x6[t]),
x1[0] == x2[0] == x3[0] == x4[0] == x5[0] == x6[0] == x7[0] == 0,
x1'[0] == x2'[0] == x3'[0] == x4'[0] == x5'[0] == x6'[0] ==
x7'[0] == 0};
sol = NDSolve[F, {x1, x2, x3, x4, x5, x6, x7}, {t, 1, 200}];
FindMaximum[{x2[t] /. sol, 1 <= t <= 100}, {t}]