How to set the coefficient of PDE equation as a user-defined matlab function?
Mostrar comentarios más antiguos
Hi,
My problem is Possion's equation. I use assempde function to solve my problem in command lines. The coefficient c is denpended on coordinate x,y. But, c cannot be writed as a simple expression with x,y. So I write a function to interpolate the value.
I looked up in the help documnent of "assempde". It says that "The name of a user-defined MATLAB function that accepts the arguments (p,t,u,t0). "
Does it mean I cannot use the coordinate value x,y?
What should the function return? A matrix or a vector??Could you give me more details?
Thanks!
Qingyuan
Respuesta aceptada
Más respuestas (2)
Ruslan
el 8 de Dic. de 2011
0 votos
"The expression is evaluated in a context where the variables x, y, sd, u, ux, uy, and t are row vectors representing values at the triangle centers of mass (t is a scalar). The row vectors contain x- and y-coordinates, subdomain label, solution, x and y derivatives of the solution, and time. u, ux, and uy can only be used if u0 has been passed to assempde. The same applies to the scalar t, which is passed to assempde as time."
What's your version of MATLAB? You can use 'x' and 'y' in your analytical expression in coefficients or as a "row vector of values at the triangle centers of mass".
zhao qingyuan
el 3 de En. de 2012
0 votos
Categorías
Más información sobre Geometry and Mesh en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!