-
Notifications
You must be signed in to change notification settings - Fork 4
Description
I've got a slightly complicated system (a hydro power system from turbine opening angle
This should indicate a positive steady state gain in the system.
First, I use linearize -- the MTK linearization function. I get a linear model (A,B,C,D) with input derivative, so I create a linear model (A_1,B_1,C_1,D_1) from the time derivative of the input to the output:
mats, sysL_2 = linearize(hp_ns_LoL, [hp_ns_LoL.u_v], [hp_ns_LoL.f_e]; op=op_pt, allow_input_derivatives=true)
sys_2 = ss(mats...)
#
nx = size(sys_2.A,1)
A_1 = [sys_2.A sys_2.B[:,1]; zeros(1,nx) 0]
B_1 = [sys_2.B[:,2]; 1]
C_1 = [sys_2.C sys_2.D[:,1]]
D_1 = sys_2.D[:,2]
sys_1 = ss(A_1,B_1,C_1,D_1)Finally, I use that the input is L(D(u)) = s*u, i.e., I multiply the transfer function above with "s" to get u as input:
ss(zpk(sys_1)*tf("s"))
which gives the model in zpk form as:
This system has a dcgain of +225.
Next, I try to use named_ss from ControlSystemsMTK -- which is where the weird result comes in:
named_ss(hp_ns_LoL, [hp_ns_LoL.u_v], [hp_ns_LoL.f_e]; op=op_pt, allow_input_derivatives=true)The result in zpk form is:
[The model from MTK had similar false zeros/poles, but these disappeared when I multiplied with tf("s")...]
Observe here:
- This system has close to a pure integrator
- This system appears to have the wrong sign
If I "guess" that this system really has derivative of u as input and do the same trick as above, I get:
which has a dcgain of ca. -230 -- which has the wrong sign.
Questions:
- Is there something I do incorrectly? (OK -- I didn't include every step)
- It is weird that it seems like the result of
named_sshas the derivative of the input as input (my system clearly does not have a true integrator; a steady state is reached) - The sign is wrong, as far as I can see.
What are the explanations? Is this a bug, or do I do something wrong?
Here is the tuple of matrices that linearize returns:
(A = [0.0 2.778983834717109e8 1.4122312296634873e6 0.0; 0.0 0.0 0.0 0.037848975765016724; 0.0 24.837541148074962 0.12622006230897712 0.0; -0.0 -4.620724819774693 -0.023481719514324866 -0.6841991610512456], B = [-5.042589978197361e8 0.0; -0.0 0.0; -45.068824982602656 -0.0; 8.384511049369085 54.98555939873381], C = [0.0 0.0 0.954929658551372 0.0], D = [0.0 0.0])I'm on MTK v9.64.1, ControlSystems v1.11.2, ControlSystemsMTK v2.3.1.



