Dear Friends,
Would you please tell me why in the output of my code instead of t=0, it starts with t=69.09? I want to get the acc function values between t=0 and t=1 with constant time step 0.01
It should work fine as you posted (and it does on all online compilers)
However you have several flaws in logic: for (t=0; t*dt<=1; t+=dt) Now it calculates values up to t = 100. I think you mean t < 1 cout<<"t="<<t<<"\t"<<"t+dt="<<t+dt<<"\t"<<cout<<"acc="<< acc(t+dt)<<"\n";