Jump to content

Cushioned Oscillation: Difference between revisions

From mintOC
MaxWolff (talk | contribs)
No edit summary
MaxWolff (talk | contribs)
No edit summary
Line 82: Line 82:
  Image:Ref_sol_plot_cushioned_oscillation.png| States and Controls
  Image:Ref_sol_plot_cushioned_oscillation.png| States and Controls
</gallery>
</gallery>


The OCP was solved within MATLAB R2015b, using the TOMLAB Optimization Package. PROPT reformulates such problems with the direct collocation approache and automatically finds a suiting solver included in the TOMLAB Optimization Package (in this case, SNOPT was used).
The OCP was solved within MATLAB R2015b, using the TOMLAB Optimization Package. PROPT reformulates such problems with the direct collocation approache and automatically finds a suiting solver included in the TOMLAB Optimization Package (in this case, SNOPT was used).


== Source Code ==
The MATLAB script can be found in:
[[Category:TomDyn/PROPT]] [[Cushioned Oscillation]]


[[Category:MIOCP]]
[[Category:MIOCP]]

Revision as of 23:32, 12 January 2016

The Cushioned Oscillation is a simplified model of time optimal "stopping" of an oscillating object attached to a spring by applying a control and moving it back into the relaxed position and no velocity.

Model formulation

An object with mass m is attached to a spring with stiffness constant c.

If the resetting spring force is proportional to the deviation x=x(t), an oscillation induced by an external force u(t) satisfies:


mv˙(t)+cx(t)=u(t) (which is equivalent to v˙(t)=1m(u(t)cx(t)))


where x(t) denotes the deviation to the relaxed position and v(t)=x˙(t) the velocity of the oscillating object.


Through external force, the object has been put into an initial state :


(x(0),v(0))=(x0,v0)


The goal is to reset position and velocity of the object as fast as possible, meaning:


(x(tf),v(tf))=(0,0),


with the objective function:


mintftf


Optimal Control Problem (OCP) Formulation

The above results in the following OCP


minx,v,u,tftfs.t.x˙(t)=v(t),t[0,tf]v˙(t)=1m(u(t)cx(t)),t[0,tf]x(0)=x0,v(0)=v0,x(tf)=0,v(tf)=0,ummu(t)umm,t[0,tf]

Parameters and Reference Solution

The following parameters were used, to create the reference solution below, with an almost optimal final time tf=16.66s:

m=10,

c=10,

x0=2,

v0=5,

umm=5



The OCP was solved within MATLAB R2015b, using the TOMLAB Optimization Package. PROPT reformulates such problems with the direct collocation approache and automatically finds a suiting solver included in the TOMLAB Optimization Package (in this case, SNOPT was used).



Source Code

The MATLAB script can be found in: Cushioned Oscillation