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 Comments

Torsten
Torsten on 14 Jul 2017
Edited: Torsten on 14 Jul 2017
"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.
Thanks Torsten for the reply..Can you suggest me any other tool.
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.
I have mentioned the boundary condition in terms of pdepe bc format in the first pic.Will it be sufficient?
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.

Sign in to comment.

Answers (0)

Asked:

on 14 Jul 2017

Commented:

on 14 Jul 2017

Community Treasure Hunt

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

Start Hunting!