MATLAB Answers

how can i solve this proplem by rung-kutta method ?

1 view (last 30 days)
Mohammad Adeeb
Mohammad Adeeb on 20 Nov 2018
this is my sol form
x = linspace(0,1,20);
t = linspace(0,2,5);
function [c,f,s] = pdex1pde(x,t,T,DuDx);
c = 1;
f = DTDx-4;
s = 0;
end;
function u0 = pdex1ic(x)
u0 = 0;
end;
function [pl,ql;pr;qr] = pdex1bc(xl,ul,xr,ur,t);
T0 = 418.5;
pl = Tl;
ql = 0;
pr = 1;
qr = 1;
end;
m = 1;
sol = pdepe(m,@pdex1pde,@pdex1ic,@pdex1bc,x,t);
u = sol(:,:,1);
surf(x,t,T);
title('Numerical solution computed with 20 mesh points');
xlabel('شDistance x');
ylabel('Time t');
figure;
plot(x,T(end,:));
title('Solution at t = 2');
xlabel('Distance x');
ylabel('T(x,2)');

Answers (0)

Tags

Products

Community Treasure Hunt

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

Start Hunting!