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

Matlab programming, How can I separate a row vector into groups.

How can I separate a row vector into groups.

Finding a given number is odd or even in array, to find given number is odd...

to find given number is odd or even in an array with explanation and flow chart

Illustration to logical function , Illustration to logical function: I...

Illustration to logical function: In addition to such logical operators, the MATLAB also has a function xor, that is the exclusive or function. It returns the logical true if

Switch statement, The Switch Statement: A switch statement can frequen...

The Switch Statement: A switch statement can frequently used in place of a nested if-else or an if statement with numerous else if clauses. The Switch statements are used when

Simulation of a transmission system, Simulation of a transmission system wi...

Simulation of a transmission system with a 4-fsk modulation scheme; using non-coherent detection method and an awgn channel. System description: 1. Input: A. Random binary

Example of variable names, Example of variable names: If nothing appea...

Example of variable names: If nothing appears when, who or whose is entered, which means there aren't any variables! For illustration, in the starting of a MATLAB session, the

Example of hold and legend function, Example of Hold and legend function: ...

Example of Hold and legend function: Running this script will generate two individual figure windows. If there is not any other active figure window, the first, that is the ba

Discuss the frequency range and radiation angles, Discuss the frequency ran...

Discuss the frequency range / radiation angles at which the two models diverge, and relate this divergence to your understanding of the behaviour of a pistonic source. Compare t

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