finding solutions in matlab within interval for multiple variables
1 回表示 (過去 30 日間)
古いコメントを表示
Kseniia Kudriavtceva
2020 年 11 月 18 日
コメント済み: Kseniia Kudriavtceva
2020 年 11 月 19 日
My r_o varies between 12 and 15; anf r_i between 6 and 9;
I need to have a graph velocity VS two radii. The radii are not dependeent on each other, so there might be any combination.
How can I do so?
% Given
W_g = 500;
W_t = 1000;
delta_x = 60;
g = 32.2;
r_i = 6:0.3:9;
r_o = 12:0.3:15;
% Equation for both gliders
V_g_c = sqrt(2*W_t*delta_x*g.*r_o.^2/(W_t.*r_i.^2+W_g.*r_o.^2));
%Plot
plot(V_g_c, r_i, 'Linewidth',2);
Thank you in advance!
0 件のコメント
採用された回答
Sibi
2020 年 11 月 18 日
編集済み: Sibi
2020 年 11 月 18 日
W_g = 500;
W_t = 1000;
delta_x = 60;
g = 32.2;
r_i = 6:0.3:9;
r_o = 12:0.3:15;
V_g_c = sqrt((2*W_t*delta_x*g.*(r_o.^2))./(W_t.*(r_i.^2)+W_g.*(r_o.^2)));
plot(V_g_c, 'Linewidth',2);
if you want all combinations
W_g = 500;
W_t = 1000;
delta_x = 60;
g = 32.2;
r_i = 6:0.3:9;V_g_c=[];
for r_o = 12:0.3:15
k=(sqrt((2*W_t*delta_x*g.*(r_o.^2))./(W_t.*(r_i.^2)+W_g.*(r_o.^2))));
V_g_c = [V_g_c k'];
end
plot(12:0.3:15,V_g_c ,'Linewidth',2);
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!