Can pdepe solve a system of two second-order equations?

조회 수: 3 (최근 30일)
Schmieje
Schmieje 2025년 1월 30일
편집: Walter Roberson 2025년 2월 2일
Updated 30.01.25, based on the given answers and the pde1dM_manual.pdf section 4.4, I updated the code below accordingly
I am trying to figure out pdepe and how to use it to solve a higher order equation written as multiple second order equations. Even though I am trying to solve a more complex equation in the future I want to start with a simple case
. (Updated based on the answers)
My idea is to rewrite it by including a second variable (in fact I now need three equations, since I got the second derivative in time)
, (Updated based on the answers)
I chose the spatial coordinate to range from x=linsapce(0,2*pi,N) to ensure that my initial conditions satisfy my boundary conditions (see below).
In pdepe terms I wrote
function [c,f,s] = pdex1pde(x,t,u,dudx)
global D
c = [1 ; 1; 0];
f = [0; -D*dudx(3); -dudx(1)];
s = [u(2); 0; u(3)];
% Old code
% c = [1 ; 0];
% f = [D*dudx(2); dudx(1)];
% s = [0; -u(2)]; %where q=u(2);
end
and providing some initial condition (from 0 to 2pi)
function u0 = pdex1ic(x)
% initial condition based on pde1dM_manual.pdf section 4.4
init = 1-cos(x);
d4init_dx4 = cos(x);
u0 = [init; 0; d4init_dx4];
% Old code
% init = 1-cos(x);
% d2init_dx2 = cos(x);
%
% u0 = [init; d2init_dx2]
end
For the boundary conditions I just used a Neumann boundary for each boundary
function [pl,ql,pr,qr] = pdex1bc(xl,ul,xr,ur,t)
% Updated boundary conditions equivalent to a simply supported beam
% based on pde1dM_manual.pdf section 4.4.3
pl = [ul(1); ul(2); ul(3)];
ql = [0; 0; 0];
pr = [ur(1); ur(2); ur(3)];
qr = [0; 0; 0];
% Old code
% pl = [0;0];
% ql = [1;1];
% pr = [0;0];
% qr = [1;1];
end
Now pdepe gives me a warning that it could not converge at time t=0 and I don't get a result.
Is there something that I am missing?
I had a look at other questions about this topic and already stumbled upon this github page (https://github.com/wgreene310/pdepe-examples), but I don't really understand it without the written equations.
Thank you very much for answering.
Update: Pdepe converged and was able to solve the updated equation as a system of two spatialy second order equations
  댓글 수: 5
James Blanchard
James Blanchard 2025년 1월 30일
I don't think that system has a unique solution.
Schmieje
Schmieje 2025년 1월 30일
You are right, the equation should read following the pde1dm_manual.

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

채택된 답변

Torsten
Torsten 2025년 1월 30일
편집: Torsten 2025년 1월 30일
Goto
download the code, goto folder "documents" and study example 4.4 in "pde1dm_manual".
  댓글 수: 4
Torsten
Torsten 2025년 1월 30일
Since you modified your question I'm not sure whether you could solve your problem with the code given or whether you still encounter difficulties.
Schmieje
Schmieje 2025년 2월 2일
편집: Walter Roberson 2025년 2월 2일
Yes, I got a solution for the updated code.
These are the results for every
i = 1:10:numel(t)
sol = pdepe(0,@pdex1pde,@pdex1ic,@pdex1bc,x,t);
result = sol(i,:,1);
with the given model parameters
x = linspace(0,2*pi,100);
t = linspace(0,10,151);
D = 0.01;

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Boundary Conditions에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by