Need help initializing a PDE boundary condition
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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)
0 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Geometry and Mesh finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!