フィルターのクリア

why matlab take a lot of time in the symbolic calculation

1 回表示 (過去 30 日間)
merwan behar
merwan behar 2021 年 7 月 4 日
コメント済み: merwan behar 2021 年 7 月 5 日
I wrote a code to calculate the fundamental frequencies of a piezoelectric nanotube, I used the state space analytical method to solve my differential equation which based on the computation of the exponential of a matrix but the problem takes a lot for the execution and I did not know for I will be very happy if you clarify the problem for me
the code is
clear all
clc
%introduire des variable
h=1e-9;
L=10e-9;
C11=132e9;
e31=-4.1;
mu=0;
E11=5.841e-9;
E33=7.124e-9;
ro=7500;
B=(pi/h);
r1=49.5e-9;
r2=50.5e-9;
A=pi*((r2^2)-(r1^2));
I=pi*(((r2^4)/4)-((r1^4/4)));
fun1=@(x,r) e31.*(r.^2).*sin(x).*B.*sin(B.*r.*sin(x));
fun2=@(x,r) E11.*r.*(cos(B.*r.*sin(x))).^2;
fun3=@(x,r) E33.*(B^2).*r.*(sin(B.*r.*sin(x))).^2;
F31 = integral2(fun1,0,2*pi,49.5,50.5);
X11 = integral2(fun2,0,2*pi,49.5,50.5);
X33 = integral2(fun3,15,2*pi,49.5,50.5);
NE=0;
%introduire la matrice A
syms w
p1=((ro*A*w^2)/(C11*I));
p2=((-(mu^2*ro*A*w^2)+(F31^2/X11))/(C11*I));
p3=((F31*X33)/(X11*C11*I));
p4=(F31/X11);
p5=(X33/X11);
a=[0 1 0 0 0 0;0 0 1 0 0 0;0 0 0 1 0 0;...
(p1) 0 (p2) 0 (p3) 0;0 0 0 0 0 1;0 0 (p4) 0 (p5) 0];
[V,D]=eig(a);
H=eye(6);
M=V*diag(exp(diag(D*L)))/V;
%condition aux limite simplement appuyé
l1=H(1,:);
l3=H(3,:);
l5=H(5,:);
m1=M(1,:);
m3=M(3,:);
m5=M(5,:);
%la matrice final
K=[l1;l3;l5;m1;m3;m5];
DA=det(K);
%fréquence fondamental
for n = 1:5
F = vpasolve(DA,w,[0.4 3],'Random',true)
end

採用された回答

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2021 年 7 月 4 日
The problem with integral2 calculation part not with vpasolve(). You need to check the limit values for xmin, xmax, ymin, ymax in interal2(). This below given syntax controls tolerances and finds the solutions, BUT
...
F31 = integral2(fun1,0,2*pi,49.5,50.5, 'Method','iterated','AbsTol',0,'RelTol',1e-10); % Solves the problem partially
X11 = integral2(fun2,0,2*pi,49.5,50.5, 'Method','iterated','AbsTol',0,'RelTol',1e-10);
X33 = integral2(fun3,15,2*pi,49.5,50.5, 'Method','iterated','AbsTol',0,'RelTol',1e-10);
NE=0;
As it is given, the polynomial coeffs p2, p3 .. p5 = nan.
Therefore, it does not produce any solutions.
  1 件のコメント
merwan behar
merwan behar 2021 年 7 月 5 日
yes I made a mistake in the meantime it's [49.9e-9 50.5e-9]
I made his modifications
fun1=@(x,r) e31.*(r.^2).*sin(x).*B.*sin(B.*r.*sin(x));
fun2=@(x,r) E11.*r.*(cos(B.*r.*sin(x))).^2;
fun3=@(x,r) E33.*(B^2).*r.*(sin(B.*r.*sin(x))).^2;
F31 = integral2(fun1,0,2*pi,49.5e-9,50.5e-9,'method','iterated');
X11 = integral2(fun2,0,2*pi,49.5e-9,50.5e-9,'method','iterated');
X33 = integral2(fun3,15,2*pi,49.5e-9,50.5e-9,'method','iterated');

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeNumeric Solvers についてさらに検索

製品


リリース

R14SP1

Community Treasure Hunt

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

Start Hunting!

Translated by