plotting after a for loop doesn't work

close
clear all
clc;
CM=2;
CD=1;
D=1;
k=2*pi/153.9;
h=60;
H=(0:25);
for zeta_a=H/2
y = real(asin(CM/CD*((pi*D^2)/zeta_a)*sinh(k*h)^2/(sinh(2*k*h)+2*k*h)))
end
plot(H,y, '-b');

 採用された回答

VBBV
VBBV 2022 年 2 月 20 日
編集済み: VBBV 2022 年 2 月 20 日

1 投票

close
clear all
clc;
CM=1;
CD=2;
D=1;
k=2*pi/153.9;
h=60;
H=(0:1:25);I = 1;
for zeta_a=(H/2)
y(I) = real(asin(CM/CD*((pi*D^2)/zeta_a)*sinh(k*h)^2/(sinh(2*k*h)+2*k*h)));
I = I+1;
end
plot(H,y, '-b');

4 件のコメント

Olga Rakvag
Olga Rakvag 2022 年 2 月 20 日
編集済み: Olga Rakvag 2022 年 2 月 20 日
Super! It works, but I want to get a curve like
So I get max x =1.57. But I get max 0.8 don know why?
close
clear all
clc;
CM=1;
CD=2;
D=1;
k=2*pi/153.9;
h=60;
hmax=153.9/7;
H_step =[1:1:hmax];
for zeta_a=1:length(H_step/2)
y(zeta_a) = real(asin(CM/CD*((pi*D^2)/zeta_a)*sinh(k*h)^2/(sinh(2*k*h)+2*k*h)));
end
VBBV
VBBV 2022 年 2 月 20 日
編集済み: VBBV 2022 年 2 月 20 日
Check now
Olga Rakvag
Olga Rakvag 2022 年 2 月 20 日
Thank you! Awesome! :-)
VBBV
VBBV 2022 年 2 月 20 日
Welcome, It appears this equation used for propellers , wind mills for finding axial thrust load ?

サインインしてコメントする。

その他の回答 (1 件)

Olga Rakvag
Olga Rakvag 2022 年 2 月 20 日
編集済み: Olga Rakvag 2022 年 2 月 20 日

0 投票

Here comes the result with your code, thank you! :-)
close
clear all
clc;
CM=2;
CD=1;
D=1;
k=2*pi/153.9;
h=60;
H=(1:1:153.9/7);
I = 1;
for zeta_a=(H/2)
y(I) = real(asin(CM/CD*((pi*D^2)/zeta_a)*sinh(k*h)^2/(sinh(2*k*h)+2*k*h)))
I = I+1;
end
plot(H,y, '-b');
grid on
hold on
h=legend('$\omega t$');
set(h ,'Interpreter','latex','FontSize', 12);
ylabel(' Phase $\omega t$', 'Interpreter','latex')
xlabel('Wave height H(m) ','Interpreter','latex')
title('Phase \omegat for max total force F_T_m_a_x')

カテゴリ

ヘルプ センター および File ExchangePartial Differential Equation Toolbox についてさらに検索

タグ

質問済み:

2022 年 2 月 20 日

編集済み:

2022 年 2 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by