## Assignment 11

A place for Hw11 questions

### Re: Assignment 11

When setting up problem 3, are we solving a set of differential equations where we are looking for x and v?

i.e. do we set the problem up like this (using backward euler)

vn = vn-1 + h*an

xn = xn-1 + h*vn-1 + h^2*an

where an is the acceleration in terms of vn and xn.

If so, then for some reason when I attempt to solve the system using fsolve, it tells me that it can't find a solution and the plot looks horrible.

i.e. do we set the problem up like this (using backward euler)

vn = vn-1 + h*an

xn = xn-1 + h*vn-1 + h^2*an

where an is the acceleration in terms of vn and xn.

If so, then for some reason when I attempt to solve the system using fsolve, it tells me that it can't find a solution and the plot looks horrible.

### Re: Assignment 11

I used Dan's m-file called massSpringDamperNR.m file to solve for four points (this is the BDF method of order 1 used in order to prime the BDF method of order 3).

Using these three points, you can calculate the Cnx and Cnv values that you found in Problem 2 for a system of order 3. Using these values along with the acceleration, step Size, and beta term, you can calculate the new value of velocity and then the new value of position. With these new velocities you can then enter into the BDF solver to solve for a_n.

Remember your psivalue in the BDF solver of order 3 will include a Beta term (this is not included in the m-file of Dan's because that is of 1st order and the beta value is just 1).

Using these three points, you can calculate the Cnx and Cnv values that you found in Problem 2 for a system of order 3. Using these values along with the acceleration, step Size, and beta term, you can calculate the new value of velocity and then the new value of position. With these new velocities you can then enter into the BDF solver to solve for a_n.

Remember your psivalue in the BDF solver of order 3 will include a Beta term (this is not included in the m-file of Dan's because that is of 1st order and the beta value is just 1).

### Re: Assignment 11

In the 'massSpringDamperNR.m'

% Save initial conditions

crntStep = 1;

posVec(crntStep,1) = x_old;

velVec(crntStep,1) = v_old;

accVec(crntStep,1) = (sin(2*crntTime) - c*v_old*v_old - k*x_old^1.5)/m;

I think accVec(crntStep,1) = (sin(2*crntTime) - c*v_old^3 - k*x_old^3)/m is right expression, isnt it?

% Save initial conditions

crntStep = 1;

posVec(crntStep,1) = x_old;

velVec(crntStep,1) = v_old;

accVec(crntStep,1) = (sin(2*crntTime) - c*v_old*v_old - k*x_old^1.5)/m;

I think accVec(crntStep,1) = (sin(2*crntTime) - c*v_old^3 - k*x_old^3)/m is right expression, isnt it?

### Re: Assignment 11

yes, that's the correct value.

There is some history behind that. I started with a different mass-spring-damper system (that looked just like what you asked me about). Yet that system was unstable (positive feedback) from a physical perspective (not numerical one).

so i changed everything to reflect the new mass-spring-damper. It looks i missed a couple of spots, for which i apologize.

dan

There is some history behind that. I started with a different mass-spring-damper system (that looked just like what you asked me about). Yet that system was unstable (positive feedback) from a physical perspective (not numerical one).

so i changed everything to reflect the new mass-spring-damper. It looks i missed a couple of spots, for which i apologize.

dan

Last edited by Anonymous on Wed Apr 14, 2010 6:31 am, edited 1 time in total.

### Re: Assignment 11

It is super important to make sure that your gamma hat is calculated as 1/2*p'*'-1/2. I had mine calculated as p'*p-1 and this prohibited my solver from converging. I don't really quite understand why, but it has something to do with how the partial derivative is taken and how it affects the symmetry of the psi matrix.

### Re: Assignment 11

Christopher - do you mean phi_superscript_p aka your normalization constraint?...not gamma hat?

### Re: Assignment 11

Rob Bradford wrote:Christopher - do you mean phi_superscript_p aka your normalization constraint?...not gamma hat?

Yes, phi_superscript_p.

8 posts
• Page

**1**of**1**Return to ME751 Spring 2010: Advanced Computational Multibody Dynamics

### Who is online

Users browsing this forum: No registered users and 1 guest