Question: Question 1: Create a matlab function that takes, as input: the initial temperature and pressure, the compression ratio, displacement volume, adiabatic exponent k, specific

Question 1: Create a matlab function that takes, as input: the initial

Question 1: Create a matlab function that takes, as input: the initial temperature and pressure, the compression ratio, displacement volume, adiabatic exponent k, specific heat input Q. cycle type (Otto or Diesel); and returns, for an ideal cycle: the compression work, the expansion work, the net work, the efficiency, the torque, the temperature, pressure, and specific volume, at all the "main" points of the cycle: initial state, after compression, after combustion, after expansion. Your function should have the form: [W_comp, W_exp,W_net,eta,torque,states]=cycle(T1,P1,r, Vd, k, Q, cycle) Inputs: Ti: initial temperature P1: initial pressure r: compression ratio k: adiabatic exponent Vd: displacement volume Q: heat input cycle: type of cycle: I suggest you use a string equal to either "otto" or "diesel" Outputs: W comp: compression work in kJ W_exp: expansion work in kJ W_net: net work in kJ eta: efficiency torque: (obviously) the torque, in Nm states: I suggest using a struct. It's kind of weird the first time you use it, but it's VERY useful. E.g.: states.st1.T=T1, states.st1.P=P1, states.st2.T=T2, etc. [See this page for help on struct:

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mechanical Engineering Questions!