Skip to content

Releases: sinagilassi/PyThermoLinkDB

🆕 mkdt, mkeq, mkeqs Functions

06 Dec 19:38

Choose a tag to compare

🆕 v1.4.3 Release Note: mkdt, mkeq, mkeqs Functions

🚀 New Features

🧩 mkdt, mkeq, mkeqs: Flexible Thermo Source Builders

  • Added three powerful utility functions in pyThermoLinkDB.thermo:
    • mkdt: Quickly create a data source for a component.
    • mkeq: Instantly generate a single equation source for a component and equation.
    • mkeqs: Build all equation sources for a component at once.

📝 Usage Examples

1️⃣ Create Data Source for a Component

CO2_dt = mkdt(
	component=CO2_comp,
	model_source=model_source,
	component_key='Name-State',
)
print(CO2_dt.props())
print(CO2_dt.prop(name='EnFo'))
  • 📦 Instantly access all properties for your component.

2️⃣ Generate a Specific Equation Source

CO2_Cp_IG_eq = mkeq(
	name='Cp_IG',
	component=CO2_comp,
	model_source=model_source,
	component_key='Name-State',
)
print(CO2_Cp_IG_eq.fn(T=298.15))
print(CO2_Cp_IG_eq.calc(T=298.15, P=12))
  • 🧮 Calculate and evaluate specific equations with ease.

3️⃣ Build All Equation Sources for a Component

CO2_eqs = mkeqs(
	component=CO2_comp,
	model_source=model_source,
	component_key='Name-State',
)
print(CO2_eqs.equations())
Cp_IG_eq = CO2_eqs.eq(name='Cp_IG')
print(Cp_IG_eq.calc(T=298.15, P=12))
  • 🔗 Access and compute all available equations for your component.

💡 Why Use These?

  • 🏗️ Simplifies building and accessing thermodynamic data and equations.
  • ⚡ Fast, flexible, and easy to integrate into your workflows.
  • 🧪 Perfect for rapid prototyping and testing with real data.

For more details and full examples, see the updated example script.