Borrar filtros
Borrar filtros

3D plot for stress distribution on mesh nodes

3 visualizaciones (últimos 30 días)
Reza Razavi
Reza Razavi el 4 de Nov. de 2021
Respondida: Anshuman el 22 de Feb. de 2024
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?

Respuestas (1)

Anshuman
Anshuman el 22 de Feb. de 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.

Categorías

Más información sobre Stress and Strain en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by