<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mintoc.de/index.php?action=history&amp;feed=atom&amp;title=Bioreactor_%28ACADO%29</id>
	<title>Bioreactor (ACADO) - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mintoc.de/index.php?action=history&amp;feed=atom&amp;title=Bioreactor_%28ACADO%29"/>
	<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Bioreactor_(ACADO)&amp;action=history"/>
	<updated>2026-06-09T08:04:28Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://mintoc.de/index.php?title=Bioreactor_(ACADO)&amp;diff=1627&amp;oldid=prev</id>
		<title>FelixMueller at 17:48, 31 January 2016</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Bioreactor_(ACADO)&amp;diff=1627&amp;oldid=prev"/>
		<updated>2016-01-31T17:48:12Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 17:48, 31 January 2016&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This is the implementation of the ACADO &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;bioreactor &lt;/del&gt;example with the matlab interface and the code generation of ACADO.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This is the implementation of the ACADO &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Bioreactor]] &lt;/ins&gt;example with the matlab interface and the code generation of ACADO.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>FelixMueller</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Bioreactor_(ACADO)&amp;diff=1620&amp;oldid=prev</id>
		<title>FelixMueller at 17:27, 31 January 2016</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Bioreactor_(ACADO)&amp;diff=1620&amp;oldid=prev"/>
		<updated>2016-01-31T17:27:50Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 17:27, 31 January 2016&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This is the implementation of the ACADO bioreactor example with the matlab interface and the code generation of ACADO.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This is the implementation of the ACADO bioreactor example with the matlab interface and the code generation of ACADO.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;source lang=&quot;Matlab&quot;&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  % implements the bioreactor example of ACADO for the matlab interface and&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  % implements the bioreactor example of ACADO for the matlab interface and&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  % the code generation&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  % the code generation&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l148&quot;&gt;Line 148:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 150:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  ylabel(&amp;#039;Sf&amp;#039;)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  ylabel(&amp;#039;Sf&amp;#039;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  xlabel(&amp;#039;Time&amp;#039;)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  xlabel(&amp;#039;Time&amp;#039;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/source&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category: ACADO]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>FelixMueller</name></author>
	</entry>
	<entry>
		<id>https://mintoc.de/index.php?title=Bioreactor_(ACADO)&amp;diff=1073&amp;oldid=prev</id>
		<title>FelixMueller: Created page with &quot;This is the implementation of the ACADO bioreactor example with the matlab interface and the code generation of ACADO.   % implements the bioreactor example of ACADO for the m...&quot;</title>
		<link rel="alternate" type="text/html" href="https://mintoc.de/index.php?title=Bioreactor_(ACADO)&amp;diff=1073&amp;oldid=prev"/>
		<updated>2015-12-26T19:23:04Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;This is the implementation of the ACADO bioreactor example with the matlab interface and the code generation of ACADO.   % implements the bioreactor example of ACADO for the m...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This is the implementation of the ACADO bioreactor example with the matlab interface and the code generation of ACADO.&lt;br /&gt;
&lt;br /&gt;
 % implements the bioreactor example of ACADO for the matlab interface and&lt;br /&gt;
 % the code generation&lt;br /&gt;
 &lt;br /&gt;
 clc;&lt;br /&gt;
 clear all;&lt;br /&gt;
 close all;&lt;br /&gt;
 &lt;br /&gt;
 Ts = 0.1;&lt;br /&gt;
 EXPORT = 1;&lt;br /&gt;
 &lt;br /&gt;
 %% Variables&lt;br /&gt;
 DifferentialState X S P;&lt;br /&gt;
 Control Sf;&lt;br /&gt;
 &lt;br /&gt;
 n_XD = length(diffStates);&lt;br /&gt;
 n_U = length(controls);&lt;br /&gt;
 &lt;br /&gt;
 %% Constants&lt;br /&gt;
 D       = 0.15;&lt;br /&gt;
 Ki      = 22.0;&lt;br /&gt;
 Km      = 1.2 ; &lt;br /&gt;
 Pm      = 50.0;&lt;br /&gt;
 Yxs     = 0.4 ;&lt;br /&gt;
 alpha   = 2.2 ;&lt;br /&gt;
 beta    = 0.2 ;&lt;br /&gt;
 mum     = 0.48;&lt;br /&gt;
 Sfmin   = 28.7;&lt;br /&gt;
 Sfmax   = 40.0;&lt;br /&gt;
 t_start =  0.0;&lt;br /&gt;
 t_end   = 48.0;&lt;br /&gt;
 N = 20;&lt;br /&gt;
 &lt;br /&gt;
 %% Differential Equation&lt;br /&gt;
 mu = mum*(1-P/Pm)*S/(Km+S+S^2/Ki);&lt;br /&gt;
 &lt;br /&gt;
 f = dot([X;S;P]) == [-D*X+mu*X;...&lt;br /&gt;
                       D*(Sf-S)-(mu/Yxs)*X;...&lt;br /&gt;
 		             -D*P+(alpha*mu+beta)*X];&lt;br /&gt;
 &lt;br /&gt;
 % output&lt;br /&gt;
 h = P-Sf;&lt;br /&gt;
 hN = P;&lt;br /&gt;
 &lt;br /&gt;
 %% MPCexport&lt;br /&gt;
 acadoSet(&amp;#039;problemname&amp;#039;, &amp;#039;mpc&amp;#039;);&lt;br /&gt;
 &lt;br /&gt;
 ocp = acado.OCP( t_start, t_end, N );&lt;br /&gt;
 &lt;br /&gt;
 W_mat = D;&lt;br /&gt;
 WN_mat = D;&lt;br /&gt;
 W = acado.BMatrix(W_mat);&lt;br /&gt;
 WN = acado.BMatrix(WN_mat);&lt;br /&gt;
 &lt;br /&gt;
 ocp.minimizeLSQ( W, h );&lt;br /&gt;
 ocp.minimizeLSQEndTerm( WN, hN );&lt;br /&gt;
 &lt;br /&gt;
 ocp.subjectTo( Sfmin &amp;lt;= Sf &amp;lt;= Sfmax );&lt;br /&gt;
 ocp.setModel(f);&lt;br /&gt;
 &lt;br /&gt;
 mpc = acado.OCPexport( ocp );&lt;br /&gt;
 mpc.set( &amp;#039;HESSIAN_APPROXIMATION&amp;#039;,       &amp;#039;GAUSS_NEWTON&amp;#039;      );&lt;br /&gt;
 mpc.set( &amp;#039;DISCRETIZATION_TYPE&amp;#039;,         &amp;#039;MULTIPLE_SHOOTING&amp;#039; );&lt;br /&gt;
 mpc.set( &amp;#039;SPARSE_QP_SOLUTION&amp;#039;,          &amp;#039;FULL_CONDENSING_N2&amp;#039;);&lt;br /&gt;
 mpc.set( &amp;#039;INTEGRATOR_TYPE&amp;#039;,             &amp;#039;INT_IRK_GL4&amp;#039;       );&lt;br /&gt;
 mpc.set( &amp;#039;NUM_INTEGRATOR_STEPS&amp;#039;,        10*N                 );&lt;br /&gt;
 mpc.set( &amp;#039;QP_SOLVER&amp;#039;,                   &amp;#039;QP_QPOASES&amp;#039;    	);&lt;br /&gt;
 mpc.set( &amp;#039;HOTSTART_QP&amp;#039;,                 &amp;#039;NO&amp;#039;             	);&lt;br /&gt;
 mpc.set( &amp;#039;LEVENBERG_MARQUARDT&amp;#039;, 		 1e-10				);&lt;br /&gt;
 &lt;br /&gt;
 if EXPORT&lt;br /&gt;
     mpc.exportCode( &amp;#039;export_MPC&amp;#039; );&lt;br /&gt;
     copyfile(&amp;#039;../../../../../../external_packages/qpoases&amp;#039;, &amp;#039;export_MPC/qpoases&amp;#039;)&lt;br /&gt;
     &lt;br /&gt;
     cd export_MPC&lt;br /&gt;
     make_acado_solver(&amp;#039;../acado_MPCstep&amp;#039;)&lt;br /&gt;
     cd ..&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 %% CONSTANTS FOR OPTIMIZATION&lt;br /&gt;
 X0 = [6.5 12.0 22.0];&lt;br /&gt;
 input.x0=X0&amp;#039;;&lt;br /&gt;
 Xref = [0 0 0];&lt;br /&gt;
 input.x = repmat(Xref,N+1,1);&lt;br /&gt;
 Xref = repmat(Xref,N,1);&lt;br /&gt;
 input.od = [];&lt;br /&gt;
 &lt;br /&gt;
 Uref = zeros(N,n_U);&lt;br /&gt;
 input.u = Uref;&lt;br /&gt;
 &lt;br /&gt;
 input.y = 0*ones(N,1);&lt;br /&gt;
 input.yN = 0;&lt;br /&gt;
 &lt;br /&gt;
 input.W = D;&lt;br /&gt;
 input.WN = D;&lt;br /&gt;
 &lt;br /&gt;
 %% SOLVER LOOP (SQP - Gauss newton)&lt;br /&gt;
 display(&amp;#039;------------------------------------------------------------------&amp;#039;)&lt;br /&gt;
 display(&amp;#039;               SOLVER Loop&amp;#039;                                    )&lt;br /&gt;
 display(&amp;#039;------------------------------------------------------------------&amp;#039;)&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 for i=1:20&lt;br /&gt;
     tic&lt;br /&gt;
     % Solve NMPC OCP&lt;br /&gt;
     output = acado_MPCstep(input);&lt;br /&gt;
     &lt;br /&gt;
     input.x=output.x;&lt;br /&gt;
     input.u=output.u;&lt;br /&gt;
 &lt;br /&gt;
     disp([&amp;#039; (RTI step: &amp;#039; num2str(output.info.cpuTime*1e6) &amp;#039; µs)&amp;#039;])&lt;br /&gt;
 &lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 %% PLOT RESULTS&lt;br /&gt;
 &lt;br /&gt;
 % States&lt;br /&gt;
 figure(1)&lt;br /&gt;
 plot([t_start:t_end/N:t_end],output.x)&lt;br /&gt;
 ylabel(&amp;#039;States&amp;#039;)&lt;br /&gt;
 xlabel(&amp;#039;Time&amp;#039;)&lt;br /&gt;
 legend(&amp;#039;X&amp;#039;,&amp;#039;S&amp;#039;,&amp;#039;P&amp;#039;)&lt;br /&gt;
 &lt;br /&gt;
 % Control&lt;br /&gt;
 figure(2)&lt;br /&gt;
 plot([t_start:t_end/N:t_end-t_end/N],output.u)&lt;br /&gt;
 ylabel(&amp;#039;Control (Sf)&amp;#039;)&lt;br /&gt;
 xlabel(&amp;#039;Time&amp;#039;)&lt;br /&gt;
 &lt;br /&gt;
 % one figure for all&lt;br /&gt;
 figure(3)&lt;br /&gt;
 subplot(2,2,1)&lt;br /&gt;
 plot([t_start:t_end/N:t_end],output.x(:,1))&lt;br /&gt;
 ylabel(&amp;#039;X&amp;#039;)&lt;br /&gt;
 xlabel(&amp;#039;Time&amp;#039;)&lt;br /&gt;
 subplot(2,2,2)&lt;br /&gt;
 plot([t_start:t_end/N:t_end],output.x(:,2))&lt;br /&gt;
 ylabel(&amp;#039;S&amp;#039;)&lt;br /&gt;
 xlabel(&amp;#039;Time&amp;#039;)&lt;br /&gt;
 subplot(2,2,3)&lt;br /&gt;
 plot([t_start:t_end/N:t_end],output.x(:,3))&lt;br /&gt;
 ylabel(&amp;#039;P&amp;#039;)&lt;br /&gt;
 xlabel(&amp;#039;Time&amp;#039;)&lt;br /&gt;
 subplot(2,2,4)&lt;br /&gt;
 plot([t_start:t_end/N:t_end-t_end/N],output.u)&lt;br /&gt;
 ylabel(&amp;#039;Sf&amp;#039;)&lt;br /&gt;
 xlabel(&amp;#039;Time&amp;#039;)&lt;/div&gt;</summary>
		<author><name>FelixMueller</name></author>
	</entry>
</feed>