Vous êtes sur la page 1sur 2

Solution of the PDE equation

Here I have taken variable u in place of C and variable x in place of eta. Matlab M- file for main equation:
function [c,f,s] = f(x,t,u,DuDx) sc = 7; c = 1; f = 4/sc*DuDx; s = 4; end %Matlab M-file for initial condition: function u0 = finit(x) u0 = 0; end %Matlab M-file for Boundary conditions: function [pl,ql,pr,qr] = fbound(xl,xr,ul,ur,t) omega = 3; pl = ul; ql = -(exp(i* omega*t)); pr = ur; qr = 0; end To execute the program: Clear all; m = 0; x = (0,1,20); t = (0,1,10); sol = pdepe(m,@f,@finit,@fbound,x,t); u = sol(:,:,1); plot(x,u); title('plot between x and u') xlabel('x component eta') ylabel ('y component is c')

Note1: In the main equation program the value of sc can be changed accordingly. Note2: In boundary condition program, I have approximated the value of omega which can be changed.The value of time t can be included if necessary. Note 3: In the executable code, the value of x and t can be varied.

Note 4: rest of the variations can be done according to the values given in paper. This is only basic idea of this equation. Plot of above code is given below:

The graph can be changed by varying appropiately the values of x,t,sc,omega.

Vous aimerez peut-être aussi