FAQ  •  Login

Project 2

Moderator: RaduS

<<

RaduS

Jr. Member
Jr. Member

Posts: 97

Joined: Wed Aug 14, 2013 3:08 pm

Unread post Fri Nov 22, 2013 2:32 pm

Project 2

Note that I have updated the PDF with the assignment for Project 2 on the SBEL class webpage, at
http://sbel.wisc.edu/Courses/ME451/2013/Assignments/Project_II.pdf

In particular, I fixed the "hint" on how to deal with the more complicated concentrated force that the model in this assignment requires. While you are free to come up with your own solution to this problem, I suggest you introduce a new type of force element, namely a PointForceFile, which defines a concentrated force acting at a particular point on one of the bodies in the system and whose actual value is obtained by invoking an m-function defined in a separate file.

If you do implement this new type of force element, here's how you can invoke the m-function when you need to evaluate the corresponding generalized force:
  Code:
% ...

% string containing the name of the m-function to be invoked
% note that the actual value of this string is whatever you read from the ADM file
mfunction = 'my_force';

% current time (just an example)
t = 3.01;

% current generalized coordinates for the body on which this force acts (just an example)
qi = [1.3; -0.4; 1.25];

% current generalized velocities for the body on which this force acts (just an example)
qdi = [10.4; 0.5; -1.25];

% create a string which contains how you would invoke the function
% NOTE:  there should be no space between '%' and 's' below (forum will not let me use the correct syntax)
fstr = sprintf('% s(t, qi, qdi)', mfunction);

% at this point, 'fstr' should be the string 'my_force(t, qi, qdi)'

% actually invoke the m-function to calculate F
% NOTE: 'evl' misspelled below (forum will not accept the actual matlab function name which
% should include 'a' between 'v' and 'l')
F = evl(fstr);

% proceed as before to obtain the corresponding generalized force
% (i.e., do what you're already doing for a regular PointForce element)

% ...


-Radu
<<

F13bdegner

Newbie
Newbie

Posts: 24

Joined: Thu Aug 29, 2013 3:46 pm

Unread post Sat Nov 23, 2013 10:36 pm

Re: Project 2

Radu

In the Project II directions, you state:

"I will unzip the file, start MATLAB from within the directory lastNameProject2, and type:
>> simEngine2D(slidercrank)"

Am I missing something or should this be:
>> simEngine2D('slidercrank')
as a string input?

-Brandon
<<

RaduS

Jr. Member
Jr. Member

Posts: 97

Joined: Wed Aug 14, 2013 3:08 pm

Unread post Sun Nov 24, 2013 3:32 pm

Re: Project 2

F13bdegner wrote:Am I missing something or should this be:
>> simEngine2D('slidercrank')
as a string input?


You are correct, the name of the model should be passed as a Matlab string.

Thanks,
-Radu
<<

f13-759-parthiban

Newbie
Newbie

Posts: 8

Joined: Mon Sep 09, 2013 9:12 am

Unread post Sun Nov 24, 2013 7:06 pm

Re: Project 2

Hi Prof. Serban,

In fig. 8.2.3 i see that the reference frames chosen are not centroidal! Is it ok to assume centroidal frames and then calculate later the respective position and velocities for the points asked?

1. In the last project while setting up the ADM file and the simengine2D i had two assumptions - The reference frames are always centroidal and i dont explicitly add the gravitational forces as point forces in the "forces" struct in the adm file. This was because while setting up the Qa matrix by parsing the forces structs there was no way to know if the point force described was a force due to gravity so that it can be multiplied with the respective body mass! (in the HW 8 pdf - the point forces funY just said -9.81 which is just the accln. To get the force it needed to be multiplied by the mass. But again how do we make it generalized?).

2. Also does the selection of the reference frames change jbar?

Thanks,
Chembian
Chembian
<<

RaduS

Jr. Member
Jr. Member

Posts: 97

Joined: Wed Aug 14, 2013 3:08 pm

Unread post Sun Nov 24, 2013 8:29 pm

Re: Project 2

Chembian,

As specified in the 2nd paragraph of section 8.2.1, the reference frames (as shown in Fig. 5.2.1) are assumed to be centroidal (this just means that the shape of the bodies is not a simple link connecting the joint locations).

Both assumptions you made for your simEngine2D are fine.

You should always include the body weights among the applied forces when you perform dynamic analysis. The value of the gravitational acceleration (as a 2D vector) is specified in the ADM file (for the entire model). This provides complete generality (including the case g=[0;0]).

The selection of the LRF would certainly change J'. But for the problem at hand, these values are given to you (with respect to the centroidal frames in Fig. 5.2.1).

-Radu
<<

f13wchoi26

Newbie
Newbie

Posts: 15

Joined: Wed Sep 04, 2013 3:47 pm

Unread post Mon Nov 25, 2013 8:56 am

Re: Project 2

Radu,

I have a question about the unit of the applied point force unit. In the book, the unit is N*10e-5, but my result gave me N*10e^5. 10e10 order different. The following units (from the graphs from the textbook) regarding Force are all 10^-5. Could you verify this?

WoongJo Choi
WoongJo Choi
<<

RaduS

Jr. Member
Jr. Member

Posts: 97

Joined: Wed Aug 14, 2013 3:08 pm

Unread post Mon Nov 25, 2013 9:18 am

Re: Project 2

f13wchoi26 wrote:Radu,

I have a question about the unit of the applied point force unit. In the book, the unit is N*10e-5, but my result gave me N*10e^5. 10e10 order different. The following units (from the graphs from the textbook) regarding Force are all 10^-5. Could you verify this?

WoongJo Choi


WoongJo,

Assuming you are talking about Fig. 8.2.2, you may just be reading it incorrectly. What the notation used there means is that the values of the force are of the order of 105; in particular, at x3=5, Fc=-220,000 N. (Such notation indicates that what is actually plotted is Fc/10,000).

-Radu
<<

f13wchoi26

Newbie
Newbie

Posts: 15

Joined: Wed Sep 04, 2013 3:47 pm

Unread post Mon Nov 25, 2013 9:37 am

Re: Project 2

RaduS wrote:
f13wchoi26 wrote:Radu,

I have a question about the unit of the applied point force unit. In the book, the unit is N*10e-5, but my result gave me N*10e^5. 10e10 order different. The following units (from the graphs from the textbook) regarding Force are all 10^-5. Could you verify this?

WoongJo Choi


WoongJo,

Assuming you are talking about Fig. 8.2.2, you may just be reading it incorrectly. What the notation used there means is that the values of the force are of the order of 105; in particular, at x3=5, Fc=-220,000 N. (Such notation indicates that what is actually plotted is Fc/10,000).

-Radu


Thanks, It is clear now.

Woongjo Choi
WoongJo Choi
<<

f13wchoi26

Newbie
Newbie

Posts: 15

Joined: Wed Sep 04, 2013 3:47 pm

Unread post Mon Nov 25, 2013 3:34 pm

Re: Project 2

Hi, Radu

Two questions

1. at the MATLAB prompt, do we expect the filename is inside of quotes(' '). Last project, there was quotes for the filename. Will the function be called as simEngine2D('slidercrank') or simEngine2D(slidercrank)

2. in subsection 8.2.4. It says "with gravitational force acting in the positive x direction, however, the description PDF says the gravity act (negative y direction). what do you mean by "Negative y direction"?

WoongJo Choi
WoongJo Choi
<<

RaduS

Jr. Member
Jr. Member

Posts: 97

Joined: Wed Aug 14, 2013 3:08 pm

Unread post Mon Nov 25, 2013 5:20 pm

Re: Project 2

WoongJo,

  1. the model name should be enclosed in quotes
  2. you are correct, for dynamic analysis, the problem states that gravity acts in the positive x direction.

I have updated the assignment PDF to reflect both issues.

Thanks,
-Radu
<<

F13bdegner

Newbie
Newbie

Posts: 24

Joined: Thu Aug 29, 2013 3:46 pm

Unread post Mon Nov 25, 2013 6:43 pm

Re: Project 2

Radu

2 questions:

When using the gas force function as described in the book with a mass moment of inertia of 450 m^2/kg my code fails. If I change the stipulation in the piecewise function from 1.5<=x_3<=5 to 1.49<=x_3<=5, the function works and the simEng2D produces what appear to be correct position, velocity, and acceleration plots. Is it possible that matlab might be rounding some numbers to the point that the bounds of the piecewise function are being exceeded?

Does obtaining a correct acceleration imply that we are obtaining the correct values for the lagrange multipliers?

-Brandon
<<

RaduS

Jr. Member
Jr. Member

Posts: 97

Joined: Wed Aug 14, 2013 3:08 pm

Unread post Mon Nov 25, 2013 7:36 pm

Re: Project 2

Here's what I suspect is going on: if we were able to solve the EOM exactly, the x position of the slider body should always be 1.5 <= x3 <= 5.5. However, we are solving the EOM numerically and therefore approximately (recall the two types of errors we discussed: truncation and round-off). So it is possible to see values for x3 that are very close to 1.5, but just below that value. So my question is this: do you make sure that the piston force you calculate for such a value of x3 is 0? Note that you should also ensure that the force is 0 if x3>5.5.

As for your second question the answer is yes: in principle, since during the Newmark implicit integration you solve simultaneously for accelerations and Lagrange multipliers, you either get both right or both wrong. Having said that, anything is possible!

-Radu
<<

f13dfarley

Newbie
Newbie

Posts: 12

Joined: Wed Sep 04, 2013 3:47 pm

Unread post Tue Nov 26, 2013 1:34 pm

Re: Project 2

In case anyone was wondering, I was able to clarify with Radu that the output file ('sliderCrank.res') should include results from the simulation run with a flywheel inertia of 450 kg-m^2.

-Danny
<<

F13thibault.12

Newbie
Newbie

Posts: 27

Joined: Thu Aug 29, 2013 3:46 pm

Unread post Wed Nov 27, 2013 10:13 am

Re: Project 2

Hello Dr. Serban,

I am having troubleshooting issues. I have attached my current outputs for Body 1 (flywheel) Angular Velocity, and Reaction Torque at Joint 1. These were calculated with J1 = 225 kg-m^2. There is an instability at the beginning of the angular velocity (it oscillates much like a transient response) and does not quite go to 0 later in time. The reaction torque at joint 1 (Body 1 with ground) is fine (equals 0) until the time when Body 1 angular velocity bottoms out. Then the reaction torque does crazy things.

Anyway, I have been working this issue for probably 6 hours or more, and can't seem to nail down the error. Do you have any suggestions for what my error might be?

Is it possible the problem is too stiff?

Thanks,

Matthew Thibault
Thibault_Project2_AVelBody1.jpg
Thibault_Project2_AVelBody1.jpg (33.35 KiB) Viewed 6983 times
Thibault_Project2_RxnTq_Joint1.jpg
Thibault_Project2_RxnTq_Joint1.jpg (21.71 KiB) Viewed 6983 times
<<

RaduS

Jr. Member
Jr. Member

Posts: 97

Joined: Wed Aug 14, 2013 3:08 pm

Unread post Wed Nov 27, 2013 11:17 am

Re: Project 2

Matthew,

You should first work with the case where J1=450. As discussed in the textbook, the case J1=225 is special. Having said that, the results should still look like in the textbook.

What I think is going on is that your initial conditions are not precise enough.

Recall that we always assume that the initial conditions specified in the ADM file are consistent. It would therefore be a good idea to have your simulator check that indeed, with the values q0 and qd0 as read from the ADM file, the constraints and the velocity equation are satisfied.

Coming back to the problem at hand, try to use more accurate values for the initial conditions in the ADM file. In particular, make sure you provide enough digits for the value of the initial angle of the crank and the initial angular velocity of the connecting rod.

-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.