finding solutions in matlab within interval for multiple variables
1 次查看(过去 30 天)
显示 更早的评论
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!