Show real positive solution on a fourth grade equation

4 visualizzazioni (ultimi 30 giorni)
Hi, I would like that my script only prints the max. real solution of some equations and after a few tryes I couldn't achieve that. I was wondering if someone knows any comand to do so. Here it's an example of what I am trying to do;
Wo = 3584.74 * 9.8; %N
rho = 1.225; %kg/m^3
D_r = 11.5; %m
R_r = D_r/2; %m
S_r = pi * R_r^2; %m^2
sigma_r = 0.073309651;
omega_r = 37.01; %rad/s
Vtip_r = omega_r * R_r; %m/s
Pu_r = rho * S_r * (Vtip_r)^3;%W
Vi0 = sqrt(Wo/(2*rho*S_r)); %m/s
Ku = 5;
f = 0.95; %m^2
Cd0 = 0.0085;
syms vx;
E3 = -Wo^2/(rho*S_r) + sigma_r*Cd0*Pu_r*(Ku*vx^3/(Vtip_r)^2 - vx) + rho*f*vx^4;
R3 = vpasolve(E3);
%A3 = max(R3);
disp('Max range velocity is [m/s]: ');
disp(R3);

Risposta accettata

Dyuman Joshi
Dyuman Joshi il 21 Dic 2022
Wo = 3584.74 * 9.8; %N
rho = 1.225; %kg/m^3
D_r = 11.5; %m
R_r = D_r/2; %m
S_r = pi * R_r^2; %m^2
sigma_r = 0.073309651;
omega_r = 37.01; %rad/s
Vtip_r = omega_r * R_r; %m/s
Pu_r = rho * S_r * (Vtip_r)^3;%W
Vi0 = sqrt(Wo/(2*rho*S_r)); %m/s
Ku = 5;
f = 0.95; %m^2
Cd0 = 0.0085;
syms vx;
E3 = -Wo^2/(rho*S_r) + sigma_r*Cd0*Pu_r*(Ku*vx^3/(Vtip_r)^2 - vx) + rho*f*vx^4;
%Converting values to double
%you can use another numeric data types as well
R3 = double(vpasolve(E3));
%check for imaginary part to be zero
isrl=imag(R3)==0;
%Update to contain real values only
R3=R3(isrl)
R3 = 2×1
-12.8879 72.8377
disp('Max range velocity is [m/s]: ');
Max range velocity is [m/s]:
%display the max value
disp(max(R3));
72.8377

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by