how to plot deformation with value from ansys to matlab

21 Ansichten (letzte 30 Tage)
Nobeth Bastanta Ginting
Nobeth Bastanta Ginting am 24 Jun. 2022
Kommentiert: Jue Gu am 15 Dez. 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.

Akzeptierte Antwort

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

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Orange finden Sie in Help Center und File Exchange

Produkte


Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by