3D plot for stress distribution on mesh nodes

조회 수: 24 (최근 30일)
Reza Razavi
Reza Razavi 2021년 11월 4일
답변: Anshuman 2024년 2월 22일
Hi,
I have an output from a FEM solver that is a 500000*9 matrix. Means 500000 nodes (x,y,z coordinates for each node and 6 stresses for each node). I wanna graph these nodes with their assigned stress as different colors based on their magnitude (just like an output for a commercial FEM software). How can I do that?

답변 (1개)

Anshuman
Anshuman 2024년 2월 22일
To visualize the output from an FEM solver as a colored stress plot, you can use MATLAB.
% If your data is stored in a file called 'data.txt', which is a matrix
% with 500,000 rows and 9 columns, where the first three columns are x, y, and z coordinates and the next six columns are the stress components
data = load('data.txt');
% Select the Stress Component you want to visualize
x = data(:, 1);
y = data(:, 2);
z = data(:, 3);
stress_component = data(:, 4);
You can now create a scatter plot with the nodes colored based on the stress component magnitude.
scatter3(x, y, z, 10, stress_component, 'filled'); %'10' here is the marker size
colorbar; % Adds a color bar to the right of the plot to indicate the scale
xlabel('X');
ylabel('Y');
zlabel('Z');
title('Stress Distribution');
Adjust the marker size, colormap, and other plot settings to get the best visualization for your dataset.

카테고리

Help CenterFile Exchange에서 Stress and Strain에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by