Severity: Warning
Message: fopen(/home/polpe/.phpsession/ci_sessione5dd40b0f15a7d4bf794ba910013154f62f6b94e): failed to open stream: No space left on device
Filename: drivers/Session_files_driver.php
Line Number: 159
Backtrace:
File: /home/polpe/public_html/application/controllers/Main.php
Line: 17
Function: library
File: /home/polpe/public_html/index.php
Line: 315
Function: require_once
Teljes Matlab script kiegészítő függvényekkel.
File: ccs_nonline_Polcz_Ex1b_feedbacklin.m Directory: 4_gyujtemegy/11_CCS/_2_nonlin-pannon/2018 Author: Peter Polcz (ppolcz@gmail.com)
Created on 2018. August 13.
syms t u v real
syms x1 x2 x3 real
syms z1 z2 z3 real
x = [x1 ; x2 ; x3];
z = [z1 ; z2 ; z3];
d = @(g) jacobian(g,x);
Lie = @(f,g) d(g)*f;
br = @(f,g) d(g)*f - d(f)*g;
f = [
x1^2 / (x1 + 1)
(x1 + x3) / (x1 + 1) - x1
x2*x3 / (x1 + 1)
];
g = [
0
0
x2 / (x1 + 1)
];
h = x1 + x2;
phi3 = x2;
Phi = [
h
Lie(f,h)
phi3
];
% Quick check: should be zero
% Lie(g,phi3)
\begin{align}\Phi(x) = \left(\begin{array}{c} x_{1}+x_{2}\\ \frac{{x_{1}}^2}{x_{1}+1}-x_{1}+\frac{x_{1}+x_{3}}{x_{1}+1}\\ x_{2} \end{array}\right)\end{align}
Quick check
\begin{align}L_g \phi_3(x) = 0\end{align}$\phi_3(x)$ is given by Isidori, but anyone can check that this is indeed a solution for the PDE. This solution can also be computed by Mathematica.
Phi_inv = struct2cell(solve(z-Phi, x1, x2, x3));
Phi_inv = [ Phi_inv{:} ]';
\begin{align}\Phi^{-1}(z) = \left(\begin{array}{c} z_{1}-z_{3}\\ z_{3}\\ z_{2}+z_{1}\,z_{2}-z_{2}\,z_{3} \end{array}\right)\end{align}
Coordinate transformation
b = simplify(Lie(f, Lie(f,h)));
a = simplify(Lie(g, Lie(f,h)));
q3 = simplify(Lie(f, Phi(3)));
\begin{align}b(x) = \frac{x_{3}\,\left(-{x_{1}}^2+x_{2}\,x_{1}+x_{2}\right)}{{\left(x_{1}+1\right)}^3},~ a(x) = \frac{x_{2}}{{\left(x_{1}+1\right)}^2},~ q_3(x) = \frac{x_{3}-{x_{1}}^2}{x_{1}+1}\end{align}
b = simplify(subs(b, x, Phi_inv));
a = simplify(subs(a, x, Phi_inv));
q3 = simplify(subs(q3, x, Phi_inv));
\begin{align}b(z) = \frac{z_{2}\,\left(-{z_{1}}^2+3\,z_{1}\,z_{3}-2\,{z_{3}}^2+z_{3}\right)}{{\left(z_{1}-z_{3}+1\right)}^2},~ a(z) = \frac{z_{3}}{{\left(z_{1}-z_{3}+1\right)}^2},~ q_3(z) = \frac{z_{2}-{\left(z_{1}-z_{3}\right)}^2+z_{1}\,z_{2}-z_{2}\,z_{3}}{z_{1}-z_{3}+1}\end{align}
dz = simplify([ z2 ; collect(b+a*u,u) ; q3 ]);
System dynamics in the new coordinates
\begin{align}\dot z = \left(\begin{array}{c} z_{2}\\ \frac{u\,z_{3}+z_{2}\,z_{3}-{z_{1}}^2\,z_{2}-2\,z_{2}\,{z_{3}}^2+3\,z_{1}\,z_{2}\,z_{3}}{{\left(z_{1}-z_{3}+1\right)}^2}\\ \frac{z_{2}-{\left(z_{1}-z_{3}\right)}^2+z_{1}\,z_{2}-z_{2}\,z_{3}}{z_{1}-z_{3}+1} \end{array}\right)\end{align}Linearizing feedback design
u_fdb = a \ (-b + v);
\begin{align}u = \frac{\left(v-\frac{z_{2}\,\left(-{z_{1}}^2+3\,z_{1}\,z_{3}-2\,{z_{3}}^2+z_{3}\right)}{{\left(z_{1}-z_{3}+1\right)}^2}\right)\,{\left(z_{1}-z_{3}+1\right)}^2}{z_{3}}\end{align}
Closed loop
dz_fdb = simplify(subs(dz, u, u_fdb));
\begin{align}\dot z = \left(\begin{array}{c} z_{2}\\ v\\ \frac{z_{2}-{\left(z_{1}-z_{3}\right)}^2+z_{1}\,z_{2}-z_{2}\,z_{3}}{z_{1}-z_{3}+1} \end{array}\right)\end{align}
Zero dynamics
Zero_dynamics = simplify(subs(dz_fdb, [z1 z2 v], [0 0 0]));
ezplot(Zero_dynamics(3)), grid on
return
The zero dynamics is stable in the origin.
pcz_align(['\dot z_3 = ' latex(Zero_dynamics(3))])
Overall dynamics without the zero dynamics.
A = [
0 1
0 0
];
B = [
0
1
];
C = [ 1 0 ];
sys = ss(A,B,C,0);
Download model here: Polcz_Ex1a_state_feedback.slx
% State feedback gain designed by LQR
K = lqr(A,B,0.1*eye(2),1);
pcz_print_model('Polcz_Ex1a_state_feedback', 'simulate', true)