How to plot stress countours with same colour code in ABAQUS?
8 次查看(过去 30 天)
显示 更早的评论
I have the stress values as a matrix. I want to plot the stress throughout my 2-D model domain using the same colour code availabe in ABAQUS. Essentially I would like to compare the stress plot obtained from MATLAB (which is plotted using the theoretical values of stresses) with that the of the plot obtained in ABAQUS after the numerical analysis.
1 个评论
回答(1 个)
Shubham
2023-5-29
Hi Shins K,
To plot stress values in MATLAB with the same colour code as in ABAQUS, you can follow the steps below:
- Use the imagesc() function to create a 2-D plot of the stress values matrix.
- Assign the minimum and maximum stress values to the caxis() function to set the color limits.
- Use the colormap() function to set the color map. The default colormap in MATLAB is not the same as that in ABAQUS, therefore, to match the same color code as in Abaqus, you can set the colormap to "jet".
- Add a colorbar to show the stress values and their corresponding color representation.
Here is a sample code to plot the stress values using MATLAB
% Create a sample stress matrix with dimension 50x50
stress_matrix = rand(50,50)*100;
% Plot the stress matrix with a colorbar
imagesc(stress_matrix);
axis equal;
caxis([min(stress_matrix(:)) max(stress_matrix(:))]); % Set the color limits
colormap(jet); % Set the color map
colorbar(); % Add the colorbar
title("Stress distribution plot");
The rand() function here is used to generate random stress values in the range of 0 to 100 for a 50x50 domain, which can be replaced by your actual stress values matrix.
Once you plot the theoretical stress values in MATLAB using the above approach, you can compare them with stress plots obtained from the numerical analysis in ABAQUS, and check for similarities and differences visually.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Stress and Strain 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!