use NaN in matrix to get a spherical shape

1 次查看(过去 30 天)
i want solve a pde in spherical coordinates, but failed to do so using the pde toolbox. my plan b is to use a matrix instead, and i want to know if i can insert NaN values to the cells i dont need in order to get the spherical shape, and still be able to run the equations over the matrix without any errors.
also, would i be able to plot the matrix, so only the cells with values will be visible?
if not, is it even possible to solve a 3d pde problem with spherical symmetry in matlab (version 2016b)?
  2 个评论
John D'Errico
John D'Errico 2017-5-6
Of course it is "possible". That you did not succeed is merely a reflection that you did not write the correct code.
Of course you CAN put NaNs in some cells. That part is easy. But be careful that those NaNs won't propagate.
I'd suggest you may be better off using a spherical coordinate system. Write the problem in a different form. Then solve it over the entire spherical domain.

请先登录,再进行评论。

回答(0 个)

标签

Community Treasure Hunt

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

Start Hunting!

Translated by