cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

assistance programming an engine cycle

jkeena
2-Guest

assistance programming an engine cycle

I am trying to program a basic Otto engine cycle and am having difficulty with states 2-3. Between these states, I need to have a numerical method that calculates a new pressure based on the old pressure and relationships with known values and constants. The independent variable is crank angle (theta). I've attached a working copy of the worksheet as well as some notes depicting the logic.

I've attempted to use theta as both a vector index and range variable but haven't been successful.  Thank you in advance.

1 ACCEPTED SOLUTION

Accepted Solutions

Additionally, there was a term missing from the recommended edit, please see attached...

View solution in original post

12 REPLIES 12

Thank you for providing these references. From what I could tell, these are not directly applicable to the approach I am taking with a variable heat release rate at variable timing (spark initiation and duration). They are however a terrific source for future use.

-MFra-
21-Topaz II
(To:jkeena)

Would fit these changes to the program?

but between P23 and P12 = U0 there is no difference as shown in the graph.

ciclo otto.jpg

This looks promising... I'll try to implement and provide more feedback.

Looking further, and this is manageable with the previous routine, P_34_Theta takes the form of P_12_Theta but with a unique Kappa defined by the last state (Pressure and Volume) from 23.  And the final angle/state (4) just drops back to P_i or atmospheric.

Thanks for the recommendation, more to follow.

Can you share how you declared V0? I'm not able to see that on what was furnished.

Additionally, there was a term missing from the recommended edit, please see attached...

-MFra-
21-Topaz II
(To:jkeena)

Hi Joshua Keena,

I added a zero to the name all variables which may be confused with those of physical constants, or units of measure.

JK0.jpg

Hi F.M.

Thanks... I made the changes and I see what you mean about there not being a difference between the two vectors. It appears that the loop isn't overwriting the original pressures in that vector (P_23). Please see attached for v3. I've transposed both vectors (P_12 and P_23) for comparison at the end of the worksheet.

Sincerely,

Josh

So FM, fourth time's a charm!

See attached, based largely on you unlocking the numerical routine to get the process done for states 2-3, and finding an error in my index notation, I got it to work. At the bottom of the worksheet you'll see the classic 'P-V' diagram for an Otto cycle, and below it plotted on a log-log basis.

Thanks again for your assistance!

With gratitude,

Josh

So FM, fourth time's a charm!

See attached, based largely on you unlocking the numerical routine to get the process done for states 2-3, and finding an error in my index notation, I got it to work. At the bottom of the worksheet you'll see the classic 'P-V' diagram for an Otto cycle, and below it plotted on a log-log basis.

Thanks again for your assistance!

With gratitude,

Josh

-MFra-
21-Topaz II
(To:jkeena)

Hi JK,

The result is wonderful.

Good continuation of your work!

Greetings

FM

FM,

Thanks, and thanks as well for your tips and support.

Sincerely,

Josh

Top Tags