From 46a8932f4d959c75ab71fae3ab3a737b21061f31 Mon Sep 17 00:00:00 2001 From: "Jonas J. Gonzalez" Date: Wed, 28 Feb 2024 16:24:06 -0500 Subject: [PATCH] bug fixes in save_model() from prior updates --- src/IO/save_model.jl | 8 +++++--- src/engine/tfcalc.jl | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/IO/save_model.jl b/src/IO/save_model.jl index 7ddad55d..a4994bae 100644 --- a/src/IO/save_model.jl +++ b/src/IO/save_model.jl @@ -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] @@ -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 diff --git a/src/engine/tfcalc.jl b/src/engine/tfcalc.jl index fae658e6..672d2db9 100644 --- a/src/engine/tfcalc.jl +++ b/src/engine/tfcalc.jl @@ -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)