フィルターのクリア

Problem introducing perturbation in PDE solution using solvepde from the Partial Differential Equations toolbox

6 ビュー (過去 30 日間)
Hello.
I am solving a generic PDE using the solvepde function of the Partial Differential Equations toolbox. For the specific solution I need, I need to solve the PDE for a given amount of time, then introduce an external perturbation and resume the solving the PDE. I am having trouble introducing the external perturbation.
If I try to manually change the previous solution and use it as an input to setInitialConditions for the second step, I get an error: "Unable to set the 'NodalSolution' property of class 'TimeDependentResults' because it is read-only.".
If I add nodes to the model and manually change the PDE solution there, the solution surpringly does not converge...
I would welcome any help you could give on this, please. Many thanks,
Marta

回答 (1 件)

Ayush Anand
Ayush Anand 2023 年 8 月 29 日
Hi Marta,
I understand that you are solving a PDE, and after a given amount of time,you are trying to introduce some external perturbation and resume solving the PDE.
Here is how you could do the same:
  1. Solve the original PDE without perturbation for the required amount of time using “solvepde”
  2. Extract the solution data from the “Model” or “Result” object obtained from the first step. You can do this by a command like the following:
intermediateSolution=results.NodalSolution
3. Now introduce the external perturbation in the solution data extracted above.
4.Create a new “Model” object using the same geometry and mesh as the original model used in step 1.
5.Use the “setInitialConditions” function to set the perturbed solution as the initial condition for the new model.
6.Solve the new model using “solvepde” again.
Assuming that you are trying a similar workflow as above, the error you are encountering might be because you are trying to set the “results.NodalSolution” parameter to the perturbed solutions for the second step instead of using the “setInitialConditons” function.
Please refer the following MathWorks Documentation for more information about Time-dependent PDE solutions and parameters like “NodalSolution”:
I hope this helps.

カテゴリ

Help Center および File ExchangeGeneral PDEs についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by