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!