3D plot for stress distribution on mesh nodes

24 views (last 30 days)
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?

Answers (1)

Anshuman
Anshuman on 22 Feb 2024
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.

Categories

Find more on Stress and Strain in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!