필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Help writing two equations in Matlab (Please view Attachment)

조회 수: 1 (최근 30일)
Yianni
Yianni 2014년 10월 26일
마감: MATLAB Answer Bot 2021년 8월 20일
I have two equations and I want to loop a value for 'n' from 1 to 50. I want to put these equations in so that Ln (equation 1) is part of Bn (equation 2). The constants are given below:
S = 1200;
Lx = 0.127;
Ly = 0.203;
k = 0.16;
I have tried this and all it gives for Bn is negative values of zero which is not right:
Ln = zeros(1,nmax); Bn = zeros(1,nmax);
for n = 1:nmax
Ln(n)= ((2*n-1)*pi)/(2*Lx);
Bn(n) = ((2*S)/(k*Lx))*(((-1)^n)./((Ln(n).^3).*cosh(Ln(n)*Ly)));
end
  댓글 수: 2
Star Strider
Star Strider 2014년 10월 26일
I get ‘B(n)’ as a rapidly decaying oscillation asymptotic to 0 when I write my own code for your equation. If this is not the result you expect, and you copied your function correctly, check your constants.
Hendrik
Hendrik 2014년 10월 26일
It is because according to your formula the values for Bn become extremely small. And because the first value is -10.07 which his much much larger, the later entries in the array will appear as 0. For example Bn(50) is 1.4e-112
Also if you use a for loop, there is no need to put a dot in front of the / or the *

답변 (0개)

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by