<div dir="ltr"><div dir="ltr"><div dir="ltr">Hello people,<div><br></div><div>I am not sure if I am doing something wrong but the lin function for linearization of a non-linear function surrounding a given point is returning different results each time I call it. And sometimes the results affects the following calculations I am performing (like root locus, for example). Below I pasted the output of a same linearization call. </div><div><br></div><div><div>--> [A_body,B_body,C_body,D_body] = lin(sim_f16_body, X0_lin_body, U0); A_body</div><div> A_body  = </div><div><br></div><div>  -0.0209023   0.0519875  -32.14689    0.454861 </div><div>  -0.0403812  -1.0077261  -1.17722     456.03564</div><div>   0.          0.          0.          1.       </div><div>   0.0002606   0.0026867  -0.0006798  -1.0747435</div><div><br></div><div><br></div><div>--> [A_body,B_body,C_body,D_body] = lin(sim_f16_body, X0_lin_body, U0); A_body</div><div> A_body  = </div><div><br></div><div>  -0.0201514   0.0538445  -32.14483    0.4545237</div><div>  -0.0464131  -1.0221136  -1.1907031   456.02225</div><div>   0.          0.          0.          1.       </div><div>   0.000417    0.0020722  -0.0011822  -1.0745151</div><div><br></div><div><br></div><div>--> [A_body,B_body,C_body,D_body] = lin(sim_f16_body, X0_lin_body, U0); A_body</div><div> A_body  = </div><div><br></div><div>  -0.0195838   0.0528224  -32.148353   0.4557581</div><div>  -0.0495045  -1.0029337  -1.1827851   456.02261</div><div>  -1.970D-16   0.         -1.203D-16   1.       </div><div>   0.0000567   0.0028515  -0.0000533  -1.0754311</div><div><br></div><div><br></div><div>--> [A_body,B_body,C_body,D_body] = lin(sim_f16_body, X0_lin_body, U0); A_body</div><div> A_body  = </div><div><br></div><div>  -0.0196784   0.0539473  -32.148072   0.4556623</div><div>  -0.050291   -1.0081099  -1.1862481   456.02452</div><div>   1.263D-16   0.          0.          1.       </div><div>   0.0002898   0.0026783  -0.0003306  -1.075333 </div></div><div><br></div><div>Also, I made an overplot of a simulation using the linear and non-linear systems, as shown below (blue curve is the non-linear system and the green curves are linear system from several lin executions).</div><div><br></div><div><div><img src="cid:ii_jmu487rg0" alt="image.png" width="521" height="393"><br></div></div><div>The full code is here [1].</div><div><br></div><div>Anyone faced something like that? I'd appreciate any help.</div><div><br></div><div>[1] <a href="https://github.com/fsandre/mcflight/blob/master/scripts/controls/nz/sim_body_stab_comparison.sce">https://github.com/fsandre/mcflight/blob/master/scripts/controls/nz/sim_body_stab_comparison.sce</a></div><div><br></div><div>--</div><div>André</div></div></div></div>