clear all; clc; clf;
Nx=10;
x=linspace(0,1,Nx); h=x(2)-x(1);
u(1:Nx,1)=sin(pi*x);
dt=1/200;
for n=1:100
for i=2:Nx-1
u(i,n+1)=u(i,n)+dt/h^2*(u(i-1,n)-2*u(i,n)+u(i+1,n));
end
end
figure(1); clf; hold on;
plot(x,u);
제목 | #1 계산금융 과제 제출합니다. |
---|---|
내용 |
plot(x,u); |
첨부 |
homework20170303.zip
|