Skip to content

Commit

Permalink
bug fixes in save_model() from prior updates
Browse files Browse the repository at this point in the history
  • Loading branch information
argonaut22 committed Feb 28, 2024
1 parent 0e944dc commit 46a8932
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/IO/save_model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,9 @@ function save_model(ac::TASOPT.aircraft=TASOPT.read_aircraft_model(),
d_miss["N_missions"] = size(ac_m,2)

d_miss["range"] = ac_m[imRange,:]
d_miss["weight_per_pax"] = ac_g[igWpax]
d_miss["pax"] = ac_m[imWpay,:]./ ac_g[igWpax]
d_miss["weight_per_pax"] = ac_m[imWperpax, :]
d_miss["pax"] = ac_m[imWpay,:] ./ ac_m[imWperpax, :]
d_miss["max_pax"] = ac_g[igWpaymax] ./ ac_m[imWperpax, :]
d_miss["fuel_reserves"] = ac_g[igfreserve]
d_miss["Vne"] = ac_g[igVne]
d_miss["Nlift"] = ac_g[igNlift]
Expand Down Expand Up @@ -579,7 +580,8 @@ function make_dict_singletons(dict::Dict{K, V}) where {K, V}
if isa(value, Dict)
new_dict[key] = make_dict_singletons(value)
#if element is a vector and has identical elements, save singleton
elseif isa(value, Vector) && all(x -> x == value[1], value)
#AND not ac.sized (exception needed bc ac.sized needs to be a vector for mutability)
elseif isa(value, Vector) && all(x -> x == value[1], value) && key != "sized"
new_dict[key] = value[1]
else
new_dict[key] = value
Expand Down
2 changes: 1 addition & 1 deletion src/engine/tfcalc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ function tfcalc!(pari, parg, para, pare, ip,
NbhtD = Nbht
NbltD = Nblt

#----- but recacalculate turbine pressure ratios using slightly approximate form,
#----- but recalculate turbine pressure ratios using slightly approximate form,
#- to be fuly consistent with TFOPER's turbine efficiency function
Trh = Tt41 / (Tt41 + (ht45 - ht41) / cpt41)
Trl = Tt45 / (Tt45 + (ht49 - ht45) / cpt45)
Expand Down

0 comments on commit 46a8932

Please sign in to comment.