| 20 | TEST(test_to_state) { |
| 21 | mlnorm<fsqmat> ml; |
| 22 | mat A="1.1, 2.3"; |
| 23 | ml.set_parameters(A, vec_1(1.3), eye(1)); |
| 24 | RV yr=RV("y",1); |
| 25 | RV ur=RV("u",1); |
| 26 | ml.set_rv(yr); |
| 27 | yr.t_plus(-1); |
| 28 | ml.set_rvc(concat(yr, ur)); |
| 29 | |
| 30 | shared_ptr<StateCanonical > Stsp=new StateCanonical; |
| 31 | Stsp->connect_mlnorm(ml); |
| 32 | |
| 33 | /* results from |
| 34 | [A,B,C,D]=tf2ss([2.3 0],[1 -1.1]) |
| 35 | */ |
| 36 | CHECK_CLOSE_EX(Stsp->_A().get_row(0), vec("1.1"), 0.0001); |
| 37 | CHECK_CLOSE_EX(Stsp->_C().get_row(0), vec("2.53"), 0.0001); |
| 38 | CHECK_CLOSE_EX(Stsp->_D().get_row(0), vec("2.30"), 0.0001); |
| 39 | } |
| 40 | |
| 41 | |