solution by using pdepe functionfunctionpdex1m


Solution by using pdepe function

functionpdex1

m = 0;

x = linspace(0,1,100);

t = linspace(0,0.2,10);

 

sol = pdepe(m,@pdex1pde,@pdex1ic,@pdex1bc,x,t);

% Extract the first solution component as u.

u = sol(:,:,1);

 

% A surface plot is often a good way to study a solution.

surf(x,t,u)

title('Heat Equation solution by using pdepe function')

xlabel('Distance x')

ylabel('Time t')

 

% --------------------------------------------------------------

function [c,f,s] = pdex1pde(x,t,u,DuDx)

c = 1;

f = DuDx;

s = cos(500*t);

% --------------------------------------------------------------

functionu0 = pdex1ic(x)

u0 = sin(pi*x);

% --------------------------------------------------------------

function [pl,ql,pr,qr] = pdex1bc(xl,ul,xr,ur,t)

pl = ul;

ql = 0;

pr = ur;

qr = 0;

I have implemented other solution for the same problem by using the pdepe solver.What I need from you is to modify the code so it will tell me the temperature at specific distance ( just like the first code )and the output must a number that will tell me the temperature at that location.

Request for Solution File

Ask an Expert for Answer!!
Applications of MATLAB: solution by using pdepe functionfunctionpdex1m
Reference No:- TGS0333262

Expected delivery within 24 Hours