level 1
海天热血
楼主
简单描述一下:RiccatiSolve[]函数接收四个常值矩阵后会返回一个常值矩阵。我的代码:
Ar[t_] := t*DiagonalMatrix[{1, 1}];
MB[t_] := t^2*DiagonalMatrix[{1, 1}];
MQ = {{1, 0}, {0, 2}};
MR = {{1, 2}, {0, 3}};
P[t_] := RiccatiSolve[{Ar[t], MB[t]}, {MQ, MR}];
P[2]
NDSolve[Total[P[t] // Flatten] == x'[t], t, {t, 0, 5}]
输出结果:P[2]=

但是NDSolve的输出:RiccatiSolve::nonnum: RiccatiSolve has received a matrix with non-numerical elements.
NDSolve::ndnco: The number of constraints (0) (initial conditions) is not equal to the total differential order of the system plus the number of discrete variables (1).
也就是说,RiccatiSolve[]在直接给出时间的时候,它可以给出对应时间的Ar[t]和MB[t]对应的结果,但是在NDSolve中,时间t变化时,它却不能给出结果。问题出在了NDSolve上。请问怎么解决。
求求了!!!
2021年11月18日 12点11分
1
Ar[t_] := t*DiagonalMatrix[{1, 1}];
MB[t_] := t^2*DiagonalMatrix[{1, 1}];
MQ = {{1, 0}, {0, 2}};
MR = {{1, 2}, {0, 3}};
P[t_] := RiccatiSolve[{Ar[t], MB[t]}, {MQ, MR}];
P[2]
NDSolve[Total[P[t] // Flatten] == x'[t], t, {t, 0, 5}]
输出结果:P[2]=

但是NDSolve的输出:RiccatiSolve::nonnum: RiccatiSolve has received a matrix with non-numerical elements.NDSolve::ndnco: The number of constraints (0) (initial conditions) is not equal to the total differential order of the system plus the number of discrete variables (1).
也就是说,RiccatiSolve[]在直接给出时间的时候,它可以给出对应时间的Ar[t]和MB[t]对应的结果,但是在NDSolve中,时间t变化时,它却不能给出结果。问题出在了NDSolve上。请问怎么解决。
求求了!!!