function output = ism(name, temperature, units) 
% -------------------------------------------------------------------------
% ism.m
% -------------------------------------------------------------------------
% Fundamentals of Thermodynamics
% A function that uses the incompressible substance model (ism) to define 
% the state of a structure with all relevant properties at the same state
% as an output.
% -------------------------------------------------------------------------
% Syntax: output = ism(name, temperature, units)
% Inputs: name = name of substance ('Water', 'R22', 'R134a', 'Ammonia', 
%         or 'Propane')
%         temperature = the temperature of the substance
%         units = 1 (SI units) or 2 (English units)
% Output: output = the structure with all relevant properties in relevant
%         fields (T, sat_p, v, u, h, s, x)
%
% Valid properties and units:
%         T - temperature (C or F)
%         sat_p - saturated pressure (bar or lbf/in^2)
%         v - specific volume (m^3/kg or ft^3/lb)
%         h - specific enthalpy (kJ/kg or Btu/lb)
%         u - specific internal energy (kJ/kg or Btu/lb)
%         s - specific entropy (kJ/kg*K or Btu/lb*R)
%         x - quality (mass of vapor as a unitless fraction between 0-1)
%         
% -------------------------------------------------------------------------
% Notes: Use consistent SI or English units.
% This function is set up for only the substances mentioned above.
% All specific properties defined per unit mass. 
%--------------------------------------------------------------------------
% Example
% output = ism('R22', 0, 1)
% This example corresponds to R22 at 0 degrees C using SI units. 
%--------------------------------------------------------------------------
% Robyn Callaghan, Undergraduate student, Mechanical Engineering
% Chance Borgeson, Undergraduate student, Mechanical Engineering
% Dr.Priya Goeser, Professor
% Original: June 25, 2016
% Modified: July 20, 2016
% Copyright (c) 2016 Robyn Callaghan, All Rights Reserved.
% Engineering Studies Program, Armstrong State University.
% -------------------------------------------------------------------------