I have the following code:
Clear{x, y, z, t, a, f};
f[t_] := Sin[t];
X[t_] := a*f[t]*Cos[t];
Y[t_] := a*f[t]*Sin[t];
sols =
ParametricNDSolveValue[
{Z'[t] == {{X'[t], Y'[t]}, {Y'[t], -X'[t]}}.Z[t],
Z[0] == {{1, 0}, {0, 1}}},
Tr[Z[2 π]], {t, 0, 2 π}, a];
Plot[{y = 2, sols[a]}, {a, 0, 0.001}]
The error message that I'm getting is this:
There are many more dependent variables, {X[t],Y[t],X[t]}, than equations, so the system is underdetermined.
The same code had worked before, when I had not defined f[t]
. So I know that the system should not be overdetermined. Where am I going wrong?
Clear[x, y, z, t, a, f]
has no effect onX
,Y
, andZ
, because Mathematica is case-sensitive. $\endgroup$ – bbgodfrey Oct 15 at 14:27ParametricNDSolve
the first equation equates the derivative of Z to a vector. The right hand size of the equation is a vector timesZ[t]
. I am a bit confused as to what your intent is. – Jack LaVigne 5 mins ago $\endgroup$ – Jack LaVigne Oct 15 at 22:12