finding solutions in matlab within interval for multiple variables

2 views (last 30 days)
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!

Accepted Answer

Sibi
Sibi on 18 Nov 2020
Edited: Sibi on 18 Nov 2020
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);

More Answers (0)

Categories

Find more on Discrete Data Plots in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!