From 6ce82c52de487c9f1d51c305cdc04afaa50d28e3 Mon Sep 17 00:00:00 2001
From: Saeed Ranjbar <saeed.ranjbar@mail.concordia.ca>
Date: Sun, 13 Aug 2023 21:17:03 -0400
Subject: [PATCH] Class parameter_function.py is created

---
 .../energy_systems/parameter_function.py      | 53 +++++++++++++++++++
 1 file changed, 53 insertions(+)
 create mode 100644 hub/catalog_factories/data_models/energy_systems/parameter_function.py

diff --git a/hub/catalog_factories/data_models/energy_systems/parameter_function.py b/hub/catalog_factories/data_models/energy_systems/parameter_function.py
new file mode 100644
index 00000000..089812b5
--- /dev/null
+++ b/hub/catalog_factories/data_models/energy_systems/parameter_function.py
@@ -0,0 +1,53 @@
+"""
+Energy System catalog heat generation system
+SPDX - License - Identifier: LGPL - 3.0 - or -later
+Copyright © 2023 Concordia CERC group
+Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
+Code contributors: Saeed Ranjbar saeed.ranjbar@concordia.ca
+"""
+
+from __future__ import annotations
+from typing import Union
+
+
+class ParameterFunction:
+  """
+  Parameter function class
+  """
+
+  def __init__(self, type, coefficients):
+    self._type = type
+    self._coefficients = coefficients
+
+  @property
+  def type(self):
+    """
+    The type of the fit function from the following
+    Linear =>>> y = a*x + b
+    Exponential =>>> y = a*(b**x)
+    Polynomial =>>> y = a*(x**2) + b*x + c
+    Power =>>> y = a*(x**b)
+    Second degree multivariable =>>> y = a*(x**2) + b*x + c*x*y + d*y + e*(y**2) + f
+
+    Get the type of function from ['linear', 'exponential', 'polynomial', 'power', 'second degree multivariable']
+    :return: string
+    """
+    return self._type
+
+  @property
+  def coefficients(self):
+    """
+    Get the coefficients of the functions as list
+    :return: [coefficients]
+    """
+    return self._coefficients
+
+  def to_dictionary(self):
+    """Class content to dictionary"""
+    content = {'Parameter Function': {
+                                      'type': self.type,
+                                      'coefficients': self.coefficients,
+                                      }
+               }
+    return content
+