フィルターのクリア

plot gradient of pde

1 回表示 (過去 30 日間)
d
d 2016 年 2 月 1 日
コメント済み: Alan Weiss 2016 年 2 月 10 日
Hi,
1) I solved the laplace equation and found the electric field using:
u= assempde(b,p,e,t,c,a,f); %laplace equation on rectangle geometry
[Ex,Ez] = pdegrad(p,t,-u); %find electric field
ugrad = [Ex;Ez];
how to plot Ex and Ez as a function of (x,z) (seperatly, not as a quiver plot)?
  • using tri2grid and plot it with "surf" is not an opption becouse the grid is very very large and it takes a lot of time to execute "tri2grid".
2) how can I find the values of Ex,Ez,U at the boundaries without using "tri2grid"?
  • eventualy I need just the solution of U,Ex,Ez at the bounderies

回答 (1 件)

Alan Weiss
Alan Weiss 2016 年 2 月 8 日
Use pdeplot with the xydata name-value pair set to Ex or Ez. You could even set xydata to Ex and zdata to Ez.
Alan Weiss
MATLAB mathematical toolbox documentation
  2 件のコメント
d
d 2016 年 2 月 9 日
But as I understood, Ez is evaluated at the center of each triangle t.
when I'm Using
pdeplot(p,e,t,'xydata',Ex);
doesn't it supposed to plot the values at the POINTS p?
Alan Weiss
Alan Weiss 2016 年 2 月 10 日
Did you try my suggestion? It works for me:
[p,e,t] = initmesh(@lshapeg);
u = assempde(@lshapeb,p,e,t,1,0,1);
[ux,uy] = pdegrad(p,t,u);
pdeplot(p,e,t,'xydata',ux,'zdata',uy)
Look in the documentation, you see that you can give point OR triangle data to pdeplot.
Alan Weiss
MATLAB mathematical toolbox documentation

サインインしてコメントする。

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by