I need to draw a shape in matlab help me
Hi,I simulate something in matlab .For those wondering, this is the cross section of the rotor in the axial compressor.. I want to draw this picture in matlab same dimensions,same angles,and same shape.Additionally, I would like to have red dots at the corners of the angled areas where they intersect with the horizontal axes. I am open to your suggestions regarding this.Of course, dashed lines also need to be drawn. The dashed lines can be in blue. My drawing needs to start from the origin point.It needs to be added to the code I will post below and changed when I change the values related to the shape in the code.
% datas
rpm = 30000; % rev/min
Pti_Pte = 1.5; % compression ratio
efficiency = 0.9; % isentropic efficiency
mass_flow_rate = 1.6; % kg/s
r1s = 0.15; % m (stator distance from rotor axis)
aspect_ratio = 0.7; % geometrical ratio
P_amb = 101325; % Pa
T0 = 288.15; % K (environmental temperature)
gamma = 1.4; % specific heat ratio of air
cp = 1005; % J/(kg·K)
load_coefficient = 0.4;
% Calculating chord length and r2h from aspect ratio
chord = r1s / aspect_ratio; % chord = span / aspect_ratio
r2h = r1s – chord; % Shroud radius
% Step 1: Isenthalpic Relations and Tt2s Calculation
Tt1 = T0; % St2-St1 = 0
Tt2s = Tt1 * (Pti_Pte ^ ((gamma – 1) / gamma));
% Step 2: Tt2 calculations
Tt2 = Tt1 + (Tt2s – Tt1) / efficiency;
% Step 3: Enthalpy change (Delta H)
delta_h = cp * (Tt2 – Tt1); % J/kg
% Step 4: Umean calculation
U_mean = sqrt(delta_h / load_coefficient); % m/s
% Step 5: Axial velocity ve Mach Number
rho = P_amb / (287 * T0); % Density, ideal gas equation
V_axial = U_mean *0.5; % Axial hız
Mach = V_axial / sqrt(gamma * 287 * T0); % Mach sayısı
% Step 6: Calculation of Angles
V_theta2 = delta_h / U_mean; %
beta1 = atan(U_mean / V_axial)* (180 / pi); % Beta1 angle (degree)
beta2 = atan((U_mean – V_theta2) / V_axial) * (180 / pi); % Beta2 angle (degree)
% % Visualization of Results
fprintf(‘Tt2s: %.2f Kn’, Tt2s);
fprintf(‘Tt2: %.2f Kn’, Tt2);
fprintf(‘Delta H: %.2f J/kgn’, delta_h);
fprintf(‘Umean: %.2f m/sn’, U_mean);
fprintf(‘Mach Number: %.2fn’, Mach);
fprintf(‘V_axial: %.2f m/sn’, V_axial);
fprintf(‘V_theta2: %.2f m/sn’, V_theta2);
fprintf(‘Beta1: %.2f derecen’, beta1);
fprintf(‘Beta2: %.2f derecen’, beta2);Hi,I simulate something in matlab .For those wondering, this is the cross section of the rotor in the axial compressor.. I want to draw this picture in matlab same dimensions,same angles,and same shape.Additionally, I would like to have red dots at the corners of the angled areas where they intersect with the horizontal axes. I am open to your suggestions regarding this.Of course, dashed lines also need to be drawn. The dashed lines can be in blue. My drawing needs to start from the origin point.It needs to be added to the code I will post below and changed when I change the values related to the shape in the code.
% datas
rpm = 30000; % rev/min
Pti_Pte = 1.5; % compression ratio
efficiency = 0.9; % isentropic efficiency
mass_flow_rate = 1.6; % kg/s
r1s = 0.15; % m (stator distance from rotor axis)
aspect_ratio = 0.7; % geometrical ratio
P_amb = 101325; % Pa
T0 = 288.15; % K (environmental temperature)
gamma = 1.4; % specific heat ratio of air
cp = 1005; % J/(kg·K)
load_coefficient = 0.4;
% Calculating chord length and r2h from aspect ratio
chord = r1s / aspect_ratio; % chord = span / aspect_ratio
r2h = r1s – chord; % Shroud radius
% Step 1: Isenthalpic Relations and Tt2s Calculation
Tt1 = T0; % St2-St1 = 0
Tt2s = Tt1 * (Pti_Pte ^ ((gamma – 1) / gamma));
% Step 2: Tt2 calculations
Tt2 = Tt1 + (Tt2s – Tt1) / efficiency;
% Step 3: Enthalpy change (Delta H)
delta_h = cp * (Tt2 – Tt1); % J/kg
% Step 4: Umean calculation
U_mean = sqrt(delta_h / load_coefficient); % m/s
% Step 5: Axial velocity ve Mach Number
rho = P_amb / (287 * T0); % Density, ideal gas equation
V_axial = U_mean *0.5; % Axial hız
Mach = V_axial / sqrt(gamma * 287 * T0); % Mach sayısı
% Step 6: Calculation of Angles
V_theta2 = delta_h / U_mean; %
beta1 = atan(U_mean / V_axial)* (180 / pi); % Beta1 angle (degree)
beta2 = atan((U_mean – V_theta2) / V_axial) * (180 / pi); % Beta2 angle (degree)
% % Visualization of Results
fprintf(‘Tt2s: %.2f Kn’, Tt2s);
fprintf(‘Tt2: %.2f Kn’, Tt2);
fprintf(‘Delta H: %.2f J/kgn’, delta_h);
fprintf(‘Umean: %.2f m/sn’, U_mean);
fprintf(‘Mach Number: %.2fn’, Mach);
fprintf(‘V_axial: %.2f m/sn’, V_axial);
fprintf(‘V_theta2: %.2f m/sn’, V_theta2);
fprintf(‘Beta1: %.2f derecen’, beta1);
fprintf(‘Beta2: %.2f derecen’, beta2); Hi,I simulate something in matlab .For those wondering, this is the cross section of the rotor in the axial compressor.. I want to draw this picture in matlab same dimensions,same angles,and same shape.Additionally, I would like to have red dots at the corners of the angled areas where they intersect with the horizontal axes. I am open to your suggestions regarding this.Of course, dashed lines also need to be drawn. The dashed lines can be in blue. My drawing needs to start from the origin point.It needs to be added to the code I will post below and changed when I change the values related to the shape in the code.
% datas
rpm = 30000; % rev/min
Pti_Pte = 1.5; % compression ratio
efficiency = 0.9; % isentropic efficiency
mass_flow_rate = 1.6; % kg/s
r1s = 0.15; % m (stator distance from rotor axis)
aspect_ratio = 0.7; % geometrical ratio
P_amb = 101325; % Pa
T0 = 288.15; % K (environmental temperature)
gamma = 1.4; % specific heat ratio of air
cp = 1005; % J/(kg·K)
load_coefficient = 0.4;
% Calculating chord length and r2h from aspect ratio
chord = r1s / aspect_ratio; % chord = span / aspect_ratio
r2h = r1s – chord; % Shroud radius
% Step 1: Isenthalpic Relations and Tt2s Calculation
Tt1 = T0; % St2-St1 = 0
Tt2s = Tt1 * (Pti_Pte ^ ((gamma – 1) / gamma));
% Step 2: Tt2 calculations
Tt2 = Tt1 + (Tt2s – Tt1) / efficiency;
% Step 3: Enthalpy change (Delta H)
delta_h = cp * (Tt2 – Tt1); % J/kg
% Step 4: Umean calculation
U_mean = sqrt(delta_h / load_coefficient); % m/s
% Step 5: Axial velocity ve Mach Number
rho = P_amb / (287 * T0); % Density, ideal gas equation
V_axial = U_mean *0.5; % Axial hız
Mach = V_axial / sqrt(gamma * 287 * T0); % Mach sayısı
% Step 6: Calculation of Angles
V_theta2 = delta_h / U_mean; %
beta1 = atan(U_mean / V_axial)* (180 / pi); % Beta1 angle (degree)
beta2 = atan((U_mean – V_theta2) / V_axial) * (180 / pi); % Beta2 angle (degree)
% % Visualization of Results
fprintf(‘Tt2s: %.2f Kn’, Tt2s);
fprintf(‘Tt2: %.2f Kn’, Tt2);
fprintf(‘Delta H: %.2f J/kgn’, delta_h);
fprintf(‘Umean: %.2f m/sn’, U_mean);
fprintf(‘Mach Number: %.2fn’, Mach);
fprintf(‘V_axial: %.2f m/sn’, V_axial);
fprintf(‘V_theta2: %.2f m/sn’, V_theta2);
fprintf(‘Beta1: %.2f derecen’, beta1);
fprintf(‘Beta2: %.2f derecen’, beta2); figure, circle, gas turbine, compressor, rotor, color, variable MATLAB Answers — New Questions