I tried to solve this equation y''=a,y(0)=0,y(1)=0 in matlab and i wrote this code: T=1000; >> dt=.01; >> N=round(T/dt)+1; >> t=(0:dt:T); >> a=.01; >> >> >> >> y(1)=.25; >> y(2)=1; >> >> for i=2:N-1;
y(i+1)=2*y(i)-y(i-1)+a*dt^2; end
Now i want to solve the equation y''=a,y'(0)=0,y(1)=0
What is the difference when i will write the matlab's code?????
Best Answer