1 function [stable_p] = flipReal(p)
2 %FLIPREAL Flips real part of complex number
if it is positive
3 % This
function is
for use with vector fitting. If
a pole becomes unstable
4 % (moves into the RHP), we
make it stable by flipping it back into the LHP
6 %Create negative
mask if real part positive
7 mask = -1*sign(real(p));
9 %Flip all positive real parts
12 %Create
new stable complex
poles
Undo scaling of outgoing poles
Create new stable complex poles stable_p
we make it stable by flipping it back into the LHP Create negative mask if real part positive mask
Flip all positive real parts zR
Find a complex rational model for freq domain data for a
Using these poles make(s-a) terms %Each row corresponds to a partial fraction model at one frequency Asys