How to use solvepde with non constant coefficient?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello I want to use solvepde, but do not understand how to create the PDE-ModelObject or rather how to calculate the coefficent if they are not constant.
I first create the model:
model=createpde(size(u0,1));
geometryFromEdges(model,g);
setInitialConditions(model,u0);
bToBoundCond(model,b); % transforms b from PDE-GUI in boundary conditions for PDE Model-Container
generateMesh(model);
Everything works until now. Next I want to define the coeffcients of my PDE. m and a are zero. d is dependent of the Subdomain (number of 8) c and f are dependent on solution u and dependent on Subdomain.
So first, how can I define d in dependence on the subdomain? An second how can I define c and f when I create the model, but the model is not yet called by solvepde? How does solvepde Change the coefficients c and f when solving the System?
Thank you very much for any help. I am a Little bit smitten and puzzled at the Moment...
LF
0 commentaires
Réponses (1)
Alan Weiss
le 29 Juin 2017
If you have a relatively recent toolbox version, you can find out how to write coefficients here. In particular, nonconstant m, d, and a coefficients, nonconstant f coefficient, and nonconstant c coefficient have the coefficient-specific instructions.
There is an example of a nonconstant a coefficient here. While it is not completely applicable, it should help guide you.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation
5 commentaires
Alan Weiss
le 6 Juil 2017
I believe that the vocabulary we use is, perhaps, not defined well enough. Sorry about that.
In PDE Toolbox, you have exactly one geometry that defines the spatial domain over which the PDE exists. This geometry, in 2-D, may be further divided into subdomains, such as the left and right halves of a rectangle, or any other set of contiguous 2-D geometric areas whose union is the geometry. So a subdomain is a contiguous region in 2-D space. Furthermore, the intersection of a subdomain with any other subdomain is either empty or is edges, but has no area. In other words, you can think of the geometry as being a completed jigsaw puzzle, and each jigsaw puzzle piece is a subdomain.
In addition, you can have any number of PDE equations that apply to the geometry. So if you have "layers" that lie on top of each other, I believe that you mean that you have several equations, not several subdomains.
When solvepde passes regions to your coefficient functions, each "region" is a location given in terms of (x,y) coordinates. These coordinates may also correspond to a particular subdomain, and so if your coefficient functions use subdomains, you will get both the (x,y) "region" and the subdomain number.
Is that clearer?
Alan Weiss
MATLAB mathematical toolbox documentation
Alan Weiss
le 7 Juil 2017
I am afraid that I cannot help you any further. It seems that you have been following the progress of the solver using the debugger, but still do not understand what you see. I, too, do not understand what you report. Any guesses that I have are as likely to be misleading as they are to be helpful.
Alan Weiss
MATLAB mathematical toolbox documentation
Voir également
Catégories
En savoir plus sur General PDEs dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!