Open gabriellemadden opened 4 years ago
Looking at the entire simulation, there are essentially two loops. The outer loop computes the next position of every point in the simulation (i.e., Unext
), and the inner loop makes a guess of Unext
, does the local/global solve with this guess, and uses the output of the global solve as the new guess of Unext
for the next iteration. Within each iteration of the inner loop, Ucur
and Uprev
don't change - they only change between iterations of the outer loop.
So we only have to write the inner loop, because Ucur and Uprev is passed in as const ?
Yes. The outer loop is handled for you in the main file.
How do the iterations work? Specifically, which positions are we supposed to be using in the global step? Currently I am doing: for 50 iterations ->find d vectors based on current p positions (local step) ->create y and b matrices based on current positions and previous positions ->solve for new positions ->update prev p to be current p ->update current p to be result of solve return next p as new current p
I'm unsure about updating and using the solved for positions in the next iteration. Is this what we are supposed to do or are we supposed to iterate over the values in Ucur and Uprev that are provided? I've followed everything else on the assignment specs very carefully but my animation for single spring converges (settles to rest) extremely quickly and for the horizontal chain it doesn't converge at all, just bounces very quickly.