www.gusucode.com > pde 案例源码 matlab代码程序 > pde/DifferentInitialConditionsOnSubdomainsExample.m
%% Different Initial Conditions on Subdomains % Set different initial conditions on each portion of the L-shaped membrane % geometry. %% % Create a model, set the geometry function, and view the subdomain labels. model = createpde(); geometryFromEdges(model,@lshapeg); pdegplot(model,'FaceLabels','on') axis equal ylim([-1.1,1.1]) %% % Set subdomain 1 to initial value -1, subdomain 2 to initial value 1, and % subdomain 3 to initial value 5. setInitialConditions(model,-1); setInitialConditions(model,1,'Face',2); setInitialConditions(model,5,'Face',3); %% % The initial setting applies to the entire geometry. The subsequent % settings override the initial settings for regions 2 and 3.