From cc75faf4029f3a057ffbb9121d7f422966452288 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Wed, 31 Jul 2013 18:14:47 +0000 Subject: [PATCH] [Matlab] Add support for additional reactor types Matlab interface now supports ConstPressureReactor, IdealGasReactor, and IdealGasConstPressureReactor. --- .../matlab/toolbox/ConstPressureReactor.m | 16 ++++++++++++++++ .../toolbox/IdealGasConstPressureReactor.m | 19 +++++++++++++++++++ interfaces/matlab/toolbox/IdealGasReactor.m | 16 ++++++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 interfaces/matlab/toolbox/ConstPressureReactor.m create mode 100644 interfaces/matlab/toolbox/IdealGasConstPressureReactor.m create mode 100644 interfaces/matlab/toolbox/IdealGasReactor.m diff --git a/interfaces/matlab/toolbox/ConstPressureReactor.m b/interfaces/matlab/toolbox/ConstPressureReactor.m new file mode 100644 index 000000000..dff13aeed --- /dev/null +++ b/interfaces/matlab/toolbox/ConstPressureReactor.m @@ -0,0 +1,16 @@ +function r = ConstPressureReactor(contents) +% CONSTPRESSUREREACTOR - Create a ConstPressureReactor object. +% +% A ConstPressureReactor is an instance of class Reactor where the pressure +% is held constant. The volume is not a state variable, but instead takes +% on whatever value is consistent with holding the pressure constant. +% +% r1 = ConstPressureReactor % an empty reactor +% r2 = ConstPressureReactor(gas) % a reactor containing a gas +% +% See also: Reactor +% +if nargin == 0 + contents = 0; +end +r = Reactor(contents, 4); diff --git a/interfaces/matlab/toolbox/IdealGasConstPressureReactor.m b/interfaces/matlab/toolbox/IdealGasConstPressureReactor.m new file mode 100644 index 000000000..0f7024f3c --- /dev/null +++ b/interfaces/matlab/toolbox/IdealGasConstPressureReactor.m @@ -0,0 +1,19 @@ +function r = IdealGasConstPressureReactor(contents) +% IDEALGASCONSTPRESSUREREACTOR - Create an IdealGasConstPressureReactor object. +% +% An IdealGasConstPressureReactor is an instance of class Reactor where the +% pressure is held constant. The volume is not a state variable, but +% instead takes on whatever value is consistent with holding the pressure +% constant. Additionally, its governing equations are specialized for the +% ideal gas equation of state (and do not work correctly with other +% thermodynamic models). +% +% r1 = IdealGasConstPressureReactor % an empty reactor +% r2 = IdealGasConstPressureReactor(gas) % a reactor containing a gas +% +% See also: Reactor +% +if nargin == 0 + contents = 0; +end +r = Reactor(contents, 6); diff --git a/interfaces/matlab/toolbox/IdealGasReactor.m b/interfaces/matlab/toolbox/IdealGasReactor.m new file mode 100644 index 000000000..478d0aa65 --- /dev/null +++ b/interfaces/matlab/toolbox/IdealGasReactor.m @@ -0,0 +1,16 @@ +function r = IdealGasReactor(contents) +% IDEALGASREACTOR - Create an IdealGasReactor object. +% +% An IdealGasReactor is an instance of class Reactor where the governing +% equations are specialized for the ideal gas equation of state (and do not +% work correctly with other thermodynamic models). +% +% r1 = IdealGasReactor % an empty reactor +% r2 = IdealGasReactor(gas) % a reactor containing a gas +% +% See also: Reactor +% +if nargin == 0 + contents = 0; +end +r = Reactor(contents, 5);