|
你又是通过什么判断出MATLAB结果出错了?- >> S = dsolve('Df = f + g','Dg = -f + g','f(0) = 1','g(0) = 2')
- S =
- f: [1x1 sym]
- g: [1x1 sym]
- >> S.f
- ans =
- exp(t)*cos(t) + 2*exp(t)*sin(t)
- >> S.g
- ans =
- 2*exp(t)*cos(t) - exp(t)*sin(t)
- >> diff(S.f)
- ans =
- 3*exp(t)*cos(t) + exp(t)*sin(t)
- >> S.f+S.g
- ans =
- 3*exp(t)*cos(t) + exp(t)*sin(t)
- >> syms t
- >> subs(S.f,t,0)
- ans =
- 1
- >> subs(S.g,t,0)
- ans =
- 2
- >> -S.f+S.g
- ans =
- exp(t)*cos(t) - 3*exp(t)*sin(t)
- >> S.g
- ans =
- 2*exp(t)*cos(t) - exp(t)*sin(t)
- >> diff(S.g)
- ans =
- exp(t)*cos(t) - 3*exp(t)*sin(t)
复制代码 It looks perfect to me. |
评分
-
1
查看全部评分
-
|