pde1dm with coupled ODEs

2 ビュー (過去 30 日間)
feynman feynman
feynman feynman 2024 年 2 月 4 日
コメント済み: feynman feynman 2024 年 2 月 8 日
According to the pde1dm manual, pde1dm with coupled ODEs has to do with three additional arguments to the pde1dm function:
[solution,odeSolution] = pde1dm(m,pdeFunc,icFunc,bcFunc,meshPts,timePts,... odeFunc, odeIcFunc,xOde)
However, I just:
pde1dm(m,pdeFunc,icFunc,bcFunc,meshPts,timePts)
as though I were using pdepe and I still got the correct result. Why? So when should one add the three additional arguments to pde1dm?
  6 件のコメント
Bill Greene
Bill Greene 2024 年 2 月 6 日
If you run into problems using pde1dm, I am willing to take a look. But there is no way I can respond based on the scant information you have provided in this post.
In general what I expect is the following:
  1. A complete mathematical description of the problem you are trying to solve including the equations (in math format) and the result you expect to obtain.
  2. A complete listing of your source code, simplified as much as possible, and formatted as a code block so I can easily download and run it.
feynman feynman
feynman feynman 2024 年 2 月 7 日
To solve ut=uxx through a decomposition into two equations with two unknowns u and ux: and
function heat
w=1;x=linspace(-pi,pi);t=linspace(0,10);
% sol=pdepe(0,@pde,@ic,@bc,x,t);
sol=pde1dm(0,@pde,@ic,@bc,x,t);
u=sol(:,:,1);surf(x,t,u)
%%
function [c,f,s]=pde(x,t,u,ux)
c=[1;0];f=[u(2);u(1)];s=[0;-u(2)];
end
%%
function u0=ic(x)
u0=[cos(x);-sin(x)];
end
%%
function [pl,ql,pr,qr]=bc(xl,ul,xr,ur,t)
pl=[0;ul(2)];ql=[1;0];pr=[0;ur(2)];qr=[1;0];
end
end

サインインしてコメントする。

回答 (1 件)

Bill Greene
Bill Greene 2024 年 2 月 7 日
Your second equation is an elliptic PDE NOT an ODE because both unknown variables are functions of both x and t.. Accordingly, pdepe(and pde1dm) are able to solve this system.
If you are confused about this issue, you should look more carefully at the definition of an ODE shown as equation 2 in the pde1dm user manual. I looked again at the explanation there and don't have anything to add to that at this point.
  4 件のコメント
Torsten
Torsten 2024 年 2 月 8 日
編集済み: Torsten 2024 年 2 月 8 日
As far as I know, additional ODEs are of the form
d(uode)/dt = f(uode,upde,x,t)
thus the equation for uode is described by an ordinary differential equation in time without dependence on uode_x or upde_x.
feynman feynman
feynman feynman 2024 年 2 月 8 日
Thanks for the clarification that an ODE recognized by pdepe is defined this way, i.e. having only time derivatives

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeOrdinary Differential Equations についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by