how to plot deformation with value from ansys to matlab

31 visualizzazioni (ultimi 30 giorni)
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.

Risposta accettata

Karim
Karim il 24 Giu 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 Commenti
Nobeth Bastanta Ginting
Nobeth Bastanta Ginting il 24 Giu 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 il 15 Dic 2022
You haven't defined the variation "displacements" which will be used in the patch of subplot(1,2,2).

Accedi per commentare.

Più risposte (0)

Prodotti


Release

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by