4 different wrong eduations instead of one right after using solve
古いコメントを表示
>> syms g h q sx sy v;
>> sy = (-g/2) * ( sx/(cos(q)*v) )^2 + v * sin(q) * ( sx/(cos(q)*v) )^2 + h;
>> sx=solve(sy,sx)
sx =
(2^(1/2)*v*cos(q)*(g*h - 2*h*v*sin(q))^(1/2))/(g - 2*v*sin(q))
-(2^(1/2)*v*cos(q)*(g*h - 2*h*v*sin(q))^(1/2))/(g - 2*v*sin(q))
>> sx = ( 2^(1/2) * v * cos(q) * (g * h - 2*h*v*sin(q) )^(1/2) ) / (g - 2*v*sin(q));
>> sx = diff(sx,q);
>> q=solve(sx,q);
>> q
q = asin((g + (g^2 - 4*v^2)^(1/2))/(2*v))
pi - asin((g - (g^2 - 4*v^2)^(1/2))/(2*v))
asin((g - (g^2 - 4*v^2)^(1/2))/(2*v))
pi - asin((g + (g^2 - 4*v^2)^(1/2))/(2*v))
The right equation is:
q = arcsin (v/(2*v^2+2*h*g))
Is there a way in matlab to get this equation?
4 件のコメント
Andrew Newell
2011 年 12 月 28 日
Please format your equations: http://www.mathworks.com/matlabcentral/answers/7885-tutorial-how-to-format-your-question.
Sascha
2011 年 12 月 28 日
Andrew Newell
2011 年 12 月 29 日
Your answer is not dimensionally correct. The argument to arcsin must be dimensionless, but it has units (1/velocity).
Walter Roberson
2011 年 12 月 29 日
Maple solves to
arctan((g + (g^2 - 4*v^2)^(1/2))/(2*v), (8*v^2-2*g^2-2*g*(g^2-4*v^2)^(1/2))^(1/2)/v)
instead of
arcsin((g + (g^2 - 4*v^2)^(1/2))/(2*v))
and the arcsin() equivalent to Maple's solution is notably different.
採用された回答
その他の回答 (2 件)
Andrew Newell
2011 年 12 月 28 日
I'm going to weed out some irrelevant material from your question and format it using the methods in How to format your question:
syms g h q sx v;
sx = ( 2^(1/2) * v * cos(q) * (g * h - 2*h*v*sin(q) )^(1/2) ) / (g - 2*v*sin(q));
dsx = diff(sx,q);
qsol=solve(dsx,q);
I get an answer, but it is much more complicated than arcsin (v/(2*v^2+2*h*g)). Moreover, if I try
simple(subs(dsx,q,asin (v/(2*v^2+2*h*g))))
which should be zero if your solution is correct, I do not get zero. Are you sure that your answer is correct?
3 件のコメント
Walter Roberson
2011 年 12 月 28 日
In Maple I get answers in terms of arctan() not arcsin(), and converting to arcsin() gives very long expressions that are not at all the same as v/(2*v^2+2*h*g) .
I do not find any significant simplification. I do find a rewrite in terms of ln of a complex number, but that is really just hiding the arctan:
-I*ln((1/2)*((8*v^2-2*g^2-2*g*(g^2-4*v^2)^(1/2))^(1/2)+I*g+I*(g^2-4*v^2)^(1/2))/v)
where "I" represents sqrt(-1)
Sascha
2011 年 12 月 28 日
Walter Roberson
2011 年 12 月 28 日
When I looked through that, I saw someone proposed using arcsin() the correction was to use arctan()
カテゴリ
ヘルプ センター および File Exchange で Special Values についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!