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

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

Analytical solution and numerical solution, using 0de 45 how can i get the ...

using 0de 45 how can i get the anlytical and numerical solutions for an equation,,

Beam steering, Some recent column source designs incorporate ‘beam steering...

Some recent column source designs incorporate ‘beam steering', where the phase of each element in the column is varied in order to change the angle at which the major lobe appears.

Portfolio selection problem, An individual with $10,000 to invest has ident...

An individual with $10,000 to invest has identi?ed three mutual funds as attractive opportunities. Over the last ?ve years, dividend payments (in cents per dollar invested) have be

Write MATLAB scripts for the following:, To accept two numbers from the use...

To accept two numbers from the user; Display all prime numbers between these two numbers.

Solve the system of linear equations - matlab, Problem 1.  Use Matlab to so...

Problem 1.  Use Matlab to solve the following system of linear equations: 2x + y + 3z = 1 2x + 6y + 8z = 3 6x + 8y + 18z = 5 Capture Matlab code and the result in a text fi

Obtain the input - algorithms, Obtain the input - Algorithms: From whe...

Obtain the input - Algorithms: From where does the input come? The two possible choices would be from an external file on a disk, or from the user, who enters the number by ty

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