plot gradient of pde
조회 수: 1 (최근 30일)
이전 댓글 표시
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
댓글 수: 0
답변 (1개)
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
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)
Alan Weiss
MATLAB mathematical toolbox documentation
참고 항목
카테고리
Help Center 및 File Exchange에서 Geometry and Mesh에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!