You are on page 1of 8

ENGR 160 Excel in Class Homework Data for slider-crank mechanism One of the most important mechanisms in our

lives is the slider-crank mechanism. It is used in reciprocating engines for automobiles, reciprocating compressors, and piston pumps. In this assignment you will use Excel to calculate the force in the connecting rod that causes the piston to accelerate over its cycle. Forces due to combustion pressures are not included in this analysis. A schematic of the mechanism is shown below. The link labeled L is the connecting rod. R represents the crank arm. W represents the weight of the piston. The distance of the piston from the crankshaft bearings is given by r. The crank angle is . The angle of the connecting rod as measured from the horizontal is denoted by . R

rr You will need to use seven equations in your spreadsheet. These are provided below. Remember that Excel needs to have arguments of trigonometric functions (sin, cos, etc.) in radians.
R = arcsin sin L
r = R cos + L cos

(1) (2) (3) (4) (5) (6) (7)

LVel =

R cos L cos

Vel = R sin ( + LVel)


LAcc = (R 2 sin ) + (L LVel 2 sin ) L cos

Acc = R cos ( + LVel) R sin LAcc


Force = W Acc 386.4 cos

Where you will provide input values for R, L, (in rad/s), and W. Vel is the velocity of the piston, LVel is the angular velocity of the connecting rod (in rad/s), Acc is the acceleration of the piston, and LAcc is the angular acceleration of the connection rod (in rad/s^2).

Your assignment is to use the equations above to generate a spreadsheet, like the one attached, that calculates the connecting rod force. Provide a title at the top of your worksheet, Force in Connecting Rod. Make the title stand out a little by increasing its size and using other enhancements. Provide cells for inputting the values for R, L, , and W. Put values of 4, 12, 3000 and 4 respectively in them for now. You can change them later. Place comments (right click and choose insert comment) in these cells that say to enter the lengths R and L in inches, the speed of the machine in rpm, and the weight W in pounds. Its a good idea to calculate the machine speed in rad/s too because thats the way we use it in calculations. Place the radian/s value in a handy cell. Shade or color the input area to set it off from the rest of the spreadsheet where keyboard inputs will not be allowed. Select the four input cells (for R, L, , and W). Set up headings from left to right in the order that I have them in my spreadsheet. Increment crank angle from zero to 360 degrees in increments of 5 degrees. In the Radians column, use a Math and Trig Function (RADIANS) to convert degrees to radians. For the Phi column, use Equation (1). You will have to use the input values for R and L and the ASIN function in Math and Trig to compute the arcsine. The r column uses the second and third columns and the input values of R and L in Equation (2). The L-Vel column comes from Equation (3) which uses cosine functions of the second and third columns and the input value for . Vel uses Equation (4) which uses R and values you have already computed in other columns. L-Acc comes from Equation (5) and uses input values R, L, and , and values you have already computed. Acc comes from Equation (6) and Force comes from Equation (7). In each column, copy the formulas down to 360 degrees crank angle. Shade the Degrees, r, Vel, Acc, and Force columns because we are going to graph them next. When your spreadsheet is finished, format the numbers in the columns like I have them in my spreadsheet (two places after the decimal point, etc.). Now for fun, try entering some different numbers for R, L, , and W just to see what will happen to the Force.

Plotting slider-crank output Select the Theta (degrees), r (inches), and Force (lbs) columns and make an X-Y chart with the Theta column as the x-axis. Place the chart on a separate sheet. Format the X-axis to go from 0 to 360 degrees in 30 degree major tics. Format the X-axis font to be 14 pt. Put the Piston Displacement (r) on the first Y-axis and Force on the second Y-axis. Format fonts on these axes to be 14 pt. Format fonts for the X and Y axis titles to be 16 pt and the Chart title to be 18 pt. Format the plot area to be no color. Move the legend into the plot area. Make the legend font 14 pt. Go to Select Data. Name the displacement series, Displacement. Name the Force series, Rod force. These name should then show up in your legend. Format the displacement curve to be a solid line. Format the Rod force curve to be dashed. Format some stuff with colors curves, chart area, other Add a drawing of the slider-crank to the plot area. Paste it from your spreadsheet. Go to Page Setup. Select landscape. Make 1-inch margins all around. Make a custom header with Excel Slider Crank Problem on the left, your name in the center, and the date at the right.

Solving Ordinal Differential Equation Using Ms. Excel

General form of ODE Initial value ordinary differential equations (ODEs) are among the most widely used forms of mathematics in science and engineering. However, most ODE models are complicated enough (e.g., sets of simultaneous nonlinear equations) to preclude analytical methods of solution; instead, numerical methods must be used, which I want to talk through this post. The calculation of a numerical solution usually requires that numerical integration algorithms are implemented in library routines. The library routines in turn can be coded (programmed) in a variety of programming languages. Typically, for a scientist or engineer with an ODE based mathematical model, finding routines written in a familiar language can be a demanding requirement, and perhaps even impossible (if such routines do not exist). However not all people understand or have time to code a program which calculates the solution of a set of ODEs. Thats the reason I post this. Id like to give you an useful tool to solve your ODEs with a software everyone can get easily : Microsoft Excel. The solution method is based on RungeKutta method, and Its been successful to solve many of my ODE problems especially problems related to my field, chemical engineering . I wish it could satisfy you too:-) To use my tool, you can just download this file Runge-Kutta.xls (but remove extension .doc first) , then open it, and youd find a worksheet like this:

I assume that youre using Ms. Excel 2007 or 2010 so Ill explain you as youre using one of them. And make sure that Macro in your Excel is enabled. Now, lets work on one famous model: Damped Simple Harmonic Motion

For this phenomenon, we can model it into a simple equation of motion:

Which v equals to dx/dt, and M, D, k, f are constants. Hence, there will be two ODEs, they are:

Now, our task is to solve them with our Excel. Just follow simple procedure below: 1. Because we have two equations, fill cell B1 with 2 2. Because our variables are t, x, and v, change y into v, and v into y. Our variable is v, not y. Note: If you have three equations or above, just fill B1 with 3, and you can just put another variable in D3 3. Fill H3 and cells below it with our constants, and suppose we have a 0.5 kg burden, a spring with k = 2 kg/s2 and damper 0.3 kg/s, and a constant outer force 1 Newton, just like below.

4. Fill in cells B5:B6 with our equations. I mean fill in B5 with =C3 , and B6 with =(I3/I2)*C3+(-I4/I2)*B3+(I5/I2) 5. We will try to integrate the ODEs we have from 0 to 20, so fill B7 with 0 and B8 with 20. Then determine a step size. Too big step size might cause some significant error, and too small step size make calculating time longer. We try to put 0.2 into B9.

6. Now, put any initial value into cells A12:A14. For Instance, at t=0, x=1.0 m and v=0 m/s. 7. After above steps, the worksheet must be like this

8. Now press CALCULATE, and the VBA code inside our worksheet will integrate and display the results under cells filled with initial values. 9. From result data, we can draw a graph x and y versus t like below

We can see that it just resemble the typical graph of Damped Simple Harmonic Motion, but be careful that we have to compare it to analytical solutions of this model, then calculate the sum of the error. Try by your selves, but Im pretty sure the error is small enough to be neglected

You might also like