How to use the gekko.chemical.StreamObj function in gekko

To help you get started, we’ve selected a few gekko examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github BYU-PRISM / GEKKO / gekko / View on Github external
        y = stream(fixed=True)

        Output: Stream Object 
        y = StreamObj()
          P = Pressure (Pa)
          T = Temperature (K)
          ndot = Molar flow rate (kmol/sec)
          x = Array of mole fractions
          phase = Phase (solid, liquid, vapor)
          fixed = Gekko parameter (True) or variable (False) if None or []
        self._thermo_obj = True

        # create stream object
        y = StreamObj() = self.add_obj('Feed')
            # pressure
            y.P = self.cxn(y.P,101325.0,'.P',fixed)
            # temperature
            y.T = self.cxn(y.T,300.0,'.T',fixed)
            # stream phase
            y.phase = self.set_phase(y,phase=y.phase)
        # molar flow
        y.ndot = self.cxn(y.ndot,1.0,'.ndot',fixed)
        # mole fractions
        y.x = self.cxnl(y.x,self.dfrac(),fixed=fixed)
        # additional equation for last mole fraction
        if isinstance(y.x[-1],GKVariable):