Exporting all solution variables from PDE Toolbox

5 visualizaciones (últimos 30 días)
Jakub Checinski
Jakub Checinski el 2 de Abr. de 2018
Comentada: Jakub Checinski el 2 de Abr. de 2018
I am solving a DC conductive media problem using the PDE Toolbox. The Plot menu allows me to see both the electric potential and the electric current density, but the Solve->Export Solution button always seem to export a 1D vector containing the electric potential only. How can I get a full solution (both variables) exported?

Respuesta aceptada

Alan Weiss
Alan Weiss el 2 de Abr. de 2018
I'm afraid that you have to do some post-processing. If your exported solution is u, which is the potential at the nodes, then
[ux,uy] = pdegrad(p,t,u);
gives you the gradients at the triangle centers. To get the interpolated values of the potential at the triangle centers,
ut = pdeintrp(p,t,u);
I don't remember exactly how the gradient relates to the current density, but I think that it is proportional, and the constant of proportionality is related to the conductance, but I don't remember precisely what is the relationship.
Alan Weiss
MATLAB mathematical toolbox documentation
  1 comentario
Jakub Checinski
Jakub Checinski el 2 de Abr. de 2018
Thank you. Indeed, manually recalculating gradient from the exported potential variable makes it possible to obtain the current density. I guess there is no shorter solution for the time being.
For future readers, I would like to note that I had to use the standard MATLAB gradient function to get this done. Pdegrad didn't work as it changed the mesh, but maybe in newer versions of MATLAB this can be fixed with pdeintrp.

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by