MATLAB: How to fix the error “StructuralModel does not have structural properties” in R2020a

analysisdifferentialequationpartialPartial Differential Equation Toolboxstructural

I am using MATLAB R2020a and creating an axisymmetric model with inner radius "r_in", outer radius "r_out", and height "height", but I am running into the following error when trying to "solve" the model over a frequency range:
StructuralModel does not have structural properties
The model has a mass density "rho", Young's Modulus "E", and Poisson's Ratio "nu". My code is below:
% Create PDE model
model = createpde('structural','modal-axisymmetric');
% Create geometry
geometry = [3,4,r_in,r_out,r_out,r_in,0,0,height,height]';
g = decsg(gdm,'R1',['R1']');
geometryFromEdges(model,g);
% Plot geometry
figure
pdegplot(model,'EdgeLabels','on','VertexLabels','on');
title('Axisymmetric Model');
% Crete mesh
mesh = generateMesh(model,'Hmax',0.02);
figure
pdeplot(model)
% Solve
sol = solve(model,'FrequencyRange',[0 2*pi]); % Error on this line
 

Best Answer

When creating a PDE Structural Model, before solving with the generated mesh, the structural properties must be set using the "structuralProperties" function. In there, the properties specified can be entered as follows:
structuralProperties(model, 'MassDensity', rho, 'YoungsModulus', E, 'PoissonsRatio', nu);
Once these are added, the model can be solved. Keep in mind that there are neither boundary conditions nor loads on the model, so it would be completely static in this case. These can be set using the "structuralBC" and "structuralBoundaryLoad" functions respectively. In total, the new code could be integrated like:
structuralProperties(model, 'MassDensity', rho, 'YoungsModulus', E, 'PoissonsRatio', nu);
structuralBC(model, ...);
structuralBoundaryLoad(model, ...);
mesh = generateMesh(model,'Hmax',0.02);