<?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=Quickguide_MAD_Problem</id>
	<title>Quickguide MAD Problem - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://tomwiki.com/index.php?action=history&amp;feed=atom&amp;title=Quickguide_MAD_Problem"/>
	<link rel="alternate" type="text/html" href="http://tomwiki.com/index.php?title=Quickguide_MAD_Problem&amp;action=history"/>
	<updated>2026-10-31T21:23:24Z</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=Quickguide_MAD_Problem&amp;diff=2537&amp;oldid=prev</id>
		<title>Elias at 22:35, 17 January 2012</title>
		<link rel="alternate" type="text/html" href="http://tomwiki.com/index.php?title=Quickguide_MAD_Problem&amp;diff=2537&amp;oldid=prev"/>
		<updated>2012-01-17T22:35:53Z</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 18:35, 17 January 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-l26&quot;&gt;Line 26:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 26:&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;Open the file for viewing, and execute madQG in Matlab.&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;Open the file for viewing, and execute madQG in Matlab.&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; 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;&amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;syntaxhighlight &lt;/del&gt;lang=&amp;quot;matlab&amp;quot;&amp;gt;&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;&amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;source &lt;/ins&gt;lang=&amp;quot;matlab&amp;quot;&amp;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;  % madQG are two examples for defining and solving nonlinear&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;  % madQG are two examples for defining and solving nonlinear&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;  % programming problems using TOMLAB /MAD&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;  % programming problems using TOMLAB /MAD&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-l58&quot;&gt;Line 58:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 58:&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;  Prob2.ADCons = -1; % Lagrangian function for the nonlinear constraints.&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;  Prob2.ADCons = -1; % Lagrangian function for the nonlinear constraints.&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;  Result2 = tomRun(&amp;#039;conopt&amp;#039;, Prob2, 1);  % Uses second order information.&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;  Result2 = tomRun(&amp;#039;conopt&amp;#039;, Prob2, 1);  % Uses second order information.&lt;/div&gt;&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;&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;syntaxhighlight&lt;/del&gt;&amp;gt;&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;&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;source&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Elias</name></author>
	</entry>
	<entry>
		<id>http://tomwiki.com/index.php?title=Quickguide_MAD_Problem&amp;diff=873&amp;oldid=prev</id>
		<title>Elias: Created page with &quot;{{Part Of Manual|title=the Quickguide Manual|link=Quickguide}} TOMLAB /MAD is a package for general automatic differentiation of Matlab code. Usage is applicable f...&quot;</title>
		<link rel="alternate" type="text/html" href="http://tomwiki.com/index.php?title=Quickguide_MAD_Problem&amp;diff=873&amp;oldid=prev"/>
		<updated>2011-08-11T10:25:42Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{Part Of Manual|title=the Quickguide Manual|link=&lt;a href=&quot;/index.php?title=Quickguide&quot; title=&quot;Quickguide&quot;&gt;Quickguide&lt;/a&gt;}} TOMLAB /MAD is a package for general automatic differentiation of Matlab code. Usage is applicable f...&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 Quickguide Manual|link=[[Quickguide|Quickguide]]}}&lt;br /&gt;
TOMLAB /MAD is a package for general automatic differentiation of Matlab code. Usage is applicable for any applications needing derivatives. The package can be used standalone or as part of &amp;lt;span class=&amp;quot;roman&amp;quot;&amp;gt;TOMLAB&amp;lt;/span&amp;gt; when floating point precision derivatives are needed.&lt;br /&gt;
&lt;br /&gt;
Following is a simple example of standalone use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 &amp;amp;gt;&amp;amp;gt; x = 1;&lt;br /&gt;
 &amp;amp;gt;&amp;amp;gt; x = fmad(x,1);&lt;br /&gt;
 &amp;amp;gt;&amp;amp;gt; y = sin(x);&lt;br /&gt;
 &amp;amp;gt;&amp;amp;gt; y&lt;br /&gt;
 &lt;br /&gt;
 value =&lt;br /&gt;
 &lt;br /&gt;
     0.8415&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 derivatives =&lt;br /&gt;
 &lt;br /&gt;
     0.5403&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An example problem with &amp;lt;span class=&amp;quot;roman&amp;quot;&amp;gt;TOMLAB&amp;lt;/span&amp;gt; is included in the guide. The following file defines and solves two problems in TOMLAB.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;File: &amp;#039;&amp;#039;&amp;#039;&amp;lt;span class=&amp;quot;roman&amp;quot;&amp;gt;tomlab/quickguide/madQG.m&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Open the file for viewing, and execute madQG in Matlab.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;matlab&amp;quot;&amp;gt;&lt;br /&gt;
 % madQG are two examples for defining and solving nonlinear&lt;br /&gt;
 % programming problems using TOMLAB /MAD&lt;br /&gt;
 &lt;br /&gt;
 Name = &amp;#039;RBB Problem&amp;#039;;&lt;br /&gt;
 x_0 = [-1.2 1]&amp;#039;;     % Starting values for the optimization&lt;br /&gt;
 x_L = [-10;-10];     % Lower bounds for x.&lt;br /&gt;
 x_U = [2;2];         % Upper bounds for x.&lt;br /&gt;
 fLowBnd = 0;         % Lower bound on function.&lt;br /&gt;
 &lt;br /&gt;
 c_L = -1000;         % Lower bound on nonlinear constraints.&lt;br /&gt;
 c_U = 0;             % Upper bound on nonlinear constraints.&lt;br /&gt;
 &lt;br /&gt;
 Prob1 = conAssign(&amp;#039;rbbQG_f&amp;#039;, [], [], [], x_L, x_U, Name, x_0,...&lt;br /&gt;
                 [], fLowBnd, [], [], [], &amp;#039;rbbQG_c&amp;#039;, [], [], [], c_L, c_U);&lt;br /&gt;
 &lt;br /&gt;
 Prob2 = conAssign(&amp;#039;rbbQG_f&amp;#039;, &amp;#039;rbbQG_g&amp;#039;, [], [], x_L, x_U, Name, x_0,...&lt;br /&gt;
                 [], fLowBnd, [], [], [], &amp;#039;rbbQG_c&amp;#039;, &amp;#039;rbbQG_dc&amp;#039;, [], [], c_L, c_U);&lt;br /&gt;
                              &lt;br /&gt;
 Prob1.Warning = 0;    % Turning off warnings.            &lt;br /&gt;
 Prob2.Warning = 0;    % Turning off warnings.            &lt;br /&gt;
             &lt;br /&gt;
 madinitglobals;&lt;br /&gt;
 Prob1.ADObj  = 1; % Gradient calculated&lt;br /&gt;
 Prob1.ADCons = 1; % Jacobian calculated&lt;br /&gt;
 Result1 = tomRun(&amp;#039;snopt&amp;#039;, Prob1, 1);  % Only uses first order information.&lt;br /&gt;
 &lt;br /&gt;
 madinitglobals;&lt;br /&gt;
 Prob2.CONOPT.options.LS2PTJ = 0;&lt;br /&gt;
 Prob2.ADObj  = -1; % Hessian calculated&lt;br /&gt;
 Prob2.ADCons = -1; % Lagrangian function for the nonlinear constraints.&lt;br /&gt;
 Result2 = tomRun(&amp;#039;conopt&amp;#039;, Prob2, 1);  % Uses second order information.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Elias</name></author>
	</entry>
</feed>