Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

Translate the entire conversation x

assistance programming an engine cycle

jkeena
7-Bedrock

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.

ACCEPTED SOLUTION

Accepted Solutions
jkeena
7-Bedrock
(To:jkeena)

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

jkeena
7-Bedrock
(To:-MFra-)

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.

jkeena
7-Bedrock
(To:-MFra-)

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

jkeena
7-Bedrock
(To:jkeena)

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

jkeena
7-Bedrock
(To:-MFra-)

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

jkeena
7-Bedrock
(To:jkeena)

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

jkeena
7-Bedrock
(To:-MFra-)

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

jkeena
7-Bedrock
(To:-MFra-)

FM,

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

Sincerely,

Josh

Announcements

Top Tags