Answer format for solve()
1 回表示 (過去 30 日間)
古いコメントを表示
I don't like the way MuPad inserts an extra parameter in the solution to a problem I gave it:
solve( { v1 + v2*t + v3*t^2 = 0,
v1*-2 + v2*(-2*t+1) + v3*(-2*t^2 + 2*t) = 0,
v1*4 + v2*(4*t-4) + v3*(4*t^2 - 8*t + 2)=12 } )
Answer: {[t = -z/12, v1 = z^2/24, v2 = z, v3 = 6]}
So I have 2 questions here:
- How do you stop mupad from using a parameter, or remove z from the equations and have the solution in t only?
- If you square z in the solution for v1, you lose the negativity, so isn't this answer strictly speaking not correct? (Since v1 = 6*t^2, not -6*t^2 as it should be?)
0 件のコメント
採用された回答
Walter Roberson
2011 年 6 月 2 日
1. Specify the variable you want to solve for
solve(...,{z,v1,v2,v3})
2. The solution set I get in terms of t is
z = z, v1 = 6*t^2, v2 = -12*t, v3 = 6
If I back-substitute those in to the original equations, I get 6=6 and 12=12 which are logical truths, so v1 = 6*t^2 is correct.
If I back-substitute using v1 = -6*t^2 and the rest the same, I get
-12*t^2 = 0, 24*t^2 = 0, -48*t^2+12 = 12
which is true if and only if t=0
0 件のコメント
その他の回答 (1 件)
Andrew Newell
2011 年 6 月 2 日
1. Just specify the variables:
solve(...,{v1,v2,v3})
2. In your solution, if you substitute for all four variables, the equation is zero.
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!