Code covered by the BSD License  

Highlights from
Accelerating Finite Element Analysis (FEA) in MATLAB

image thumbnail

Accelerating Finite Element Analysis (FEA) in MATLAB

by

 

Accelerate computationally intensive part of FEA by using Parallel computing.

cantilever_switch_smode.m
% Load the results from previous iteration of electrostatic analysis
load('inputdata.mat');

% Meshing parameters
eL_rF = [0.01 0; ...
         1e-6 0; ...
         7e-7 0; ...
         0.01 1; ...
         1.7e-6 1; ...
         1e-6 1; ...
         7e-7 1; ...
         5e-7 1; ...
         1e-6 2; ...
         3e-7 1; ...         
         7e-7 2; ...         
         5.5e-7 2; ...         
         5e-7 2; ...         
         1e-6 3; ...         
         1e-7 0; ...         
         3e-7 2; ...         
         7e-8 0; ...         
         0.1 4; ...         
         1e-7 1; ...         
         1.5e-7 2; ...         
         1e-7 2; ...         
    ]; 

% Loop through the meshing parameters to do FEA analysis
for ii = 1:length(eL_rF)
    % Close all the figures
    close all;    
    
    % Mechanical analysis using FEA
    disp(sprintf('\nRunning task %i. Start time: %s',ii,datestr(clock)));  
    [perfStats output feaPoints feaTriangles] = mems_cantilever_spmode2(xCoords', yCoords', pForce, BC, eL_rF(ii,1),eL_rF(ii,2),false);
    
    % Save the Y displacement of the free end of the cantilever switch
    yDisp = output(2:2:end);
    max_yDisp(ii) = max(abs(yDisp))*1e6;
    perfStats.MaxYDisp = max_yDisp(ii);    
    
    % Save the performance statistics to .MAT
    save(['cs_hpcm01w2k864_smode_' num2str(ii)],'perfStats');
    disp(['Max Y displacement (in microns) = ' num2str(max_yDisp(ii))]);
end

Contact us