- https://www.mathworks.com/help/pde/ug/pde.staticstructuralresults.interpolatestress.html#d126e89319
- https://www.mathworks.com/help/pde/ug/assemblefematrices.html#:~:text=.-,assembleFEMatrices,-returns%20the%20following
- https://www.mathworks.com/help/pde/ug/pde.pdemodel.generatemesh.html
How to extract body load from Matlab PDE solver after using interpolateStress function?
2 ビュー (過去 30 日間)
古いコメントを表示
assembleFEMatrices function in Matlab PDE solver eturns a structural array containing all finite element matrices such as body load. assembleFEMatrices can retuen body load based on the intial mesh size of the model which provided by genetereMesh function. For example if our model has 20 nodes it returnes 40 X 1 vector which the first 20 rows coresponds to horizental direction and the next 20 rows coresponds to certical direction. Now if I use interpolateStress to Interpolate stress at arbitrary spatial locations (interpolate over mesh grid of 100 X 100) I cannot extract body load at new arbitrary spatial locations.
Any Idea how to extract body force after I used interpolateStress?
0 件のコメント
回答 (1 件)
Infinite_king
2023 年 10 月 13 日
Hi Hamed,
I understand that you are trying to calculate the induced load in a specific area.
The method for calculating this load depends on the specific problem. If we have access to normal stress information, we can determine the load or force as follows,
% create mesh for the area of interest
% endpoints of the square
left_x = -1;
right_x = 1;
up_y = 1;
down_y = -1;
step_size = 100;
% calulating area of single square or grid in the mesh
single_grid_area = (right_x-left_x)/step_size * (up_y-down_y)/step_size;
% creating meshgrid
x = linspace(-1,1,step_size);
y = linspace(down_y,up_y,step_size);
[X,Y] = meshgrid(x,y);
% calculating the stress at each point given in the meshgrid
% results contains the solution of given PDE
intrpStress = interpolateStress(results,X,Y);
% reshape the stress array to the dimensions of the X,Y meshgrid
sxx = reshape(intrpStress.sxx,size(X));
% Calculating the load on the area of interest
% by summing the loads on each square (grid) in the mesh
load = 0;
for i = 1:step_size
for j = 1:step_size
load = load + single_grid_area * sxx(i,j);
end
end
The for loop can be optimized and written as follows,
% optimizing the load calculation
load = sum(sxx, "all") * single_grid_area;
For more information refer the following resources,
Hope this is helpful.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Geometry and Mesh についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!