<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://tomwiki.com/index.php?action=history&amp;feed=atom&amp;title=PROPT_Room_temperature_control</id>
	<title>PROPT Room temperature control - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://tomwiki.com/index.php?action=history&amp;feed=atom&amp;title=PROPT_Room_temperature_control"/>
	<link rel="alternate" type="text/html" href="http://tomwiki.com/index.php?title=PROPT_Room_temperature_control&amp;action=history"/>
	<updated>2026-11-03T04:15:23Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.1</generator>
	<entry>
		<id>http://tomwiki.com/index.php?title=PROPT_Room_temperature_control&amp;diff=2734&amp;oldid=prev</id>
		<title>Per at 09:27, 14 February 2012</title>
		<link rel="alternate" type="text/html" href="http://tomwiki.com/index.php?title=PROPT_Room_temperature_control&amp;diff=2734&amp;oldid=prev"/>
		<updated>2012-02-14T09:27:27Z</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 04:27, 14 February 2012&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-l132&quot;&gt;Line 132:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 132:&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;div&gt;[[File:temperatureControlatNight_03.png]]&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;[[File:temperatureControlatNight_03.png]]&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:PROPT Examples]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Per</name></author>
	</entry>
	<entry>
		<id>http://tomwiki.com/index.php?title=PROPT_Room_temperature_control&amp;diff=2056&amp;oldid=prev</id>
		<title>Mbot: Created page with &quot;{{Part Of Manual|title=the PROPT Manual|link=PROPT Manual}}  ==Problem Description==  Temperature control from 0.00 to 7.00 hours at night. Finds best heating policy at...&quot;</title>
		<link rel="alternate" type="text/html" href="http://tomwiki.com/index.php?title=PROPT_Room_temperature_control&amp;diff=2056&amp;oldid=prev"/>
		<updated>2011-11-08T13:08:41Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{Part Of Manual|title=the PROPT Manual|link=&lt;a href=&quot;/index.php?title=PROPT&quot; title=&quot;PROPT&quot;&gt;PROPT Manual&lt;/a&gt;}}  ==Problem Description==  Temperature control from 0.00 to 7.00 hours at night. Finds best heating policy at...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Part Of Manual|title=the PROPT Manual|link=[[PROPT|PROPT Manual]]}}&lt;br /&gt;
&lt;br /&gt;
==Problem Description==&lt;br /&gt;
&lt;br /&gt;
Temperature control from 0.00 to 7.00 hours at night. Finds best heating policy at night that brings the temperature back to 20 [oC] in the morning irrespective of night temperatures.&lt;br /&gt;
&lt;br /&gt;
Programmers: Gerard Van Willigenburg (Wageningen University)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;matlab&amp;quot;&amp;gt;&lt;br /&gt;
% Copyright (c) 2007-2010 by Tomlab Optimization Inc.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Problem setup==&lt;br /&gt;
&lt;br /&gt;
Define tomSym variable t (time) and t_f (final time) if the final time is free&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;matlab&amp;quot;&amp;gt;&lt;br /&gt;
toms t; t_f=7; % Fixed final time&lt;br /&gt;
&lt;br /&gt;
for n=[20 40]&lt;br /&gt;
    % Define &amp;amp; set time axis&lt;br /&gt;
    p = tomPhase(&amp;#039;p&amp;#039;, t, 0, t_f, n);&lt;br /&gt;
    setPhase(p);&lt;br /&gt;
&lt;br /&gt;
    % Define the state and control variables&lt;br /&gt;
    tomStates x&lt;br /&gt;
    tomControls u&lt;br /&gt;
&lt;br /&gt;
    % Initial state&lt;br /&gt;
    xi=20;&lt;br /&gt;
&lt;br /&gt;
    % Initial guess&lt;br /&gt;
    if n==20&lt;br /&gt;
        x0 = {icollocate({x == xi(1)})&lt;br /&gt;
            collocate({u == 0})};&lt;br /&gt;
    else&lt;br /&gt;
        x0 = {icollocate({x == xopt})&lt;br /&gt;
            collocate({u == uopt})};&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    % Boundary conditions&lt;br /&gt;
    cbnd = {initial({x == xi}); final({x == xi})};&lt;br /&gt;
&lt;br /&gt;
    % Equality constraints: state-space differential equations&lt;br /&gt;
    tau=2; pH=0.002; % Parameters&lt;br /&gt;
&lt;br /&gt;
    % External input d1&lt;br /&gt;
    d1=15-10*sin(pi*t/t_f);&lt;br /&gt;
&lt;br /&gt;
    %Differential equation&lt;br /&gt;
    ceq = collocate({dot(x) == 1/tau*(d1-x) + pH*u});&lt;br /&gt;
&lt;br /&gt;
    % Inequality constraints&lt;br /&gt;
    cbox = {0 &amp;lt;= collocate(u) &amp;lt;= 3600; icollocate(x) &amp;gt;= 15};&lt;br /&gt;
&lt;br /&gt;
    % Cost function to be minimized&lt;br /&gt;
    objective = integrate(u+1e-6*dot(u)^2);&lt;br /&gt;
&lt;br /&gt;
    % Solve the problem after specifying its name&lt;br /&gt;
    options = struct;&lt;br /&gt;
    options.name = &amp;#039;Temperature control at night&amp;#039;;&lt;br /&gt;
    solution = ezsolve(objective, {cbox, cbnd, ceq}, x0, options);&lt;br /&gt;
&lt;br /&gt;
    % Plot intermediate solution&lt;br /&gt;
    figure; subplot(2,1,1);&lt;br /&gt;
    ezplot(x); legend(&amp;#039;x&amp;#039;);&lt;br /&gt;
    title(&amp;#039;State&amp;#039;);&lt;br /&gt;
&lt;br /&gt;
    subplot(2,1,2);&lt;br /&gt;
    ezplot(u); legend(&amp;#039;u&amp;#039;);&lt;br /&gt;
    title(&amp;#039;Optimal control&amp;#039;); drawnow;&lt;br /&gt;
&lt;br /&gt;
    % Obtain intermediate solution to initialize the next&lt;br /&gt;
    xopt = subs(x,solution);&lt;br /&gt;
    uopt = subs(u,solution);&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
% Obtain final solution t,x,...,u,..&lt;br /&gt;
% that overwrite the associated tomSym variables&lt;br /&gt;
t = subs(collocate(t),solution);&lt;br /&gt;
x = subs(collocate(x),solution);&lt;br /&gt;
u = subs(collocate(u),solution);&lt;br /&gt;
&lt;br /&gt;
%Plot results&lt;br /&gt;
figure; plot(t,x,t,u/100); axis([0 t_f -1 50]);&lt;br /&gt;
xlabel(&amp;#039;Time [h]&amp;#039;); ylabel(&amp;#039;Heat input, Inside &amp;amp; Outside temperature&amp;#039;);&lt;br /&gt;
title(&amp;#039;Optimal heating, outside temperature&amp;#039;);&lt;br /&gt;
legend(&amp;#039;Inside temp. [oC]&amp;#039;,&amp;#039;Outside temp. [oC]&amp;#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Problem type appears to be: qp&lt;br /&gt;
Time for symbolic processing: 0.048438 seconds&lt;br /&gt;
Starting numeric solver&lt;br /&gt;
===== * * * =================================================================== * * *&lt;br /&gt;
TOMLAB - TOMLAB Development license  999007. Valid to 2011-12-31&lt;br /&gt;
=====================================================================================&lt;br /&gt;
Problem:  1: Temperature control at night       f_k   12892.776351482817000000&lt;br /&gt;
                                       sum(|constr|)      0.000000000005229143&lt;br /&gt;
                              f(x_k) + sum(|constr|)  12892.776351482822000000&lt;br /&gt;
                                              f(x_0)      0.000000000000000000&lt;br /&gt;
&lt;br /&gt;
Solver: CPLEX.  EXIT=0.  INFORM=1.&lt;br /&gt;
CPLEX Barrier QP solver&lt;br /&gt;
Optimal solution found&lt;br /&gt;
&lt;br /&gt;
FuncEv   11 GradEv   11 ConstrEv   11 Iter   11 &lt;br /&gt;
Elapsed time: 0.004000 sec. &lt;br /&gt;
Problem type appears to be: qp&lt;br /&gt;
Time for symbolic processing: 0.048291 seconds&lt;br /&gt;
Starting numeric solver&lt;br /&gt;
===== * * * =================================================================== * * *&lt;br /&gt;
TOMLAB - TOMLAB Development license  999007. Valid to 2011-12-31&lt;br /&gt;
=====================================================================================&lt;br /&gt;
Problem:  1: Temperature control at night       f_k   12882.457402361473000000&lt;br /&gt;
                                       sum(|constr|)      0.000000014487930886&lt;br /&gt;
                              f(x_k) + sum(|constr|)  12882.457402375961000000&lt;br /&gt;
                                              f(x_0)      0.000000000000000000&lt;br /&gt;
&lt;br /&gt;
Solver: CPLEX.  EXIT=0.  INFORM=1.&lt;br /&gt;
CPLEX Barrier QP solver&lt;br /&gt;
Optimal solution found&lt;br /&gt;
&lt;br /&gt;
FuncEv   13 GradEv   13 ConstrEv   13 Iter   13 &lt;br /&gt;
Elapsed time: 0.006000 sec. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:temperatureControlatNight_01.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:temperatureControlatNight_02.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:temperatureControlatNight_03.png]]&lt;/div&gt;</summary>
		<author><name>Mbot</name></author>
	</entry>
</feed>