Doubt regarding pdepe in matlab

Hii Friends,
Could you give me your suggestion regarding this problem.
I have the following equation where in the initial, boundary conditions and other parameters have been specified.
I was able to solve in matlab using the following code
%---pdepe function-----% function [c,f,s] = gvdpde(t,z,u,DuDt) i = sqrt(-1); beta2 = -2.907e-25; T0 = 35e-12; %Ld = T0^2/abs(beta2); Ld = 4500; c = (2*i*Ld)./T0^2; f = DuDt; s = 0;
%---Initial condition----% function u0 = gvdic(t) T0 = 35e-12; u0 = exp(-0.5.*(t/T0).^2);
%-----Boundary condition-----% function [pl,ql,pr,qr] = gvdbc(tl,ul,tr,ur,z) pl = 0; ql = 1; pr = ur - 1; qr = 1;
%-----Main function-----% function gvd
clc; clear all; close all;
m = 0; T0 = 35e-12; t = linspace(-30*T0,30*T0,150); z = linspace(0,1000,100); z1 = linspace(0,4500,100); z2 = linspace(0,45000,100);
sol = pdepe(m,@gvdpde,@gvdic,@gvdbc,t,z); sol1 = pdepe(m,@gvdpde,@gvdic,@gvdbc,t,z1); sol2 = pdepe(m,@gvdpde,@gvdic,@gvdbc,t,z2); % Extract the first solution component as u. u = sol(:,:,1); u1 = sol1(:,:,1); u2 = sol2(:,:,1);
% A surface plot is often a good way to study a solution. surf(t,z,abs(u2)); title('Numerical solution computed with 20 mesh points.'); xlabel('Time t'); ylabel('Distance z'); % A solution profile can also be illuminating. figure; plot(t,abs(u(end,:)),t,abs(u1(end,:)),t,abs(u2(end,:)),'LineWidth',2); legend('z<<Ld','z=Ld','z>Ld'); xlabel('Time t'); ylabel('Intensity'); grid on % --------------------------------------------------------------
Now in the next step i need to add 3'rd order flux term as shown in the snap
Is it possible to solve it using the same pdepe function. Can anyone give me an hint to solve this.
Awaiting your kind replies.
pa1

5 件のコメント

Torsten
Torsten 2017 年 7 月 14 日
編集済み: Torsten 2017 年 7 月 14 日
"pdepe" is designed to solve second-order time-dependent PDEs. If third-order derivatives are present in your equation, "pdepe" is not the appropriate tool to use (and MATLAB also does not offer another tool for this kind of PDE).
Best wishes
Torsten.
Pavan Kumar
Pavan Kumar 2017 年 7 月 14 日
Thanks Torsten for the reply..Can you suggest me any other tool.
Bill Greene
Bill Greene 2017 年 7 月 14 日
It is often possible to define new, intermediate variables to reduce the order of the dependent variables. Whether this is possible in your case depends on the boundary conditions, which you did not provide.
Pavan Kumar
Pavan Kumar 2017 年 7 月 14 日
I have mentioned the boundary condition in terms of pdepe bc format in the first pic.Will it be sufficient?
Torsten
Torsten 2017 年 7 月 14 日
Isn't it true that usually, the degree of the PDE in space determines the number of boundary conditions ? In this case, you had to supply three conditions.
Best wishes
Torsten.

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

回答 (0 件)

質問済み:

2017 年 7 月 14 日

コメント済み:

2017 年 7 月 14 日

Community Treasure Hunt

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

Start Hunting!

Translated by