how to plot deformation with value from ansys to matlab

20 次查看(过去 30 天)
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.

采纳的回答

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

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Orange 的更多信息

产品


版本

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by