Need help initializing a PDE boundary condition
Show older comments
I'm working with the heat equation (PDE), and I'm unsure how to set up my boundary conditions in a Matlab script. I need to initialize the boundary condition U(x=0) = t(6-t)
equation %(U*x-1-2U*x+U*x+1)/(x^2)
dt = 0.01; % time step dx = 0.01; % distance step K=0.002; % the constant value
%initialize vectors for distances 0 to 5 and time 0 to 20 time = 0:dt:20; t = length(time); x = 0:dx:5; row = length(t); col = length(x);
% Initialize temperature array U = zeros(row,col);
initialize the surface boundary condition U(x=0) = t(6-t)
Answers (0)
Categories
Find more on Heat Transfer in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!