I am solving a differential matrix equation with NDSolve
.
A = NDSolveValue[{y'[t] + (J\[Transpose]).y[t] + y[t].(J\[Transpose]) -
2*y[t].(J\[Transpose]).y[t] == 0, y[0] == \[Gamma]i}, {y[T]}, {t, 0, T}]
Here, initial value is a matrix. (This is the time to admit that I am very new to Mathematica.) First strange thing is that A
appears to be not a matrix of the same size as initial was. It has three dimensions, first one is equal to 1, others are the same as for initial matrix.
Secondly, when I have a function g[y[t]]
in the equation, it returns an error. The code is:
A = NDSolveValue[{y'[t] + (J\[Transpose] + g[y[t]]\[Transpose]).y[t] +
y[t].(J\[Transpose] + g[y[t]]\[Transpose]) - 2*y[t].(J\[Transpose] +
g[y[t]]\[Transpose]).y[t] == 0, y[0] == \[Gamma]i}, {y[T]}, {t, 0, T}]
It appears that y[t]
not to be a matrix the same size as A
:
Part::take: Cannot take positions 5 through 8 in Norm[Symbol[]]. >>
The question is: how can I send the actual solution y[t]
in a moment t
in function g[t]
?
(Possibly this question duplicates NDSolve with vector function though I am not sure.)