Wolfram Language Paclet Repository

Community-contributed installable additions to the Wolfram Language

Primary Navigation

    • Cloud & Deployment
    • Core Language & Structure
    • Data Manipulation & Analysis
    • Engineering Data & Computation
    • External Interfaces & Connections
    • Financial Data & Computation
    • Geographic Data & Computation
    • Geometry
    • Graphs & Networks
    • Higher Mathematical Computation
    • Images
    • Knowledge Representation & Natural Language
    • Machine Learning
    • Notebook Documents & Presentation
    • Scientific and Medical Data & Computation
    • Social, Cultural & Linguistic Data
    • Strings & Text
    • Symbolic & Numeric Computation
    • System Operation & Setup
    • Time-Related Computation
    • User Interface Construction
    • Visualization & Graphics
    • Random Paclet
    • Alphabetical List
  • Using Paclets
    • Get Started
    • Download Definition Notebook
  • Learn More about Wolfram Language

NonlinearCholeskyFactorizationMIMO

Guides

  • Guide to ZigangPan`NonlinearCholeskyFactorizationMIMO`

Symbols

  • backsteppinglocaloptimalmatchingglobalinverseoptimalMIMO
  • linearFactorSequential
ZigangPan`NonlinearCholeskyFactorizationMIMO`
backsteppinglocaloptimalmatchingglobalinverseoptimalMIMO
​
{
V
,
αn
,
qcheck
,
rcheck
}=backsteppinglocaloptimalmatchingglobalinverseoptimalMIMO[
f
,
g
,
h
,
qhat
,
r
,
γ
,
xc
,
m
,
{n1,n2,...,nn}
,
x1m
,
x1M
,
ϵ
,
SC
] calculates the locally optimal matching up to order
m
(a natural number) and globally inverse optimal control law for the MIMO system xc'[t] = f[xc] + g[xc] u + h[xc] w where
u
is
p
-dimensional control input and
w
is
q
-dimensional disturbance input, with cost function J =
t
∫
0
(qhat[xc[τ]]+u[τ].r[xc[τ]].u[τ]-γ^2w[τ].w[τ])τ
f[
xc] = {a1[x1] x2 + f1[x1], a2[x1,x2] x3 + f2[x1,x2], ... fn[x1,...,xn]} where
xiis
n
i
-dimensionalvector,
1≤
n
1
≤
n
2
≤⋯≤
n
n
≤p<∞
,
g[xc]=
0
n
1
p
,...,
0
n
n-1
p
,{bn[xc]}​​​​h[xc]={h1[x1],​​h2[x1,x2],​​...​​hn[x1,...,xn]}​​​​f
0
n
∑
j1
n
j
=
0
n
∑
j1
n
j
;​​​​a1[x1]isoffullrowrank;​​a2[x1,x2]isoffullrowrank;​​...​​​​bn[xc]isoffullrowrank;​​​​qhat[xc]ispositivedefinite,properwithleadingpositivedefinitequadraticapproximants​​​​r[xc]is
pp
-dimensionalpositivedefinitematrix,∀xc∈:=
∘
r
x1m,x1M
×
n
∑
i=2
n
i

​​​​x1misa
n
1
-dimensionalconstantvector​​x1Misa
n
1
-dimensionalconstantvector​​x1m⩽
0
n
1
⩽x1M
​
γ
> 0
ϵ
> 0
SC
: a Boolean variable.
xc
= {x1,x2,...,xn}. All functions are assumed to be formulas rather than functions The returned variables:
V
= the formula of the resulting value function.
αn
= the formula of the resulting control law.
qcheck
= the formula of the resulting weighting function on state variables.
rcheck
= the formula of the resulting weighting function on the control variables. When
SC
=True,
αn
,
qcheck
, and
rcheck
are smooth functions. When
SC
=False, these functions are only locally Lipschitz continuous. This function subsumes the four functions in the paclet ZigangPan`NonlinearCholeskyFactorization`: backsteppinglocaloptimalmatchingglobalinverseoptimal backsteppinglocaloptimalmatchingglobalinverseoptimalN backsteppinglocaloptimalmatchingglobalinverseoptimalNew backsteppinglocaloptimalmatchingglobalinverseoptimalNNew as special cases. The capability to design smooth control law is a new feature.
​
Examples  
(1)
Basic Examples  
(1)
In[1]:=
f={x2+x3+x4,-x1+x1^2-x3+x4,-x1-x3,-x2-x4};
In[2]:=
g={{0,0},{0,0},{1,x2},{-x2,1}};
In[3]:=
h={{1,0},{0,1},{0,0},{0,0}}
Out[3]=
{{1,0},{0,1},{0,0},{0,0}}
In[4]:=
qhat=x1^2+x2^2+x3^2+x4^2;r=IdentityMatrix[2]
Out[4]=
{{1,0},{0,1}}
In[5]:=
x1m={-Infinity,-Infinity};x1M={Infinity,Infinity};
In[6]:=
γ=2
Out[6]=
2
In[7]:=
xc={x1,x2,x3,x4}
Out[7]=
{x1,x2,x3,x4}
In[8]:=
nlsystem={xc,{u1,u2,w1,w2},Join[{y1,y2,y3,y4,z1,z2,z3,z4,z5,z6}],{FormulaToFunction[Join[xc,{u1,u2,w1,w2}],f+g.{u1,u2}+h.{w1,w2}],FormulaToFunction[Join[xc,{u1,u2,w1,w2}],{x1,x2,x3,x4,x1,x2,x3,x4,u1,u2}]},{1,2},{},{1,2},{3,4},{1,2,3,4},{5,6,7,8,9,10}}
Out[8]=
{{x1,x2,x3,x4},{u1,u2,w1,w2},{y1,y2,y3,y4,z1,z2,z3,z4,z5,z6},{Function[{x1,x2,x3,x4,u1,u2,w1,w2},{w1+x2+x3+x4,w2-x1+
2
x1
-x3+x4,u1-x1+u2x2-x3,u2-x2-u1x2-x4}],Function[{x1,x2,x3,x4,u1,u2,w1,w2},{x1,x2,x3,x4,x1,x2,x3,x4,u1,u2}]},{1,2},{},{1,2},{3,4},{1,2,3,4},{5,6,7,8,9,10}}
In[9]:=
Va2=approximateHJIequation[f,(g.Inverse[r].Transpose[g]-h.Transpose[h]/γ^2)/4,qhat,xc,2]
Out[9]=
1.3279960796415705957959144606893692174354347621778
2
x1
+1.3279960796415705957959144606893692174354347621778
2
x2
+0.95864724879449000301768096905120855138966725905995x1x3-1.0049776339522068617657932214298995796894682578026x2x3+1.0209370152900697609038233237234845982591297973183
2
x3
+1.0049776339522068617657932214298995796894682578026x1x4+0.95864724879449000301768096905120855138966725905995x2x4+1.0209370152900697609038233237234845982591297973183
2
x4
In[10]:=
approximatenonlinearCholeskyfactorization[Va2,xc〚4;;1;;-1〛,2]
Out[10]=
{{Function[{zl1,zl2,zl3,zl4},1.0209370152900697609038233237234845982591297973183],Function[{zl2,zl3,zl4},1.0209370152900697609038233237234845982591297973183],Function[{zl3,zl4},0.855639665025396783256209836754720413904946876272],Function[{zl4},0.855639665025396783256209836754720413904946876272]},{0.49218395400556198760587093525286486621433053068883x1+0.46949382500453178293663344349754520365791471426778x2+x4,0.46949382500453178293663344349754520365791471426778x1-0.49218395400556198760587093525286486621433053068883x2+x3,x2,x1}}
In[11]:=
m=1;
In[12]:=
nvec={2,2}
Out[12]=
{2,2}
In[13]:=
ϵ=m;
In[14]:=
{V,controllaw,qcheck,rcheck}=
backsteppinglocaloptimalmatchingglobalinverseoptimalMIMO
[f,g,h,qhat,r,​​γ,xc,m,nvec,x1m,x1M,ϵ,False];
Please check Assumption 8.29! This program will assume that Assumption 8.29 holds!
In[15]:=
controller={{},{y1,y2,y3,y4},{u1,u2},{FormulaToFunction[{y1,y2,y3,y4},{}],FormulaToFunction[xc,controllaw]},{1,2,3,4},{1,2},{1,2,3,4},{},{1,2},{}};
In[16]:=
disturbancesystem={{},{z1,z2,z3,z4,z5,z6},{w1,w2},{FormulaToFunction[{x1,x2,x3,x4,u1,u2},{}],FormulaToFunction[{x1,x2,x3,x4,u1,u2},{0,0}]},{1,2,3,4,5,6},{1,2},{1,2,3,4,5,6},{},{1,2},{}};
In[17]:=
{
systemstates
,
controllerstates
,
disturbancestates
,
controlinput
,
disturbanceinput
,
measurementoutput
,
controlledoutput
,
controllersignals
}=simulationNLsystem[
nlsystem
,{0.7,0.6,0.5,0.4},
controller
,{},
disturbancesystem
,{},0,10,Command"RungeKutta45",StartingStepSize1/100];
No direct feedthrough in first system!
No direct feedthrough in first system!
10% completed.
20% completed.
30% completed.
40% completed.
50% completed.
60% completed.
70% completed.
80% completed.
90% completed.
100% completed.
In[18]:=
Plot[{systemstates[t]〚1〛,systemstates[t]〚2〛,systemstates[t]〚3〛,systemstates[t]〚4〛},{t,0,10},PlotRange{-0.7,1.1}]
Out[18]=
In[19]:=
Plot[{controlinput[t]〚1〛,controlinput[t]〚2〛},{t,0,10},PlotRange{-2.8,2}]
Out[19]=

© 2025 Wolfram. All rights reserved.

  • Legal & Privacy Policy
  • Contact Us
  • WolframAlpha.com
  • WolframCloud.com