function gas = igm_isentropic_specific_heats(name, temperature, property12, value1, temperature1, value2, units)
% -------------------------------------------------------------------------
% igm_isentropic_specific_heats
% -------------------------------------------------------------------------
% Fundamentals of Thermodynamics
% A function that uses the ideal gas model (IGM) for common gases 
% undergoing an isentropic process to fix the two states given the 
% temperature at one state and the pressure or volume at both states 
% either independently or as a ratio. The function uses average and 
% constant specific heats evaluated at a given temperature. 
% -------------------------------------------------------------------------
% Syntax: gas = igm_isentropic_specific_heats(name, temperature, 
%         property12, value1, temperature1, value2, units)
% Inputs: name = name of common gases ('Air', 'Nitrogen', 'Oxygen', 
%         'Carbon Dioxide', 'Carbon Monoxide' or 'Hydrogen')
%         temperature = temperature at which specific heats are evaluated
%         property12 = the name of the property which is known at both 
%         states either independently or as a ratio (Pressure or Specific 
%         Volume)
%         value1 = the value of the above property at state 1
%         temperature1 = the value of the temperature at state 1
%         value2 = the value of the same property at state 2
%         units = 1 (SI units) or 2 (English units)
% Output: gas = structure array with all relevant properties in relevant
%         fields (T, cp, cv, k, M, R, p and v).  
%         1st element in structure array represents properties at state 1
%         2nd element in structure array represents properties at state 2
%         The specific heat and other properties are those that are
%         evaluated at given temperature. 
%         
% Valid properties and units:
%         T - temperature (K or R)
%         cp - specific heat at constant pressure (kJ/kg*K or Btu/lb*R)
%         cv - specific heat at constant volume (kJ/kg*K or Btu/lb*R)
%         k - specific heat ratio (unitless)
%         M - molecular weight (kg/kmol or lb/lbmol)
%         R - gas constant (TBD)
%         p - pressure (bar or lbf/in^2)
%         v - specific volume (m^3/kg or ft^3/lb)
% -------------------------------------------------------------------------
% Notes: Use consistent SI or English units.
%--------------------------------------------------------------------------
% Example
% gas = igm_isentropic_specific_heats('Air',250,'Pressure',10,250,20,1) 
% This example corresponds to air undergoing an isentropic process from 10
% bar, 250 K to 20 bar with specific heats evaluated at 250 K. 
%--------------------------------------------------------------------------
% Robyn Callaghan, Undergraduate student, Mechanical Engineering 
% Dr.Priya Goeser, Professor
% Original: May 12, 2016
% Modified: July 21, 2016
% Copyright (c) 2016 Robyn Callaghan, All Rights Reserved.
% Engineering Studies Program, Armstrong State University. 
% -------------------------------------------------------------------------