2

我正在尝试获得以下泰勒级数展开的系数矩阵

(%i47) SS: taylor( matrix( [sin(h)], [cos(t)] )  , [h,t], [h_0, t_0], 1 );
                                                                                           [ sin(h_0) + cos(h_0) (h - h_0) + . . . ]
(%o47)/T/                                                                                  [                                       ]
                                                                                           [ cos(t_0) - sin(t_0) (t - t_0) + . . . ]

现在我有了泰勒展开式,我想要这个形式A[h;t] + b

coefmatrix( SS, [h,t,1] );
                               [ sin(h_0) + cos(h_0) (h - h_0) + . . . ]
coefmatrix: improper argument: [                                       ]
                               [ cos(t_0) - sin(t_0) (t - t_0) + . . . ]
 -- an error. To debug this try: debugmode(true);

这最后一步给出了错误。我怎样才能实现我的愿望?

4

1 回答 1

1

经过一些修补,正确的方法是:

SS(h,t):= taylor( matrix( [sin(h)], [cos(t)] )  , [h,t], [h_0, t_0], 1 );
q: list_matrix_entries( SS( h,t ) );
A: coefmatrix( q, [h, t] );
b: expand( A . [h,t] - q );

这导致:

(%i6) A: coefmatrix( q, [h,t] );
                                        [ cos(h_0)      0      ]
(%o6)                                   [                      ]
                                        [    0      - sin(t_0) ]
(%i7) b: expand( A . [h,t] - q );

                                    [   h_0 cos(h_0) - sin(h_0)   ]
(%o7)                               [                             ]
                                    [ (- t_0 sin(t_0)) - cos(t_0) ]

总而言之,功能list_matrix_entries是关键。

于 2020-04-09T15:26:13.563 回答