Hi all,
The code below calculates the dx/dt=u equation by euler method. This calculates the u for the position of each particles (np) and calculates the distance of particles (dist) (until now the code below which is a part of big code correct). My teacher told me by using for loop make this in 2 dimension? would you please tell me how?
I mean do the calculations and build a two dimentional array
such as : in line 22: double x[n][2], u[n][2];
Sorry I just thought it might be old and no one reply to it
It was not terribly old yet. More importantly, it was you who did not reply to it.
Yes, your code has blatant errors but I don't feel like pointing them out before you explain in detail what the program supposedly does. Assume that we have never heard about "euler".