logo

SOLUTION OF PARTIAL DIFFERENTIAL EQUATIONS BY FINITE DIFFERENCES

   

Added on  2023-01-23

10 Pages1396 Words83 Views
Running head: PARTIAL DIFFERENTIAL EQUATIONS
PARTIAL DIFFERENTIAL EQUATIONS
Name of the Student
Name of the University
Author Note
SOLUTION OF PARTIAL DIFFERENTIAL EQUATIONS BY FINITE DIFFERENCES_1
1SOLUTION OF PARTIAL DIFFERENTIAL EQUATIONS BY FINITE DIFFERENCES
3.1:
u
t =2 x +1+ 2 u
x2 , -1<= x <= 1.5
Initial conditions:
u(x,0) = -x^3/3 + x^2/2 –x/6 -1, -1<= x <= 1.5
Boundary conditions:
u(-1,t) = 0, u(1.5,t) = -5/4
c = 1, f = x + u/x, s = 2x
MATLAB code using built-in pdepe function:
xmesh = -1:0.1:1.5;
timespan = 0:0.045:1.5;
sol = pdepe(0,@mypde_description,@mypde_ic,@mypde_bc,xmesh,timespan);
surf(xmesh,timespan,sol)
xlabel('distance x')
ylabel('time t in sec')
zlabel('solution u(x,t)')
title('Numerial solution computed at [x,t] grid')
SOLUTION OF PARTIAL DIFFERENTIAL EQUATIONS BY FINITE DIFFERENCES_2
2SOLUTION OF PARTIAL DIFFERENTIAL EQUATIONS BY FINITE DIFFERENCES
% defining pde function
function [c,f,s] = mypde_description(x,t,u,dudx)
c=1;
f=x+dudx;
s=2*x;
end
% applying initial condition
function u0 = mypde_ic(x)
u0=-x^3/3 + x^2/2 -x/6 - 1;
end
% applying boundary conditions
function [pl,ql,pr,qr] = mypde_bc(xl,ul,xr,ur,t)
pl = ul;
ql=0;
pr = ur+(5/4);
qr=0;
SOLUTION OF PARTIAL DIFFERENTIAL EQUATIONS BY FINITE DIFFERENCES_3

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Solutions to Maths Assignment
|7
|664
|60

M345N10 Maths Matlab Assignment 2022
|12
|2842
|15

Physics Solution of Distance Travelled
|11
|1329
|40

Computational Fluid Dynamics
|13
|1722
|87

Advanced Thermal and Fluid Engineering
|16
|2365
|66

Computational Fluid Dynamics
|19
|3639
|50