Project 3.1b: Useful thing to know

30 views
Skip to first unread message

CM

unread,
Oct 10, 2017, 12:21:22 PM10/10/17
to comphys
Depending on how your code is set up, it may look like a good idea to record the drag-force arrow axis vectors inside the Lin_drag function.  It is not. RK4 calls Lin_drag 4 times, and if you are recording a drag vector each time, you will wind up with 4x as many as you expect.
 
If you have done all calculations before animating, this can manifest as a drag vector that is still pointing downwards when the ball is falling, even though it should be pointing upwards.  If you are calculating and animating at the same time, some other weirdness may crop up.

Best to calculate the drag-force arrow axis vectors separately from Lin_drag.

Jay Wang

unread,
Oct 10, 2017, 3:32:42 PM10/10/17
to comphys
One should always animate objects apart from the core functions like you said.

It's best to animate in the main program as the simulation progresses. What weird things were you referring to?

Caroline F Mallary

unread,
Oct 10, 2017, 3:43:50 PM10/10/17
to Jay Wang, comphys

Specifically, I was winding up with an array of axis vectors that was 4x as long as the frame count (336 axis vectors vs 84 frames)  So drawing frame 80 and axis vector 80 at the same time would lead to an axis vector that was only about 1/4 of the way into its progression; i.e. still pointing mostly downward.


What is the advantage of simming and animating at the same time?  Isn't that more likely to result in a laggy animation (at least for complicated sims)?


From: com...@googlegroups.com <com...@googlegroups.com> on behalf of Jay Wang <umd...@gmail.com>
Sent: Tuesday, October 10, 2017 3:32:42 PM
To: comphys
Subject: Re: Project 3.1b: Useful thing to know
 
One should always animate objects apart from the core functions like you said.

It's best to animate in the main program as the simulation progresses. What weird things were you referring to?

--
You received this message because you are subscribed to the Google Groups "comphys" group.
To unsubscribe from this group and stop receiving emails from it, send an email to comphys+u...@googlegroups.com.
To post to this group, send email to com...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/comphys/1983ef5e-20be-46b9-bbfd-044cd69eaa92%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

CM

unread,
Oct 10, 2017, 4:41:06 PM10/10/17
to comphys
Specifically, I was winding up with an array of axis vectors that was 4x as long as the frame count (336 axis vectors vs 84 frames)  So drawing frame 80 and axis vector 80 at the same time would lead to an axis vector that was only about 1/4 of the way into its progression; i.e. still pointing mostly downward.

What is the advantage of simming and animating at the same time?  I know that storing the values uses memory, but isn't real-time calculation more likely to result in a laggy animation (at least for complicated sims and/or animations)?

Jay Wang

unread,
Oct 10, 2017, 4:58:04 PM10/10/17
to comphys
Normally one would want to show animation in real time. It won't be laggy for simple problems like this one. But if it's computation intensive, one would want to do it your way, i.e., produce data, then animate it.
Reply all
Reply to author
Forward
0 new messages