<?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=TomSym_Optimal_Pricing_and_Extraction_for_OPEC</id>
	<title>TomSym Optimal Pricing and Extraction for OPEC - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://tomwiki.com/index.php?action=history&amp;feed=atom&amp;title=TomSym_Optimal_Pricing_and_Extraction_for_OPEC"/>
	<link rel="alternate" type="text/html" href="http://tomwiki.com/index.php?title=TomSym_Optimal_Pricing_and_Extraction_for_OPEC&amp;action=history"/>
	<updated>2026-11-03T04:15:51Z</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=TomSym_Optimal_Pricing_and_Extraction_for_OPEC&amp;diff=2156&amp;oldid=prev</id>
		<title>Mbot at 13:34, 8 November 2011</title>
		<link rel="alternate" type="text/html" href="http://tomwiki.com/index.php?title=TomSym_Optimal_Pricing_and_Extraction_for_OPEC&amp;diff=2156&amp;oldid=prev"/>
		<updated>2011-11-08T13:34: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 08:34, 8 November 2011&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-l79&quot;&gt;Line 79:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 79:&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;&amp;lt;pre&amp;gt;&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;&amp;lt;pre&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;Problem type appears to be: lpcon&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;Problem type appears to be: lpcon&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;Time for symbolic processing: 0.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;18169 &lt;/del&gt;seconds&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;Time for symbolic processing: 0.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;18361 &lt;/ins&gt;seconds&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;Starting numeric solver&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;Starting numeric solver&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;===== * * * =================================================================== * * *&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;===== * * * =================================================================== * * *&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-l94&quot;&gt;Line 94:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 94:&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;FuncEv    1 ConstrEv   22 ConJacEv   22 Iter   19 MinorIter   74&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;FuncEv    1 ConstrEv   22 ConJacEv   22 Iter   19 MinorIter   74&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;CPU time: 0.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;015600 &lt;/del&gt;sec. Elapsed time: 0.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;025000 &lt;/del&gt;sec.  &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;CPU time: 0.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;031200 &lt;/ins&gt;sec. Elapsed time: 0.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;024000 &lt;/ins&gt;sec.  &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;div&gt;&amp;lt;/pre&amp;gt;&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;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Mbot</name></author>
	</entry>
	<entry>
		<id>http://tomwiki.com/index.php?title=TomSym_Optimal_Pricing_and_Extraction_for_OPEC&amp;diff=1639&amp;oldid=prev</id>
		<title>Mbot: Created page with &quot;{{Part Of Manual|title=the TomSym Manual|link=TomSym Manual}}  TomSym implementation of GAMS Example (PINDYCK,SEQ=28)  This model finds the optimal pricing and extract...&quot;</title>
		<link rel="alternate" type="text/html" href="http://tomwiki.com/index.php?title=TomSym_Optimal_Pricing_and_Extraction_for_OPEC&amp;diff=1639&amp;oldid=prev"/>
		<updated>2011-11-02T21:02:34Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{Part Of Manual|title=the TomSym Manual|link=&lt;a href=&quot;/index.php?title=TomSym&quot; title=&quot;TomSym&quot;&gt;TomSym Manual&lt;/a&gt;}}  TomSym implementation of GAMS Example (PINDYCK,SEQ=28)  This model finds the optimal pricing and extract...&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 TomSym Manual|link=[[TomSym|TomSym Manual]]}}&lt;br /&gt;
&lt;br /&gt;
TomSym implementation of GAMS Example (PINDYCK,SEQ=28)&lt;br /&gt;
&lt;br /&gt;
This model finds the optimal pricing and extraction of oil for the OPEC cartel.&lt;br /&gt;
&lt;br /&gt;
Pindyck, R S, Gains to Producers from the Cartelization of Exhaustible Resources. Review of Economics and Statistics 60 (1978), 238-251.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;matlab&amp;quot;&amp;gt;&lt;br /&gt;
t  = (1:17)&amp;#039;;&lt;br /&gt;
&lt;br /&gt;
% demand(t) equilibrium world demand for fixed prices&lt;br /&gt;
demand = 1+2.3*1.015.^(t-1);&lt;br /&gt;
&lt;br /&gt;
% Due to a bug in the Matlab syntax, the parser cannot know if f(x) is a&lt;br /&gt;
% function call or the x:th element of the vector f. So it has to guess.&lt;br /&gt;
% The Matlab parser doesn&amp;#039;t understand that &amp;quot;toms&amp;quot; creates variables, so it&lt;br /&gt;
% may get confused if one of the names is previously used by a function or&lt;br /&gt;
% script.  By assigning something to each variable before calling toms, we&lt;br /&gt;
% inform the Matlab parser that it is indeed dealing with variables.&lt;br /&gt;
&lt;br /&gt;
p = []; td = []; s = []; cums = []; d = []; r = []; rev = [];&lt;br /&gt;
&lt;br /&gt;
% p(t):   world price of oil&lt;br /&gt;
% td(t):  total demand for oil&lt;br /&gt;
% s(t):   supply of oil by non-opec countries&lt;br /&gt;
% cums(t):  cumulative supply by non-opec countries&lt;br /&gt;
% d(t):   demand for opec-oil&lt;br /&gt;
% r(t):   opec reserves&lt;br /&gt;
% rev(t): revenues in each period&lt;br /&gt;
toms 17x1 p td s cums d r rev&lt;br /&gt;
&lt;br /&gt;
% Positive variables&lt;br /&gt;
cbnd = {p &amp;gt;= 0; td &amp;gt;= 0; s &amp;gt;= 0; cums &amp;gt;= 0&lt;br /&gt;
    d &amp;gt;= 0; r &amp;gt;= 0};&lt;br /&gt;
&lt;br /&gt;
i = 2:17;&lt;br /&gt;
&lt;br /&gt;
% Total demand equation&lt;br /&gt;
eq1 =  td(i) == 0.87*td(i-1) - 0.13*p(i) + demand(i-1);&lt;br /&gt;
&lt;br /&gt;
% Supply equation for non-opec countries&lt;br /&gt;
eq2 =   s(i) == 0.75*s(i-1) + (1.1+0.1*p(i)).*1.02.^(-cums(i)./7);&lt;br /&gt;
&lt;br /&gt;
% Accounting equation for cumulative supply&lt;br /&gt;
eq3 =  cums(i) == cums(i-1) + s(i);&lt;br /&gt;
&lt;br /&gt;
% Accounting equation for opec reserves&lt;br /&gt;
eq4 =   r(i) == r(i-1) - d(i);&lt;br /&gt;
&lt;br /&gt;
% Demand equation for opec&lt;br /&gt;
eq5 = d(i) == td(i) - s(i);&lt;br /&gt;
&lt;br /&gt;
% Yearly objective function value&lt;br /&gt;
eq6 = rev(i) == d(i).*(p(i)-250./r(i));&lt;br /&gt;
&lt;br /&gt;
profit = sum(rev(2:17).*1.05.^(1-(1:16)&amp;#039;));&lt;br /&gt;
&lt;br /&gt;
% Fixed initial conditions&lt;br /&gt;
cbnd1 = {td(1) == 18; s(1) == 6.5; p(1) == 0&lt;br /&gt;
    r(1) == 500; cums(1) == 0; d(1) == 11.5; rev(1) == 0};&lt;br /&gt;
&lt;br /&gt;
% Starting point for optimization&lt;br /&gt;
x0 = {td == 18; s == [6.5;7*ones(16,1)]; cums == 7*(0:16)&amp;#039;&lt;br /&gt;
    d == td-s; p == [0;14*ones(16,1)]};&lt;br /&gt;
&lt;br /&gt;
r0 = [500;zeros(16,1)];&lt;br /&gt;
for i=2:17&lt;br /&gt;
    r0(i) = r0(i-1)-(18-7);&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
i = 2:17;&lt;br /&gt;
x0 = {x0; r == r0; rev == [0;d(i).*(p(i)-250./r(i))] };&lt;br /&gt;
&lt;br /&gt;
cons = {cbnd; cbnd1; eq1; eq2; eq3; eq4; eq5; eq6};&lt;br /&gt;
solution = ezsolve(-profit,cons,x0);&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: lpcon&lt;br /&gt;
Time for symbolic processing: 0.18169 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: Problem 1                      f_k   -1170.486285448881700000&lt;br /&gt;
                                       sum(|constr|)      0.000000032087510419&lt;br /&gt;
                              f(x_k) + sum(|constr|)  -1170.486285416794300000&lt;br /&gt;
                                              f(x_0)  -1676.426105656187900000&lt;br /&gt;
&lt;br /&gt;
Solver: snopt.  EXIT=0.  INFORM=1.&lt;br /&gt;
SNOPT 7.2-5 NLP code&lt;br /&gt;
Optimality conditions satisfied&lt;br /&gt;
&lt;br /&gt;
FuncEv    1 ConstrEv   22 ConJacEv   22 Iter   19 MinorIter   74&lt;br /&gt;
CPU time: 0.015600 sec. Elapsed time: 0.025000 sec. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mbot</name></author>
	</entry>
</feed>