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

NonlinearSystems

Guides

  • Guide to ZigangPan`NonlinearSystems`

Symbols

  • convert2NLsystem
  • emptyNLsystem
  • linearization
  • NLcalculaterelativedegree
  • NLdynamicextension
  • NLsystemblockdiagonal
  • NLsystemcheck
  • NLsystemconcatenate
  • NLsystemfeedback
  • NLsystemoperation
  • NLsystemparallel
  • simulationNLsystem
  • sinewavesystem
ZigangPan`NonlinearSystems`
simulationNLsystem
​
{systemstates,controllerstates,disturbancestates,controlinput,disturbanceinput,measurementoutput,controlledoutput,controllersignals}=simulationNLsystem[nlsystem,ICsystem,controller,ICcontroller,disturbancedynamics,ICdisturbance,t0,tf,opts]
simulates a nonlinear
nlsystem
with control inputs calculated via the nonlinear
controller
with the measurementoutputs of the
nlsystem
as input, and the disturbance inputs calculated via the nonlinear
disturbancedynamics
with the controlledoutputs of
nlsystem
as input. The initial condition for
nlsystem
,
controller
, and
disturbancedynamics
are
ICsystem
,
ICcontroller
, and
ICdisturbance
, respectively. The simulation is done from
t0
to
tf
. The result are pure functions (of time) the
systemstates
of
nlsystem
,
controllerstates
of
controller
,
disturbancestates
of
disturbancedynamics
,
controlinput
of
nlsystem
,
disturbanceinput
of
nlsystem
,
measurementoutput
of
nlsystem
,
controlledoutput
of
nlsystem
, and
controllersignals
(controlledoutputs of
controller
). The options are almost the same as NDSolve with the additional option of Command and HighOrder. If Command->"nflow", then NDSolve is the solver. If Command -> "RungeKutta45", then ZigangPan`DifferentialEquationSolver`RungeKutta45 function is used. If Command->"HDRungeKutta", then ZigangPan`DifferentialEquationSolver`HDRungeKutta function is used, where one can further specify the desired order with the option HighOrder. (Default for Command is "nflow", and default for HighOrder is 10.)
​
Details and Options

Examples  
(1)
Basic Examples  
(1)
In[1]:=
Needs["CompiledFunctionTools`"]
In[2]:=
system={{x1,x2,x3},{u1,u2,w1,w2},{y1,y2,z1,z2,z3,z4},{{-1,2,0,0,0,0,1},{-2,-1,1,1,1,1,0},{-1,-2,-3,-1,1,1,1},{1,0,0,0,0,1,0},{0,1,0,0,0,0,1},{1,0,0,0,0,0,0},{0,1,0,0,0,0,0},{0,0,0,1,0,0,0},{0,0,0,0,1,0,0}},{1,2},{1,2},{1,2},{3,4},{1,2},{3,4,5,6}};
In[3]:=
controllercanonicalform[system]
State transformation is xold = transformation.xnew
Out[3]=
True,3,{2,1},
1
2
,0,0,-
1
2
,1,0,
1
4
,
1
2
,
1
2
,{x11,x21,x31},{u1,u2,w1,w2},{y1,y2,z1,z2,z3,z4},{0,1,0,0,0,0,2},-
7
4
,
3
2
,
1
2
,1,1,1,1,
11
4
,-
21
2
,-
7
2
,0,1,1,0,
1
2
,0,0,0,0,1,0,-
1
2
,1,0,0,0,0,1,
1
2
,0,0,0,0,0,0,-
1
2
,1,0,0,0,0,0,{0,0,0,1,0,0,0},{0,0,0,0,1,0,0},{1,2},{1,2},{1,2},{3,4},{1,2},{3,4,5,6}
In[4]:=
observercanonicalform[system]
State transformation is xold = transformation.xnew
Out[4]=
{True,3,{1,2},{{1,0,0},{0,1,0},{2,-3,1}},{{x11,x21,x31},{u1,u2,w1,w2},{y1,y2,z1,z2,z3,z4},{{-1,2,0,0,0,0,1},{0,-4,1,1,1,1,0},{-5,-9,0,2,4,4,-1},{1,0,0,0,0,1,0},{0,1,0,0,0,0,1},{1,0,0,0,0,0,0},{0,1,0,0,0,0,0},{0,0,0,1,0,0,0},{0,0,0,0,1,0,0}},{1,2},{1,2},{1,2},{3,4},{1,2},{3,4,5,6}}}
In[5]:=
controller={{x1chk,x2chk,x3chk},{y1,y2},{u1,u2},{{-1,1,0,0,1},{-3.10435524768601717601478123947250050901414947573562597081149648344045608933637`51.311650143049405,-1.73594839077805689119557680477137097298363219953713265816251606649319570015058`50.306147744584955,0.87814241965773732109556902688379333054621868686817461835777160853466365674909`50.73865164041571,1,0},{-1.95288711515437031578579767913036750545880308231146871406496998449400271469585`51.110355869039225,-3.12185758034226267890443097311620666945378131313182538164222839146533634325091`50.56102402158889,-3.03843496169831682910376664319936817618033748062912955416207929122130081677137`51.27773662829537,1,1},{-0.07573406626582343011449178017106650177767319671207862837326324947322668732026`50.,-0.30704540521789710614557291582758215176492544320265363826014383751392967844984`49.85484353342589,-0.04171130932197292490033216495841924663672191625134791374007455012201776323977`49.71637050194081,0,0},{-0.02862118142019374590028945930143400723647627902354734243823323396722940201612`49.57739628120991,-0.42890298556015978505000388894378882121870675633447901990237222897926602170074`50.,-0.08014627102028975400409880815778742281705939688047746790215384134331858001114`50.,0,0}},{1,2},{1,2},{1,2},{},{1,2},{}};
In[6]:=
disturbancedynamics=gainsystem[Table[0,{i,2},{j,4}]]
Out[6]=
{{},{tempinput1,tempinput2,tempinput3,tempinput4},{tempoutput1,tempoutput2},{{0,0,0,0},{0,0,0,0}},{1,2,3,4},{1,2},{1,2,3,4},{},{1,2},{}}
In[7]:=
{systemstates,controllerstates,disturbancestates,controlinput,​​disturbanceinput,measurementoutput,controlledoutput,​​controllersignals}=
simulationNLsystem

convert2NLsystem
[system],{1,0,-1},
convert2NLsystem
[controller],​​{0,0,0},
convert2NLsystem
[disturbancedynamics],{},0,20,Command"nflow"
No direct feedthrough in first system!
No direct feedthrough in first system!
Out[7]=
{ZigangPan`Private`systemstates$142064,ZigangPan`Private`controllerstates$142064,ZigangPan`Private`disturbancestates$142064,ZigangPan`Private`controlinput$142064,ZigangPan`Private`disturbanceinput$142064,ZigangPan`Private`measurementoutput$142064,ZigangPan`Private`controlledoutput$142064,ZigangPan`Private`controllersignals$142064}
In[8]:=
Plot[systemstates[t],{t,0,20},PlotRangeAll]
Out[8]=
In[9]:=
Plot[controllerstates[t],{t,0,20},PlotRangeAll]
Out[9]=
In[10]:=
Plot[disturbancestates[t],{t,0,20}]
Out[10]=
5
10
15
20
-1.0
-0.5
0.5
1.0
In[11]:=
{systemstates,controllerstates,disturbancestates,controlinput,​​disturbanceinput,measurementoutput,controlledoutput,​​controllersignals}=
simulationNLsystem

convert2NLsystem
[system],{1,0,-1},
convert2NLsystem
[controller],​​{0,0,0},
convert2NLsystem
[disturbancedynamics],{},0,20,Command"RungeKutta45",StartingStepSize0.1
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.
Out[11]=
{ZigangPan`Private`systemstates$142398,ZigangPan`Private`controllerstates$142398,ZigangPan`Private`disturbancestates$142398,ZigangPan`Private`controlinput$142398,ZigangPan`Private`disturbanceinput$142398,ZigangPan`Private`measurementoutput$142398,ZigangPan`Private`controlledoutput$142398,ZigangPan`Private`controllersignals$142398}
In[12]:=
Plot[systemstates[t],{t,0,20},PlotRangeAll]
Out[12]=
In[13]:=
Plot[controllerstates[t],{t,0,20},PlotRangeAll]
Out[13]=

© 2025 Wolfram. All rights reserved.

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