フィルターのクリア

How can I create FEA colour plots?

18 ビュー (過去 30 日間)
Tamas Lanci
Tamas Lanci 2020 年 3 月 6 日
編集済み: Tamas Lanci 2020 年 4 月 16 日
Hi Everyone,
I have an array of dataset containing X,Y coordinates and their corresponding FEA results (Von Mises, Displacement, Strain).
What is the easiest way to plot this data on coloured contour plots?
Thank you for your help.
  3 件のコメント
Tamas Lanci
Tamas Lanci 2020 年 4 月 3 日
Can you be a bit more specific?
I have tried to fiddle with the commands you recommended but I couldn't work out how to create the plot.
darova
darova 2020 年 4 月 3 日
Please show your attempts. Attach the data

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

回答 (1 件)

Lubos Smolik
Lubos Smolik 2020 年 4 月 3 日
Assuning that you have a planar rectangular geometry and coordinates and results are stored in vectors x, y and vonMises, you can use the following code:
% x - vector of x coordinates
% y - vector of y coordinates
% vonMises - nodal von Mises stress
n = 50; % number of levels
contourf(x, y, vonMises, n);
xlim([min(x) max(x)]);
ylim([min(y) max(y)]);
xlabel("X coordinate")
ylabel("Y coordinate")
bar = colorbar;
title(bar, "Von Mises stress")
If your geometry is not rectangular, then you also need some information about connections between individual nodes as J. Alex Lee has already noted.
  10 件のコメント
Lubos Smolik
Lubos Smolik 2020 年 4 月 4 日
Tamas Lanci
Tamas Lanci 2020 年 4 月 10 日
編集済み: Tamas Lanci 2020 年 4 月 16 日
Thank you for everybody's help.
I used the TriScatteredInterp method with the ghost nodes as suggested:
clear all
clc
M=readmatrix("DIC_PLATE_COPY.csv");
%Mu=M(1:2:end,:);
px=(M(:,1));
py=(M(:,2));
pz=(M(:,10));
r = 6; % radius of the hollow area
% I am assunming that the centre of the area is in x = 0, y = 0.
pts = 500; % number of the ghost points
phi = linspace(0, 2*pi, pts + 1)';
ptsX = 0.999 * r * cos(phi(1:end-1));
ptsY = 0.999 * r * sin(phi(1:end-1));
% Add the ghost points to your input data
px = [px; ptsX]; % I am assuming that x is a column vector
py = [py; ptsY];
pz = [pz; nan(size(ptsX))];
x=linspace(min(px(:,1)),max(px(:,1)),1000);
y=linspace(min(py(:,1)),max(py(:,1)),1000);
[X,Y]=meshgrid(x,y);
F=TriScatteredInterp(px(:,1),py(:,1),pz(:,1));
[M c]=contourf(X,Y,F(X,Y),40,'LineColor','none');
daspect([1 1 1])
colormap(jet)
colorbar

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

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by