LLMResourceFunction["CodeCommentInsert"]"Module[{eq,iv,ov,carray,newinvars},iv=Complement[Select[Flatten[invars],(!FreeQ[equation,#])&],Flatten[outvars]];ov=Select[Flatten[outvars],(!FreeQ[equation,#])&];If[emptyQ[iv]||emptyQ[ov],Message[SystemsConnectionsModel::badeq,equation];Throw[$Failed]];eq=Solve[equation,iv];If[Head[eq]===Solve||emptyQ[eq],Message[SystemsConnectionsModel::badeq,equation];Throw[$Failed]];eq=iv/.First[eq];If[Length[iv]===1&&Length[ov]===1&&eq===ov, Return[{{DirectedEdge[name2index[ov[[1]],outvars,autoVarQ],name2index[iv[[1]],invars,autoVarQ]]},{},{}}]];carray=CoefficientArrays[eq,ov];If[!zeroQ[carray[[1]]]&&Length[carray]==2, Message[SystemsConnectionsModel::badeq,equation];Throw[$Failed] ];carray=Normal[Normal[carray[[2]]]];newinvars=Table[Automatic,{Length[ov]}];MapIndexed[If[MatchQ[#1,{___?zeroQ,1|1.,___?zeroQ}],newinvars[[First[Position[#1,1,{1},1]]]]=iv[[#2[[1]]]],nothing]&,carray];{MapIndexed[DirectedEdge[name2index[#,outvars,autoVarQ],{nsys+1,#2[[1]]}]&,ov],MapIndexed[DirectedEdge[{nsys+1,#2[[1]]},name2index[#,invars,autoVarQ]]&,iv],ConnectionBlock[carray,newinvars],Reverse@Dimensions[carray]}]"