Solution by using pdepe function, MATLAB Programming

Assignment Help:

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.


Related Discussions:- Solution by using pdepe function

#GUI, #create a matlab GUI for designing common emitter amplifier which pro...

#create a matlab GUI for designing common emitter amplifier which produces AC load lines based on the component values

Algorithms, Algorithms: Before writing any computer program, it is ver...

Algorithms: Before writing any computer program, it is very useful to first outline the steps which will be essential. An algorithm is the series of steps required to solve a

Illustrations of calling the function, Illustrations of calling the functio...

Illustrations of calling the function: Here are illustrations of calling the function: >> cylcost(32,73,4.50) ans = 661.5000 >> fprintf('The cost would be $%.2f\n'

Error-checking user input in the while loop, Error-Checking user input in t...

Error-Checking user input in the While Loop: In many applications, whenever the user is prompted to enter anything, there is a valid range of values. When the user enters a wr

Program for add sinusoid with frequency, Job: Add sinusoid with frequency 1...

Job: Add sinusoid with frequency 1000 Hz and amplitude 100 to the one generated in Job 1 (: Create a function using mat lab to generate a sinusoidal signal. The parameters of the s

Write m-function that computes simple returns as formula, Your Task: Write ...

Your Task: Write an M-function that computes simple returns as formula (1). Use this function to calculate the daily returns for each index. Using MATLAB build-in functions estimat

1, #quest121ion..

#quest121ion..

College algebra, #question how to solve radicals exponents..

#question how to solve radicals exponents..

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd