Solve a semilinear elliptic PDE in Matlab as part of an distributed optimal control problem
10 ビュー (過去 30 日間)
古いコメントを表示
Hey everyone,
I need to put in the following PDE into Matlab and solve it via FEM. The PDE is part of an complete optimal control problem, but if I know, how to put in the PDE, I will probably also know the rest.
Here, y is the solution to the PDE in H^1_0(D) (the state operator) and u in L^2(D) is the control operator (fixed function). D is the unitsquare in R^2 and x \in R^2.
a and r are just random functions (also fixed).
My problem is, that I don't know, how to put in nonconstant values or functions into the standard specifyCoefficients enviroment.
PDE:
- \nabla * ( a(x,\omega) \nabla y(x,\omega)) + r(x,\omega) (y(x,\omega))^3 = u(x)
y(x,\omega)=0
I know how to put in the dirichlet boundary condition, but struggle with the nonboundary part. In general I would like to have something like similar to −∇⋅(c∇u)+au=f, but with nonfixed c,a,f.
model=createpde();
geometryFromEdges(model,@squareg);
applyBoundaryCondition(model,'dirichlet','Edge',1:model.Geometry.NumEdges,'u',0);
rightHandSide= ' (put in the fixed funtion here) '
coefficient= 'my function a'
distributedControl= 'u.^2' ; % so that overall I have u^3 in matlab
specifyCoefficients(model,'m',0,...
'd',0,...
'c',coefficient,...
'a',distributedControl,...
'f',righHandSide);
generateMesh(model,'Hmax',hmax);
pdemesh(model);
Unfortunatly this approach doesn't work and I'm not sure how I can make it work. I would appreciate any help.
Best,
Tobias
0 件のコメント
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で PDE Solvers についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!