Calling/Manipulating functions created by PDEtoolbox GUI in the command window
Show older comments
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
Accepted Answer
More Answers (0)
Categories
Find more on Geometry and Mesh in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!