FAQ  •  Login

Help-Newmark

Moderator: RaduS

<<

F13thibault.12

Newbie
Newbie

Posts: 27

Joined: Thu Aug 29, 2013 3:46 pm

Unread post Fri Nov 22, 2013 10:51 am

Help-Newmark

Hello Dr. Serban,

I cannot get the Quasi-Newton method to work. I think I need some clarification on what values go where...

-For the Approximate Jacobian, is that calculated once for the entire simulation? Or is it calculated once per timestep?
-In the residual (Psi-Omega), you show the LHS of that equation as [Psi;Omega]^(old), but you seem to indicate that values for q, qd, qdd, and lambda should be the NEW ones (t at n+1). So I don't understand if they should be q(n), qd(n), qdd(n), lambda(n), or q(n+1), qd(n+1), qdd(n+1), and lambda(n+1).

Basically, my code runs, but the solution explodes and is meaningless, and I am not able to locate my source of error, although I am on my second attempt to program the method.

Any tips would be helpful.

Thanks,

Matthew Thibault
<<

RaduS

Jr. Member
Jr. Member

Posts: 97

Joined: Wed Aug 14, 2013 3:08 pm

Unread post Fri Nov 22, 2013 3:33 pm

Re: Help-Newmark

Matthew,

When using an implicit integration method (Newmark in this case, but the same was true when using Backward Euler or BDF2 in the previous Matlab assignment), you must perform a Newton-Raphson (N-R) calculation at each time-step to calculate the states at the new time (tn+1). Therefore, you must iterate to obtain better and better approximations to qn+1, qdn+1, qddn+1, and ln+1.

So what N-R does is compute the following better and better approximations:
q0n+1 , qd0n+1 , qdd0n+1 , l0n+1 (initial guess for N-R, that is N-R iteration 0)
q1n+1 , qd1n+1 , qdd1n+1 , l1n+1 (N-R iteration 1)
q2n+1 , qd2n+1 , qdd2n+1 , l2n+1 (N-R iteration 2)
... (etc. until you decide that N-R has converged)

As you can see, it's all about quantities at time tn+1. The quantities at time tn were already calculated and we're done with them by this time. Their only "use" at time tn+1 is to provide the initial guess for N-R. In other words, we set:
qdd0n+1 = qddn
l0n+1 = ln
(then, using the Newmark integration formulas, we can also evaluate q0n+1 and qd0n+1 and so we can start the N-R iterations.)

Bottom line: "old" and "new" in the lecture notes refer to two successive N-R approximations to these quantities. In other words, as an example, when I say qold this really means qoldn+1.

The Jacobian should be recalculated at each time-step but you do have two options:
  1. only evaluate it once per time-step, at the first iteration of the N-R loop. This means, evaluate it using q0n+1 and then reuse it for all subsequent N-R iterations until you're done calculating the quantities at time tn+1. But when you move on to time tn+2 you'll have to re-evaluate the Jacobian again.
  2. evaluate it multiple times per time-step, namely at each iteration of the N-R loop. This means, evaluate it continuously, using qoldn+1, i.e., the previous N-R approximation to qn+1.
For efficiency reasons, I suggest you use the first option above.

On the other hand, the residual vector (i.e., the RHS in the linear system used within N-R to calculate the correction) must use the values at the previous N-R iteration, that is it must be based on qoldn+1, qdoldn+1, qddoldn+1, and loldn+1.


Hope that this clarifies things.

Good luck,
-Radu
<<

F13thibault.12

Newbie
Newbie

Posts: 27

Joined: Thu Aug 29, 2013 3:46 pm

Unread post Fri Nov 22, 2013 5:41 pm

Re: Help-Newmark

Hi Dr. Serban,

I still can't get the code to work.

-If the Error is greater than the norm of my correction, what do I tell my code to do?
-If the Error is less than the norm, what do I tell the code to do?
-Do I update QA (applied forces) at every iteration?
-Does QA get evaluated at the old q,qd,t values before use in the Residual?

I am just really struggling to update the correct things in the correct places.

Thanks,

Matthew
<<

F13thibault.12

Newbie
Newbie

Posts: 27

Joined: Thu Aug 29, 2013 3:46 pm

Unread post Fri Nov 22, 2013 6:04 pm

Re: Help-Newmark

Just had a realization (in the form of another question).

Where does time 't' come into play? In kinematics, we had driving functions where a driver was a function of time explicitly. Now I can't think of how anything changes in time. I know it should, obviously. But that's why my current code tells me nothing is changing in time.

Any suggestions?

Thanks,

Matthew
<<

RaduS

Jr. Member
Jr. Member

Posts: 97

Joined: Wed Aug 14, 2013 3:08 pm

Unread post Fri Nov 22, 2013 8:01 pm

Re: Help-Newmark

F13thibault.12 wrote:Just had a realization (in the form of another question).

Where does time 't' come into play? In kinematics, we had driving functions where a driver was a function of time explicitly. Now I can't think of how anything changes in time. I know it should, obviously. But that's why my current code tells me nothing is changing in time.

Any suggestions?

Thanks,

Matthew


You do not need an explicit dependency on time to have things "changing in time". Think back to the IVP you had to solve for last assignment:
y' = sin(y)
y(0) = 1
There is no explicit time dependency and yet y(t) is not a constant. The dependency on time may be only implicit (we are solving time differential equations -- the derivatives themselves give us this dependency)

-Radu
<<

RaduS

Jr. Member
Jr. Member

Posts: 97

Joined: Wed Aug 14, 2013 3:08 pm

Unread post Fri Nov 22, 2013 8:20 pm

Re: Help-Newmark

Matthew,

F13thibault.12 wrote:-If the Error is greater than the norm of my correction, what do I tell my code to do?
-If the Error is less than the norm, what do I tell the code to do?

I am not sure what you mean by "error" in this context. Do you mean "tolerance"? (Note that, technically, the norm of the correction is the current error that you are making).

In principle, this is no different than what you had to do in Kinematics for position analysis: you continue the Newton-Raphson iterations for as long as the norm of the correction is larger than the tolerance you prescribed (by the way, what tolerance do you use? I suggest using something between 10-8 and 10-6.)

In other words, if the norm of the correction is larger than the tolerance, you go back and perform another iteration of the N-R process. When the norm of the correction gets below the tolerance, you declare that N-R converged and whatever values you had for the "new" states (q, qd, qdd, lambda) represent the solution at time tn+1.

F13thibault.12 wrote:-Do I update QA (applied forces) at every iteration?
-Does QA get evaluated at the old q,qd,t values before use in the Residual?

I am just really struggling to update the correct things in the correct places.

Yes, you must update QA at every N-R iteration (same for everything else that makes up the residual vector).
Yes, you must evaluate QA at the "old" values of q and qd (this really means, at the values qoldn+1 and qdoldn+1; see my previous posting).

Finally, you must realize that during the N-R loop, time stays fixed at the value tn+1.

-Radu

Return to ME451 Fall 2013: Kinematics and Dynamics of Machine Systems

Who is online

Users browsing this forum: No registered users and 1 guest

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software.