4 different wrong eduations instead of one right after using solve
Ältere Kommentare anzeigen
>> 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 Kommentare
Andrew Newell
am 28 Dez. 2011
Please format your equations: http://www.mathworks.com/matlabcentral/answers/7885-tutorial-how-to-format-your-question.
Sascha
am 28 Dez. 2011
Andrew Newell
am 29 Dez. 2011
Your answer is not dimensionally correct. The argument to arcsin must be dimensionless, but it has units (1/velocity).
Walter Roberson
am 29 Dez. 2011
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.
Akzeptierte Antwort
Weitere Antworten (2)
Andrew Newell
am 28 Dez. 2011
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 Kommentare
Walter Roberson
am 28 Dez. 2011
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
am 28 Dez. 2011
Walter Roberson
am 28 Dez. 2011
When I looked through that, I saw someone proposed using arcsin() the correction was to use arctan()
Kategorien
Mehr zu Special Values finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!