how to plot deformation with value from ansys to matlab

29 vues (au cours des 30 derniers jours)
Nobeth Bastanta Ginting
Nobeth Bastanta Ginting le 24 Juin 2022
Commenté : Jue Gu le 15 Déc 2022
in ansys
data displacements =
UX = displacements (:,2);
UY = displacements (:,3);
data coordinates = coordinates(:,2:end);
data nodes = nodes(:,2:end);
i want value deformation in nodes. can you help me? and can get like in ansys. Thank you.

Réponse acceptée

Karim
Karim le 24 Juin 2022
you can use the patch command, see the method below
coordinates = readmatrix("coordinates.csv");
displacements = readmatrix("displacements.csv");
nodes = readmatrix("nodes.csv");
scale = 5e8; % scale the very small deformations (otherwise you won't see anything)
figure
subplot(1,2,1)
patch('Faces',nodes(:,2:end),'Vertices',coordinates(:,2:end),'FaceAlpha',0.3)
view(3)
axis equal
title("Undeformed")
view([150 45])
subplot(1,2,2)
patch('Faces',nodes(:,2:end),'Vertices',coordinates(:,2:end) + displacements(:,2:end).*scale,'FaceVertexCData', sqrt( sum(displacements(:,2:end).^2,2)),'FaceColor','interp')
view(3)
axis equal
colormap jet
title("Deformed")
view([150 45])
  2 commentaires
Nobeth Bastanta Ginting
Nobeth Bastanta Ginting le 24 Juin 2022
clear
clc
load coordinates.dat ;
coordinates = coordinates(:,2:end);
load nodes.dat;
nodes = nodes(:,2:end);
load displacements.dat ;
scale = 5e8; % scale the very small deformations (otherwise you won't see anything)
figure
subplot(1,2,1)
patch('Faces',nodes,'Vertices',coordinates,'FaceAlpha',0.3)
view(3)
axis equal
title("Undeformed")
view([150 45])
subplot(1,2,2)
patch('Faces',nodes,'Vertices',coordinates + displacements.*scale,'FaceVertexCData', sqrt( sum(displacements.^2,2)),'FaceColor','interp')
view(3)
axis equal
colormap jet
title("Deformed")
view([150 45])
my question : hello sir i use your coding but i make with use file .dat but the value is same. why in deformation no out the no deformation results. because in line 17 it havent problem. can you help me ?
Jue Gu
Jue Gu le 15 Déc 2022
You haven't defined the variation "displacements" which will be used in the patch of subplot(1,2,2).

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Orange dans Help Center et File Exchange

Produits


Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by