I have defined my model in ModelingToolkit.jl as such:
# define model parameters
@parameters Ci Ria Aw
# define sub-model components
@named C_i = Capacitor(C=Ci) # thermal capacity of interior
@named R_ia = Resistor(R=Ria) # thermal resistance between interior and ambient
@named T_a = Voltage() # ambient temperature
@named P_h = Current() # thermal power in kW
@named P_s = Current() # solar power in kW
@named A_w = Gain(k=Aw) # dimensionless window area gain (SHGC*Area)
@named gnd = Ground() # ground node
# input functions
@named T_a_f = TimeVaryingFunction(input_funcs[:T_a])
@named P_h_f = TimeVaryingFunction(input_funcs[:P_h])
@named P_s_f = TimeVaryingFunction(input_funcs[:P_s])
# collect all components in a vector
components = [C_i, R_ia, T_a, P_h, P_s, A_w, T_a_f, P_h_f, P_s_f, gnd]
# make component connections
conn = [
connect(C_i.p, R_ia.p),
connect(R_ia.n, T_a.p),
connect(C_i.n, gnd.g),
# ambient temperature input
connect(T_a.p, R_ia.n),
connect(T_a.V, T_a_f.output),
connect(T_a.n, gnd.g),
# solar power input: A_w * P_s
connect(A_w.output, P_s.I),
connect(A_w.input, P_s_f.output),
connect(P_s.n, C_i.p),
connect(P_s.p, gnd.g),
# thermal power input
connect(P_h.n, C_i.n),
connect(P_h.I, P_h_f.output),
connect(P_h.p, gnd.g)
]
The input functions are given by DataInterpolations.jl:
# define interpolated input functions of sampled data
T_a_interp = AkimaInterpolation(df.T_a, df.t_hour)
P_s_interp = AkimaInterpolation(df.P_s, df.t_hour)
P_h_interp = AkimaInterpolation(df.P_h, df.t_hour)
input_funcs = Dict(:T_a => T_a_interp, :P_s => P_s_interp, :P_h => P_h_interp)
Now when I display the equations of this model (after calling structural_simplify(sys)
I get the following LaTeX output, which is not very readable:
I would like this more readable so I can inspect the equations.
Related question: can I make outputs / inputs such as C_{i_+ v}(t) display something else as well which makes more sense to me? For example, change C_{i_+ v}(t) to V_{C}(t).
ps. I am on ModelingToolkit v8.75 due to requirements of a package I am using.
Thanks a lot