Effacer les filtres
Effacer les filtres

3D plot for stress distribution on mesh nodes

3 vues (au cours des 30 derniers jours)
Reza Razavi
Reza Razavi le 4 Nov 2021
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?

Réponses (1)

Anshuman
Anshuman le 22 Fév 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.

Catégories

En savoir plus sur Stress and Strain dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by