how to give value stress from excel give color in my mesh thin cylinder

2 ビュー (過去 30 日間)
Nobeth Bastanta Ginting
Nobeth Bastanta Ginting 2022 年 7 月 9 日
コメント済み: KSSV 2022 年 7 月 10 日
hello sir. can you help me how to give value stress in cylinder. i have data excel value stress.
clear all;clc ; close all;
a = readtable('nodes.xlsx');
b = readtable('element.xlsx');
coordinates = table2array(a);
nodes = table2array(b);
PlotMesh(coordinates,nodes,1);
hold on
T = readtable('valuestress.xlsx');
stress = table2array(T);
x = coordinates(:,1);
y = coordinates(:,2);
z = coordinates(:,3);

回答 (1 件)

KSSV
KSSV 2022 年 7 月 9 日
編集済み: KSSV 2022 年 7 月 9 日
You have extracted the stress at the mid point of the element. You need to extract the stress values at every node.
warning off
A = readtable('https://in.mathworks.com/matlabcentral/answers/uploaded_files/1059920/valuestress.xlsx') ;
t = readtable('https://in.mathworks.com/matlabcentral/answers/uploaded_files/1059925/element.xlsx') ;
p = readtable('https://in.mathworks.com/matlabcentral/answers/uploaded_files/1059930/nodes.xlsx') ;
%
A = table2array(A) ;
p = table2array(p) ;
t = table2array(t) ;
patch('faces',t,'vertices',p,'facevertexcdata',p(:,3),'facecolor','interp','edgecolor','k') ;
view(3) % if A is of size 176x1, use A instead of p(:,3), you will get the required plot
  6 件のコメント
Simson Hutagalung
Simson Hutagalung 2022 年 7 月 10 日
How if stress in element, sir?
KSSV
KSSV 2022 年 7 月 10 日
You can interpolate the elemental stress to nodes and then plot. This is suggested to be done in Ansys itself.
Any ways, I am doing the same in MATLAB.
clear all;
warning off
A = readtable('https://in.mathworks.com/matlabcentral/answers/uploaded_files/1059920/valuestress.xlsx') ;
t = readtable('https://in.mathworks.com/matlabcentral/answers/uploaded_files/1059925/element.xlsx') ;
p = readtable('https://in.mathworks.com/matlabcentral/answers/uploaded_files/1059930/nodes.xlsx') ;
%
A = table2array(A) ;
p = table2array(p) ;
t = table2array(t) ;
x = p(:,1); y = p(:,2) ; z = p(:,3) ;
X = x(t') ; Y = y(t') ; Z = z(t') ;
mX = mean(X) ;
mY = mean(Y) ;
mZ = mean(Z) ;
F = scatteredInterpolant(mX',mY',mZ',A) ;
AA = F(X,Y,Z) ;
fill3(X,Y,Z,AA)

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeStress and Strain についてさらに検索

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by