@@ -810,13 +810,13 @@ end
810810
811811Given a list of analysis points, break the connection for each and set the output to zero. 
812812""" 
813- function  handle_loop_openings (sys:: AbstractSystem , aps)
813+ function  handle_loop_openings (sys:: AbstractSystem , aps, input_vars )
814814    for  ap in  canonicalize_ap (sys, aps)
815815        sys, (outvar,) =  apply_transformation (Break (ap, true , true ), sys)
816816        if  Symbolics. isarraysymbolic (outvar)
817-             push! ( get_eqs (sys), outvar  ~   zeros ( size ( outvar) ))
817+             append! (input_vars,  collect ( outvar))
818818        else 
819-             push! (get_eqs (sys) , outvar  ~   0 )
819+             push! (input_vars , outvar)
820820        end 
821821    end 
822822    return  sys
@@ -849,10 +849,10 @@ All other keyword arguments are forwarded to `linearization_function`.
849849""" 
850850function  get_linear_analysis_function (
851851        sys:: AbstractSystem , transform, aps; system_modifier =  identity, loop_openings =  [], kwargs... )
852-     sys =  handle_loop_openings (sys, loop_openings)
853-     aps =  canonicalize_ap (sys, aps)
854852    dus =  []
855853    us =  []
854+     sys =  handle_loop_openings (sys, loop_openings, dus)
855+     aps =  canonicalize_ap (sys, aps)
856856    for  ap in  aps
857857        sys, (du, u) =  apply_transformation (transform (ap), sys)
858858        push! (dus, du)
@@ -979,7 +979,7 @@ function linearization_ap_transform(sys,
979979        end 
980980        push! (output_vars, output_var)
981981    end 
982-     sys =  handle_loop_openings (sys, map (AnalysisPoint, collect (loop_openings)))
982+     sys =  handle_loop_openings (sys, map (AnalysisPoint, collect (loop_openings)), input_vars )
983983    return  sys, input_vars, output_vars
984984end 
985985
0 commit comments