Skip to main content

Create thermal system based on componennts, automatically calculates differetial equations based on connections and simulates using a variety of solvers.

Project description

Thermal Sim

Create thermal system based on componennts, automatically calculates differetial equations based on connections and simulates using a variety of solvers. Basic components:

  • Thermal Resistor
  • Thermal Mass
  • Power Source
  • Temperature source (infinite)

Usage

Simulate

Create a basic parallell thermal mass and leakage resistor with a PWM controlled powersource.

from thermal_sim import ThermalSystem, Resistor, Capacitor, PowerSource, TemperatureSource

# Power source (PWM controlled)
def pwm(t: float, prev_Q: float, system: ThermalSystem) -> float:
    P = 500
    period = 3600
    duty = 0.5
    return P if (t % period) < duty*period else 0

# Create components
GND = ThermalMass.get_ground(T=0) # A thermal ground is always reqquired
m_floor = ThermalMass(C=1440 * 440, name="Floor") # [J/°C] Concrete floor 
R_floor_gnd = ThermalResistance(R=0.01) # [°C/W]
heat_source = PowerSource(pwm)

# Connection is done by connecting thermal masses to the elements via connect()
m_floor.connect(heat_source)
m_floor.connect(R_floor_gnd, GND)


# Simulate
dt = 60 # [s]
total_time = 1 * 24 * 3600 # [s]
system = ThermalSystem(m_floor)
system.simulate(dt, total_time)

Diagram

Create a diagram of the system

system = ThermalSystem(thermal_masses)
system.draw_diagram()

Examples

PWM controlled RC circuit

Bang-Bang controlled RC circuit

Multiple masses connected

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

thermal_sim-1.0.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

thermal_sim-1.0-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file thermal_sim-1.0.tar.gz.

File metadata

  • Download URL: thermal_sim-1.0.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for thermal_sim-1.0.tar.gz
Algorithm Hash digest
SHA256 ea544cf8d9e0e60489e0aba33eefe0efd2a82aafffdd5b68ccee0a3af1c2d9a5
MD5 60222032bde1978e755053a19dd049f2
BLAKE2b-256 4f49ff3e604c487ede0f9d7732c062eabb135ab7ad170fc7ae0b882bd1744605

See more details on using hashes here.

File details

Details for the file thermal_sim-1.0-py3-none-any.whl.

File metadata

  • Download URL: thermal_sim-1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for thermal_sim-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a85b669c43b557e21608c8fb8abd45427bbdc2a58267dee03b68c6b3b829597d
MD5 077c3b687b6c9d1d9f3629713654d5e9
BLAKE2b-256 292c8eb74b567862d63b52b3188cda53c2904957cb588b1feea84f5543185d15

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page