- Export any non-changing model matrices from pdetool to the MATLAB command line (e.g. the geometry matrices)
- Use the PDE Toolbox command-line functions to calculate the solution from your changed input (e.g. assempde).
Calling/Manipulating functions created by PDEtoolbox GUI in the command window
1 回表示 (過去 30 日間)
古いコメントを表示
I have created a square in the PDEtoolbox GUI throughout which the toolbox has solved for diffusion of particles towards the center of the square and for particle flux at any x and y.
To create a function that solves for flux at any x and y in the command window, I have exported the mesh and solution from the PDEtoolbox to the command window, specifically p and u parameters respectively, and used the TriScatteredInterp to create this function F(x,y) in the command window:
F = TriScatteredInterp(p (1,:)', p (2,:)', u);
When I save my work in the PDEtoolbox GUI, it shows up as a “function” in the “current folder” section (which makes me think this function may be used in the command window directly in other manipulations).
I would now like to repeat this process with multiple surface boundary conditions (i.e. different initial fluxes defined in the PDEtoolbox GUI at the surface of the square) and solve for the respective flux profiles (F(x,y)).
Rather than setting this up over and over again in the PDEtoolbox GUI and exporting parameters over and over, is there a way that I can
1. Modify the coding in the “PDEtoolbox function” I have created to contain a variable for the surface flux boundary condition rather than a specific value,
2. Define a value or array of values for this variable in the command window,
3. Call the “PDEtoolbox function” in the command window and pull the mesh values and solution from it for input into the TriScatteredInterp function to create a solution or solutions for F(x,y)? Or perhaps a function F(x,y,a) where “a” is the variable representing the surface flux on the square? (Therefore the need to create a whole new picture in the PDE toolbox GUI and export parameters for each new condition is avoided)
Thanks for any tips!
Jeremy
0 件のコメント
採用された回答
Bill Greene
2013 年 2 月 6 日
Hi,
The "function" file created by pdetool when you select the "Save As" option is really for the use of pdetool, only. It is generally not recommended that you manually edit that file and it isn't useful for automating a pde solution from the command line.
An alternate approach is this:
You mentioned that you want to change your boundary conditions. The most straightforward way to do this is by writing a "boundary file" which is just a function that you write to define boundary conditions.
There are several examples of using PDE Toolbox from the command line here: http://www.mathworks.com/help/pde/examples/index.html
Bill
その他の回答 (0 件)
参考
カテゴリ
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!