Hello
Please how to rectify this error ?
Error in trapz (line 72)
if ~isempty(perm), z = ipermute(z,perm); end
Error in Variable_sec (line 194)
sigma_r(:,kmj) = trapz(x,m* Mode_shape(:,kmj));
The program is :
% width
b0 = 0.01;
x = linspace(0,L,100);
ratio = 1;
b = b0*ratio + (1/L)*b0*(1-ratio)*(L-x);
% masse
m_const = (rhos * hs + rhop* hp);
m = b * m_const;
% Layer thickness (hs = substrate, hp = piezo)
hs = 0.0005;
hp = 0.0001;
% Density of piezo
rhop = 7800;
% Density of substrate
rhos = 8700 ;
% Setion lengths
L = 0.035;
% lambda
f= @(lambda) 1+(cos(lambda)*cosh(lambda)) ;
for i=1:nlambda
lambda(i) = fzero(f, (pi/2)+pi*(i-1));
end
for km =1:nlambda
psi(km)= ( -cos (lambda(km))- cosh(lambda(km)) )/ ( -sin(lambda(km))+ sinh(lambda(km)) ) ;
x = linspace(0,L,100);
Mode_shape (:,km) = sin ( (lambda(km)/L)*x)- sinh( (lambda(km)/L)*x)+ psi(km) *( cos( (lambda(km)/L)*x) - cosh( (lambda(km)/L)*x));
end
%Modal forcing
for kmj=1:nlambda
sigma_r(:,kmj) = trapz(x,m* Mode_shape(:,kmj));
end

2 件のコメント

madhan ravi
madhan ravi 2019 年 1 月 1 日
what's nlamda?
Mallouli Marwa
Mallouli Marwa 2019 年 1 月 1 日
nlambda=11;

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

 採用された回答

madhan ravi
madhan ravi 2019 年 1 月 1 日
編集済み: madhan ravi 2019 年 1 月 1 日

0 投票

L = 0.035;
hs = 0.0005;
hp = 0.0001;
rhop = 7800;
rhos = 8700 ;
b0 = 0.01;
x = linspace(0,L,100);
ratio = 1;
nlambda=11;
b = b0*ratio + (1/L)*b0*(1-ratio)*(L-x);
m_const = (rhos * hs + rhop* hp);
m = b * m_const;
f= @(lambda) 1+(cos(lambda)*cosh(lambda)) ;
lamda=zeros(1,nlambda); % preallocate
for i=1:nlambda
lambda(i) = fzero(f, (pi/2)+pi*(i-1));
end
x = linspace(0,L,100);
psi=zeros(1,nlambda);
sigma_r=zeros(100,nlambda);
for km =1:nlambda
psi(km)= ( -cos (lambda(km))- cosh(lambda(km)) )/ ( -sin(lambda(km))+ sinh(lambda(km)) ) ;
Mode_shape = sin ( (lambda(km)/L)*x)- sinh( (lambda(km)/L)*x)+ psi(km) *( cos( (lambda(km)/L)*x) - cosh( (lambda(km)/L)*x));
sigma_r(:,km) = trapz(x,m.* Mode_shape.');
end

7 件のコメント

madhan ravi
madhan ravi 2019 年 1 月 1 日
See edited answer
Mallouli Marwa
Mallouli Marwa 2019 年 1 月 1 日
The mode_shape dimension must be 100*11
So it must be still mode_shape(:,km)
Please help me
madhan ravi
madhan ravi 2019 年 1 月 1 日
So see Star Striders answer .
Mallouli Marwa
Mallouli Marwa 2019 年 1 月 1 日
His program runs with error.
Your try is good but if you can change the dimension of mode shape
madhan ravi
madhan ravi 2019 年 1 月 1 日
See edited answer.
Mallouli Marwa
Mallouli Marwa 2019 年 1 月 1 日
Thanks a lot.
madhan ravi
madhan ravi 2019 年 1 月 1 日
Anytime :)

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeChemistry についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by