Skip to content

Instantly share code, notes, and snippets.

@taldcroft
Created May 18, 2012 21:29
Show Gist options
  • Save taldcroft/2727687 to your computer and use it in GitHub Desktop.
Save taldcroft/2727687 to your computer and use it in GitHub Desktop.
Xija - defining model
import xija
# Create Xija model named "dpa" (Digital Processor Assembly)
mdl = xija.ThermalModel('dpa')
# Add node for DPA temperature 1DPAMZT in telemetry
dpamzt = mdl.add(xija.Node, '1dpamzt')
simz = mdl.add(xija.SimZ) # Science Instrument Module posn
pitch = mdl.add(xija.Pitch) # Sun angle w/r/t spacecraft
eclipse = mdl.add(xija.Eclipse) # Eclipse status
# Solar heating of the DPA electronics box
mdl.add(xija.DpaSolarHeat, dpamzt, pitch_comp=pitch,
simz_comp=simz, eclipse_comp=eclipse)
# External heat sink (cooling to rest of spacecraft and space)
mdl.add(xija.HeatSinkRef, dpamzt)
# Self-heating of DPA electronics due to internal power draw
mdl.add(xija.AcisDpaStatePower, dpamzt)
# Nearby thermostatically controlled proportional heater
mdl.add(xija.PropHeater, dpamzt)
# After all model components are defined then do a final
# "make" step to create arrays and read data as needed.
mdl.make()
# Write the model to a JSON file for use in fitting
mdl.write('dpa_model_spec.json')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment