diff --git a/docs/references.bib b/docs/references.bib index 47210fdab..07f2fd5e3 100644 --- a/docs/references.bib +++ b/docs/references.bib @@ -351,7 +351,7 @@ @book{Bakshi2011 doi={10.1017/CBO9780511976049}, publisher={Cambridge University Press}, year={2011}, - editor={{}} + editor={Bakshi, Bhavik R. and Gutowski, Timothy G. and Sekulić, Dušan P.} } @book{Szargut1988, diff --git a/pyproject.toml b/pyproject.toml index 6632d54ba..82aaf725a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,7 +25,7 @@ exclude = ["docs/_build"] [project] name = "tespy" -version = "0.7.0.post1" +version = "0.7.1" description = "Thermal Engineering Systems in Python (TESPy)" readme = "README.rst" authors = [ diff --git a/src/tespy/__init__.py b/src/tespy/__init__.py index 5557a0fa7..049be2a61 100644 --- a/src/tespy/__init__.py +++ b/src/tespy/__init__.py @@ -3,7 +3,7 @@ import os __datapath__ = os.path.join(importlib.resources.files("tespy"), "data") -__version__ = '0.7.0.post1 - Newton\'s Nature' +__version__ = '0.7.1 - Newton\'s Nature' # tespy data and connections import from . import connections # noqa: F401 diff --git a/src/tespy/components/turbomachinery/base.py b/src/tespy/components/turbomachinery/base.py index 35ae7e083..a944c8e71 100644 --- a/src/tespy/components/turbomachinery/base.py +++ b/src/tespy/components/turbomachinery/base.py @@ -147,9 +147,17 @@ def energy_balance_deriv(self, increment_filter, k): k : int Position of derivatives in Jacobian matrix (k-th equation). """ - self.jacobian[k, 0, 0] = self.outl[0].h.val_SI - self.inl[0].h.val_SI - self.jacobian[k, 0, 2] = -self.inl[0].m.val_SI - self.jacobian[k, 1, 2] = self.inl[0].m.val_SI + i = self.inl[0] + o = self.outl[0] + if i.m.is_var: + self.jacobian[k, i.m.J_col] = o.h.val_SI - i.h.val_SI + if i.h.is_var: + self.jacobian[k, i.h.J_col] = -i.m.val_SI + if o.h.is_var: + self.jacobian[k, o.h.J_col] = i.m.val_SI + # custom variable P + if self.P.is_var: + self.jacobian[k, self.P.J_col] = -1 def bus_func(self, bus): r"""