How to fix: Index Exceeds Matrix Dimensions
2 次查看(过去 30 天)
显示 更早的评论
Good morning, It's been a long time since I've used and I don't understand my error on pdeplot3d which puts me as index exceeds matrix dimensions error.
if true
close all
clear all
N=3; %Nombre de composants de l'équation d'élasticité
model = createpde(N); %Création du modèle 3D
importGeometry(model,'plaque.stl');%Importation de la plaque fais sur solidworks
figure
hc = pdegplot(model,'FaceLabels','on'); %identification du nombre de face
hc(1).FaceAlpha = 0.1; %Niveau de transparence du graphe
title('Plate with Face Labels') %titre
E = 200e9; % Module de Young en Pascals de l'acier
nu = 0.3; % coefficient de poison
rho = 8000; % Densité du matériau kg/m^3
c = elasticityC3D(E,nu); % mettre coeff + module dans la boite outil
a = 0;
specifyCoefficients(model,'m',rho,'d',0,'c',c,'a',a,'f',0);
applyBoundaryCondition(model,'mixed','Face',1:4,'u',0,'EquationIndex',3);
hmax = 12; %Pour 12 noeud de maillage
generateMesh(model,'Hmax',hmax,'GeometricOrder','quadratic');% création du maillage à 12 noeud pour une meilleure precision
figure
pdeplot3D(model); %vue 3D du maillage
title('Maille de la plaque');
The code does not work properly from here
refFreqHz = [0 0 0 45.897 109.44 109.44 167.89 193.59 206.19 206.19]; % Valeur de référence publié
%freqHz = [8.87E-06 1.06E-5 1.22E-5 44.871 109.74 109.77 168.59 193.74 207.51 207.52];
maxFreq = (1.1*refFreqHz(end)*2*pi).^2;%Calcul de la pulsation
r = [-.1 maxFreq];
result = solvepdeeig(model,r);%permet de calculer toutes les solutions
eVec = result.Eigenvectors;
eVal = result.Eigenvalues;
numEig = size(eVal,1);
freqHz = eVal(1:numEig)/(2*pi);
fprintf('Frequency(Reference 1),Hz Frequency(solvepdeeig),Hz\n');
numToPrint = min(length(freqHz),length(refFreqHz));
for i=1:numToPrint
fprintf('%10.5g %10.5g\n', ...
refFreqHz(i),freqHz(i));
end
h = figure;
h.Position = [100,100,900,600];
for i = 1:numToPrint
subplot(4,2,i);
pdeplot3D(model,'ColorMapData',eVec(:,3,i));
axis equal
title(sprintf(['Mode=%d, z-displacement\n', ...
'Frequency(Hz): Ref=%g FEM=%g'], ...
i,refFreqHz(i),freqHz(i)));
end
end
0 个评论
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!