Can we solve ODEs as a nested function while using pdepe?

조회 수: 6(최근 30일)
Hashim
Hashim 2022년 7월 14일
댓글: Hashim 2022년 7월 17일
Hi,
I would like to know how to solve ODEs as a nested function or some other way in my pdepe scripts? So lets say this below:
function [c,f,s] = pdex1pde(x,t,u,DuDx)
c = pi^2;
f = DuDx;
s = 0;
end
How do I add a nested function to alter the source s? I know I can do it within the function above as well but I would like to make a more complex function elsewhere and introduce it at s as a sum or subtraction.
Hope I am making some sense.
  댓글 수: 5
Torsten
Torsten 2022년 7월 15일
From pdex1pde, call a function in which you provide the necessary data to solve the ODE, solve the ODE and return the result to pdex1pde. What's the problem ? And where is the ODE in the set of equations you gave the link to ?

댓글을 달려면 로그인하십시오.

답변(1개)

Rishita
Rishita 2022년 7월 15일
  댓글 수: 1
Hashim
Hashim 2022년 7월 17일
I don't get how this is related. I know how to use pdepe by this point.

댓글을 달려면 로그인하십시오.

제품


릴리스

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by