Solving differential equation using ode45

looking to solve this problem using the function ode45

6 Comments

What are mu, mut, V, h, xi, u ? Your problem statement is much too weird to be answered.
This was the problem provided
Torsten
Torsten on 8 May 2023
Edited: Torsten on 8 May 2023
And do you understand what you are supposed to do ?
I have the feeling that mu/mut means d/dt and mu^2/Vx^2 means d^2/dx^2.
But what are h(xi) and u(t) ? These functions must be defined somewhere in your assignment.
When you have found them, I suggest you start solving your equation with MATLAB's "pdepe" (at least to get a reference solution).
No I don't understand what I'm supposed to do.
u(t) =1 and h(x) = 0.1 if , 0.4 <= x <= 0.6 and h(x)=0 otherwise
thanks
And what are the x-coordinates of the left and right end of the rod ?

Sign in to comment.

Answers (1)

Here is the solution of your problem for reference:
x = linspace(0,1,25);
t = linspace(0,2.5,25);
m = 0;
sol = pdepe(m,@heatcyl,@heatic,@heatbc,x,t);
u = sol(:,:,1);
plot(x,[u(5,:);u(10,:);u(20,:);u(25,:)])
function [c,f,s] = heatcyl(x,t,u,dudx)
u = @(t) 1;
h = @(x) 0.1*(x >=0.4 & x <= 0.6);
c = 1;
f = dudx;
s = h(x)*u(t);
end
%----------------------------------------------
function u0 = heatic(x)
u0 = 0;
end
%----------------------------------------------
function [pl,ql,pr,qr] = heatbc(xl,ul,xr,ur,t)
pl = ul; %ignored by solver since m=1
ql = 0; %ignored by solver since m=1
pr = 0;
qr = 1;
end
%----------------------------------------------

Categories

Find more on Mathematics in Help Center and File Exchange

Asked:

on 8 May 2023

Moved:

on 9 May 2023

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!