Please help solve and plot the solutions to an equation

2 ビュー (過去 30 日間)
Alexander Jacobs
Alexander Jacobs 2021 年 1 月 14 日
コメント済み: Alexander Jacobs 2021 年 1 月 26 日
I have an equation:
D2=(((V2)^2*(sind(2*A2)))/(2*g))*(1+(1+((2*g*H2)/((V2)^2*(sind(A2))^2)))^0.5)
which represents the distance jumped based on height, starting speed, etc etc.
I know the distance jumped D2=11.4m, the height, H2=25.2m, and g=9.81
Assuming A2 can be angles ranging from 0 to 90, I would like to work out possible values of V2(starting speed) matching these angles.
The idea is to plot the values of V2 corresponding to each angle.
Any ideas how I could solve and plot this?
Thank you in advance for the help!

採用された回答

Divija Aleti
Divija Aleti 2021 年 1 月 18 日
Hi Alexander,
Have a look at the following code. It shows one of the ways by which you can solve your question.
D2 = 11.4;
H2 = 25.2;
g = 9.81;
A2 = 1:1:89;
V = zeros([89 1]);
syms V2
for i = 1:89
eqn = D2-(((V2)^2*(sind(2*A2(i))))/(2*g))*(1+(1+((2*g*H2)/((V2)^2*(sind(A2(i)))^2)))^0.5)==0;
S = solve(eqn,V2);
if S(1)>=0
V(i) = S(1);
else
V(i) = S(2);
end
end
plot(A2,V)
Output:
For each value of A2, two values of V2 are obtained, out of which I have selected the positive values for plotting. You can also select the negative values.
For additional information on the 'solve' function, refer to the following link :
Regards,
Divija
  1 件のコメント
Alexander Jacobs
Alexander Jacobs 2021 年 1 月 26 日
Thank you so, so much, Divija. That really helps! Thanks again

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeNumber Theory についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by