How to write an equation for a 3D problem in the PDE toolbox? How to set coefficients in the matrix form?

2 ビュー (過去 30 日間)
Fernando
Fernando 2020 年 12 月 13 日
編集済み: Fernando 2020 年 12 月 13 日
Hello, I'm trying to set a PDE problem in the partial differential equation toolbox using the general form pde. It's an electromagnetic problem. I'm having trouble setting the right format of the coefficients of the equation. So far I have worked the following code. I think I have set m, f correctly... I have a bit of doubt of d and I am clueless about c... it's a bit unclear to me from the documentation how to do it since I can't find any 3D examples nor there are any electromagnetic examples that I have been able to find. I'd appreciate a lot if someone can at least point out the right way to set the coefficient c.
conductor = createpde(3);
importGeometry(conductor,'Cylinders.stl')
u0=4*pi*10^-7;
Hmax=1.5*u0;
t=0:1:200;
tA=100;
tB=200;
Happ=(Hmax).*(t/tA).*(t<tA)+(Hmax).*(2-t/tA).*(t>=tA).*(t<tB)+0.*(t>=tB);
applyBoundaryCondition(SC,'dirichlet','Face',4:6,'u',Happ);
m = @(location,~)[zeros(size(location.x));zeros(size(location.y));zeros(size(location.z))];
corresponding to the matrix
[0 0 0; 0 0 0; 0 0 0]
d = @(location,~)[u0*ones(size(location.x));u0*ones(size(location.y));u0*ones(size(location.z))];
corresponding to the matrix
[u0 0 0; 0 u0 0; 0 0 u0] ?
f = @(location,~)[zeros(size(location.x));zeros(size(location.y));zeros(size(location.z))];
corresponding to the matrix
[0 0 0; 0 0 0; 0 0 0]
the c coefficient should the matrix
[0 Ez -Ey; -Ez 0 Ex; Ey -Ex 0]
where each variable comes from:
Ex=px*(d(Hz,y)-d(Hy,z))
Ey=py*(d(Hx,z)-d(Hz,x))
Ez=pz*(d(Hy,x)-d(Hx,y))
and u=[Hx, Hy, Hz]^T
specifyCoefficients(conductor,'m',m,...
'd',0,...
'c',c,...
'a',0,...
'f',f);
Thanks in advance

回答 (0 件)

カテゴリ

Help Center および File ExchangeGeometry and Mesh についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by