Ball and Beam Model

Model of a ball and beam system

Examples

Basic Examples (2) 

Retrieve the model:

In[1]:=
ResourceData[\!\(\*
TagBox["\"\<Ball and Beam Model\>\"",
#& ,
BoxID -> "ResourceTag-Ball and Beam Model-Input",
AutoDelete->True]\)]
Out[1]=

The icon:

In[2]:=
ResourceData[\!\(\*
TagBox["\"\<Ball and Beam Model\>\"",
#& ,
BoxID -> "ResourceTag-Ball and Beam Model-Input",
AutoDelete->True]\), "Icon"]
Out[2]=

Scope & Additional Elements (4) 

Available content elements:

In[3]:=
\!\(\*
TagBox[
RowBox[{"ResourceObject", "[", "\"\<Ball and Beam Model\>\"", "]"}],
#& ,
BoxID -> "ResourceTag-Ball and Beam Model-Input",
AutoDelete->True]\)["ContentElements"]
Out[3]=

The available model types:

In[4]:=
ResourceData[\!\(\*
TagBox["\"\<Ball and Beam Model\>\"",
#& ,
BoxID -> "ResourceTag-Ball and Beam Model-Input",
AutoDelete->True]\), "AvailableModelTypes"]
Out[4]=

The operating point:

In[5]:=
ResourceData[\!\(\*
TagBox["\"\<Ball and Beam Model\>\"",
#& ,
BoxID -> "ResourceTag-Ball and Beam Model-Input",
AutoDelete->True]\), "OperatingPoint"]
Out[5]=

The parameters:

In[6]:=
ResourceData[\!\(\*
TagBox["\"\<Ball and Beam Model\>\"",
#& ,
BoxID -> "ResourceTag-Ball and Beam Model-Input",
AutoDelete->True]\), "Parameters"]
Out[6]=

Analysis (5) 

The numerical model:

In[7]:=
assm = AffineStateSpaceModel[ResourceData[\!\(\*
TagBox["\"\<Ball and Beam Model\>\"",
#& ,
BoxID -> "ResourceTag-Ball and Beam Model-Input",
AutoDelete->True]\)] /. ResourceData[\!\(\*
TagBox["\"\<Ball and Beam Model\>\"",
#& ,
BoxID -> "ResourceTag-Ball and Beam Model-Input",
AutoDelete->True]\), "Parameters"], Automatic, Automatic, Automatic, None]
Out[7]=

Without feedback control, the system is not balanced:

In[8]:=
OutputResponse[{assm, {0.1}}, {0, 0}, {t, 0, 3}];
Plot[%[[1]], {t, 0, 3}, PlotRange -> All]
Out[9]=

A system specification for the control design:

In[10]:=
sspec = <|"InputModel" -> assm, "FeedbackInputs" -> 2|>;

Compute an LQR controller that balances the system:

In[11]:=
lqr = LQRegulatorGains[sspec, {( {
     {1, 0, 0, 0},
     {0, 1, 0, 0},
     {0, 0, 10, 0},
     {0, 0, 0, 1}
    } ), {{1}}}, "Data"]
Out[11]=

The closed-loop system is balanced:

In[12]:=
OutputResponse[{lqr["ClosedLoopSystem"], {0.1}}, {0, 0}, {t, 0, 6}];
Plot[%, {t, 0, 6}, PlotRange -> All, PlotLegends -> {r, \[Theta]}]
Out[13]=

Suba Thomas, "Ball and Beam Model" from the Wolfram Data Repository (2025)  

Data Resource History

Source Metadata

Publisher Information