<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/165755</link>
    <title>MATLAB Central Newsreader - Newbie optimization problem</title>
    <description>Feed for thread: Newbie optimization problem</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Sun, 16 Mar 2008 03:46:42 -0400</pubDate>
      <title>Newbie optimization problem</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/165755#421113</link>
      <author>Barry </author>
      <description>Hello,&lt;br&gt;
&lt;br&gt;
I am completely new to MatLab, and I have never actually&lt;br&gt;
taken  a class in linear algebra, either, so my question is&lt;br&gt;
probably pretty elementary.  I can't find any examples that&lt;br&gt;
I recognize as analogous to my problem, though, so I thought&lt;br&gt;
I would ask here.&lt;br&gt;
&lt;br&gt;
I have a system of two matrix-vector equations.  A is a&lt;br&gt;
matrix with j rows and i columns, and B is A transposed. &lt;br&gt;
Both logK and C are vectors with j rows, and logC is the&lt;br&gt;
vector log10(C).  logX and T are vectors with i rows.  Here&lt;br&gt;
are the equations:&lt;br&gt;
&lt;br&gt;
A*logX + logK = logC&lt;br&gt;
&lt;br&gt;
B*C = T&lt;br&gt;
&lt;br&gt;
A, B, and logK are given, as are certain elements in the&lt;br&gt;
logX and T vectors (but not others).  The standard way of&lt;br&gt;
solving this system is to rewrite the second equation as&lt;br&gt;
B*C-T=Y, and optimize the non-fixed elements in logX and T&lt;br&gt;
so that all the elements in Y are minimized.&lt;br&gt;
&lt;br&gt;
I can actually do this just fine with the Solver in Excel by&lt;br&gt;
telling it which cells to optimize, but of course it is&lt;br&gt;
pretty slow. So anyway, can one of the solver functions in&lt;br&gt;
MatLab handle this (I have the optimization toolbox,) and if&lt;br&gt;
so, how do I set up the problem?&lt;br&gt;
&lt;br&gt;
Thanks!&lt;br&gt;
&lt;br&gt;
Barry</description>
    </item>
    <item>
      <pubDate>Sun, 16 Mar 2008 04:26:10 -0400</pubDate>
      <title>Re: Newbie optimization problem</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/165755#421118</link>
      <author>D. Ismay</author>
      <description>Barry wrote on 15-Mar-08 19:46 :&lt;br&gt;
&amp;gt; Hello,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I am completely new to MatLab, and I have never actually&lt;br&gt;
&amp;gt; taken  a class in linear algebra, either  &amp;lt;snip&amp;gt;&lt;br&gt;
&lt;br&gt;
Google:&lt;br&gt;
Results 1 - 10 of about 407,000 for Linear Algebra and its applications. (0.20 seconds)&lt;br&gt;
&lt;br&gt;
Help -- Matlab -- Getting Started&lt;br&gt;
&lt;br&gt;
HTH, HAND</description>
    </item>
    <item>
      <pubDate>Sun, 16 Mar 2008 05:47:04 -0400</pubDate>
      <title>Re: Newbie optimization problem</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/165755#421121</link>
      <author>Barry </author>
      <description>&quot;D. Ismay&quot;  wrote &lt;br&gt;
&lt;br&gt;
&amp;gt; &amp;gt; I am completely new to MatLab, and I have never actually&lt;br&gt;
&amp;gt; &amp;gt; taken  a class in linear algebra, either  &amp;lt;snip&amp;gt;&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Google:&lt;br&gt;
&amp;gt; Results 1 - 10 of about 407,000 for Linear Algebra and its&lt;br&gt;
applications. (0.20 seconds)&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Help -- Matlab -- Getting Started&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; HTH, HAND&lt;br&gt;
&lt;br&gt;
I'm sorry, I should have been more clear about my situation&lt;br&gt;
for the sake of D. Umbass.  I have spent hundreds of dollars&lt;br&gt;
on MatLab and linear algebra books, and I have been reading&lt;br&gt;
through all of them.  I have not, however, found anything&lt;br&gt;
that tells me how to optimize on particular elements of more&lt;br&gt;
than one vector.  &lt;br&gt;
&lt;br&gt;
Maybe I just missed it.  Maybe my grasp of linear algebra&lt;br&gt;
isn't yet complete enough to see it when it's right in front&lt;br&gt;
of me.  And so I'm asking if anyone can tell me on which&lt;br&gt;
MatLab optimization functions to focus my attention, or if I&lt;br&gt;
would have to program some custom routine to do what I want.</description>
    </item>
    <item>
      <pubDate>Sun, 16 Mar 2008 17:00:33 -0400</pubDate>
      <title>Re: Newbie optimization problem</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/165755#421155</link>
      <author>D. Ismay</author>
      <description>Barry wrote on 15-Mar-08 21:47 :&lt;br&gt;
&amp;gt; &quot;D. Ismay&quot;  wrote &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; I am completely new to MatLab, and I have never actually&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; taken  a class in linear algebra, either  &amp;lt;snip&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; Google:&lt;br&gt;
&amp;gt;&amp;gt; Results 1 - 10 of about 407,000 for Linear Algebra and its&lt;br&gt;
&amp;gt; applications. (0.20 seconds)&lt;br&gt;
&amp;gt;&amp;gt; Help -- Matlab -- Getting Started&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; HTH, HAND&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I'm sorry, I should have been more clear about my situation&lt;br&gt;
&amp;gt; because I am a dumbass. &amp;lt;snip&amp;gt;&lt;br&gt;
&lt;br&gt;
Edited, for the sake of TRUVTH! in usenet.</description>
    </item>
    <item>
      <pubDate>Sun, 16 Mar 2008 18:05:04 -0400</pubDate>
      <title>Re: Newbie optimization problem</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/165755#421160</link>
      <author>Amir </author>
      <description>&quot;D. Ismay&quot; &lt;br&gt;
&amp;lt;nospam@WooHoo.WooHooHoo.WooHoo.WooHooHoo.HOOHOO.hoohoo.Woo&lt;br&gt;
Hoo.WooHooHoo&amp;gt; wrote in message &lt;br&gt;
&amp;lt;13tqkhhkb17re38@corp.supernews.com&amp;gt;...&lt;br&gt;
&amp;gt; Barry wrote on 15-Mar-08 21:47 :&lt;br&gt;
&amp;gt; &amp;gt; &quot;D. Ismay&quot;  wrote &lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt;&amp;gt;&amp;gt; I am completely new to MatLab, and I have never &lt;br&gt;
actually&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt;&amp;gt; taken  a class in linear algebra, either  &amp;lt;snip&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; Google:&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; Results 1 - 10 of about 407,000 for Linear Algebra &lt;br&gt;
and its&lt;br&gt;
&amp;gt; &amp;gt; applications. (0.20 seconds)&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; Help -- Matlab -- Getting Started&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; HTH, HAND&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; I'm sorry, I should have been more clear about my &lt;br&gt;
situation&lt;br&gt;
&amp;gt; &amp;gt; because I am a dumbass. &amp;lt;snip&amp;gt;&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Edited, for the sake of TRUVTH! in usenet.&lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;br&gt;
I honestly think Barry put good effort in describing his &lt;br&gt;
problem, and it is a little harsh to direct him to google &lt;br&gt;
search.&lt;br&gt;
&lt;br&gt;
Anyway, from my understanding of your problem, I think you &lt;br&gt;
need to write a matlab function to be optimized and &lt;br&gt;
passing to it the unkonwn values (Note I did not pay &lt;br&gt;
attnetion to dimensions, so this needs to be rewritten &lt;br&gt;
with desired dimnsions ....etc):&lt;br&gt;
&lt;br&gt;
function r=myfunc(T1, T2, T3, logX1, logX2, logX3)&lt;br&gt;
T=[1 2 3 T1 T2 T3];&lt;br&gt;
logX=[5 6 7 logX1 logX2 logX3];&lt;br&gt;
logC=A*logX + logK;&lt;br&gt;
C=exp(logC); % I am assuming your log is natural logrithm&lt;br&gt;
r=B*C-T; %return result of this target function to be &lt;br&gt;
minimized&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Then use (pass) this function as an optimization target &lt;br&gt;
function in one of Matlab's optimization routines, like:&lt;br&gt;
fminunc &lt;br&gt;
like this:&lt;br&gt;
x0=[1 1 1 1 1 1]; %initial values for T1 T2 T3 logX1 logX2 &lt;br&gt;
logX3&lt;br&gt;
x = fminunc(fun,x0)&lt;br&gt;
&lt;br&gt;
(All optimization functions are similar in usage, so &lt;br&gt;
knwing one will help you use the others).&lt;br&gt;
&lt;br&gt;
Now you can proceed and read more in the help of this &lt;br&gt;
function and general usage of optimization in Matlab.&lt;br&gt;
&lt;br&gt;
-Amir</description>
    </item>
    <item>
      <pubDate>Sun, 16 Mar 2008 18:07:03 -0400</pubDate>
      <title>Re: Newbie optimization problem</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/165755#421162</link>
      <author>Amir </author>
      <description>&quot;Amir &quot; &amp;lt;amir_seyed@hotmail.com&amp;gt; wrote in message &lt;br&gt;
&amp;lt;frjngg$3f5$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &quot;D. Ismay&quot; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;lt;nospam@WooHoo.WooHooHoo.WooHoo.WooHooHoo.HOOHOO.hoohoo.Woo&lt;br&gt;
&amp;gt; Hoo.WooHooHoo&amp;gt; wrote in message &lt;br&gt;
&amp;gt; &amp;lt;13tqkhhkb17re38@corp.supernews.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; Barry wrote on 15-Mar-08 21:47 :&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &quot;D. Ismay&quot;  wrote &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt; I am completely new to MatLab, and I have never &lt;br&gt;
&amp;gt; actually&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;&amp;gt;&amp;gt; taken  a class in linear algebra, either  &amp;lt;snip&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;&amp;gt; Google:&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;&amp;gt; Results 1 - 10 of about 407,000 for Linear Algebra &lt;br&gt;
&amp;gt; and its&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; applications. (0.20 seconds)&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;&amp;gt; Help -- Matlab -- Getting Started&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;&amp;gt; HTH, HAND&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; I'm sorry, I should have been more clear about my &lt;br&gt;
&amp;gt; situation&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; because I am a dumbass. &amp;lt;snip&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Edited, for the sake of TRUVTH! in usenet.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I honestly think Barry put good effort in describing his &lt;br&gt;
&amp;gt; problem, and it is a little harsh to direct him to &lt;br&gt;
google &lt;br&gt;
&amp;gt; search.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Anyway, from my understanding of your problem, I think &lt;br&gt;
you &lt;br&gt;
&amp;gt; need to write a matlab function to be optimized and &lt;br&gt;
&amp;gt; passing to it the unkonwn values (Note I did not pay &lt;br&gt;
&amp;gt; attnetion to dimensions, so this needs to be rewritten &lt;br&gt;
&amp;gt; with desired dimnsions ....etc):&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; function r=myfunc(T1, T2, T3, logX1, logX2, logX3)&lt;br&gt;
&amp;gt; T=[1 2 3 T1 T2 T3];&lt;br&gt;
&amp;gt; logX=[5 6 7 logX1 logX2 logX3];&lt;br&gt;
&amp;gt; logC=A*logX + logK;&lt;br&gt;
&amp;gt; C=exp(logC); % I am assuming your log is natural logrithm&lt;br&gt;
&amp;gt; r=B*C-T; %return result of this target function to be &lt;br&gt;
&amp;gt; minimized&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Then use (pass) this function as an optimization target &lt;br&gt;
&amp;gt; function in one of Matlab's optimization routines, like:&lt;br&gt;
&amp;gt; fminunc &lt;br&gt;
&amp;gt; like this:&lt;br&gt;
&amp;gt; x0=[1 1 1 1 1 1]; %initial values for T1 T2 T3 logX1 &lt;br&gt;
logX2 &lt;br&gt;
&amp;gt; logX3&lt;br&gt;
&amp;gt; x = fminunc(fun,x0)&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; (All optimization functions are similar in usage, so &lt;br&gt;
&amp;gt; knwing one will help you use the others).&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Now you can proceed and read more in the help of this &lt;br&gt;
&amp;gt; function and general usage of optimization in Matlab.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; -Amir&lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;br&gt;
I meant:&lt;br&gt;
x = fminunc(myfunc,x0)</description>
    </item>
    <item>
      <pubDate>Sun, 16 Mar 2008 22:34:06 -0400</pubDate>
      <title>Re: Newbie optimization problem</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/165755#421202</link>
      <author>Barry </author>
      <description>Thanks, Amir.  The idea that you can minimize a function is&lt;br&gt;
just what I think I was missing--I'll give it a try.  &lt;br&gt;
&lt;br&gt;
And thanks also for not dismissing my question.  This is the&lt;br&gt;
first time I have posted here, and it was kind of&lt;br&gt;
discouraging to get my first reply from that other person. &lt;br&gt;
I looked up his other posts, and there were many more of the&lt;br&gt;
same kind.  Must have a lot of time on his hands--I wonder why?&lt;br&gt;
&lt;br&gt;
Barry</description>
    </item>
    <item>
      <pubDate>Mon, 17 Mar 2008 13:46:46 -0400</pubDate>
      <title>Re: Newbie optimization problem</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/165755#421301</link>
      <author>D. Ismay</author>
      <description>Amir wrote on 16-Mar-08 10:05 :&lt;br&gt;
[...]&lt;br&gt;
&amp;gt; I honestly think Barry put good effort in describing his &lt;br&gt;
&amp;gt; problem, and it is a little harsh to direct him to google &lt;br&gt;
&amp;gt; search.&lt;br&gt;
&lt;br&gt;
The OP wrote, and I quote:&lt;br&gt;
&lt;br&gt;
&quot;I am completely new to MatLab, and I have never actually taken a class in linear algebra, either, so my question is probably pretty &lt;br&gt;
elementary.&quot;&lt;br&gt;
&lt;br&gt;
Given this, the reply was entirely reasonable.  The self-described newbie's next-best choice was to whine about his circumstance in &lt;br&gt;
a public newsgroup.  Seems to me he got everything he wanted.</description>
    </item>
    <item>
      <pubDate>Mon, 17 Mar 2008 16:59:08 -0400</pubDate>
      <title>Re: Newbie optimization problem</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/165755#421326</link>
      <author>Barry </author>
      <description>&quot;D. Ismay&quot; &lt;br&gt;
&lt;br&gt;
&amp;gt; The OP wrote, and I quote:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &quot;I am completely new to MatLab, and I have never actually&lt;br&gt;
taken a class in linear algebra, either, so my question is&lt;br&gt;
probably pretty &lt;br&gt;
&amp;gt; elementary.&quot;&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Given this, the reply was entirely reasonable.  The&lt;br&gt;
self-described newbie's next-best choice was to whine about&lt;br&gt;
his circumstance in &lt;br&gt;
&amp;gt; a public newsgroup.  Seems to me he got everything he wanted.&lt;br&gt;
&lt;br&gt;
D., I only gave this preface to let people know where I am.&lt;br&gt;
&amp;nbsp;I'm a beginner.  That means that I may be missing something&lt;br&gt;
that is obvious to more experienced people, and such&lt;br&gt;
information might help other posters know how to frame their&lt;br&gt;
answers.&lt;br&gt;
&lt;br&gt;
But my question was not, &quot;Can someone teach me linear&lt;br&gt;
algebra?&quot; or &quot;How do you use MatLab?&quot;  Rather, it was a very&lt;br&gt;
specific and straightforward question about how to perform&lt;br&gt;
an optimization in a way that I had not seen described in&lt;br&gt;
any documentation.  And Amir was kind enough to give me a&lt;br&gt;
very straightforward answer.&lt;br&gt;
&lt;br&gt;
In other words, your reply was not reasonable, because it&lt;br&gt;
didn't address the actual question.  I honestly understand&lt;br&gt;
the impulse to be annoyed with people who post vague,&lt;br&gt;
unanswerable questions, but if you are going to appoint&lt;br&gt;
yourself as the newsgroup sheriff so you can run those&lt;br&gt;
people out of town, you should pay attention to what&lt;br&gt;
questions are actually being asked.&lt;br&gt;
&lt;br&gt;
Or was your point simply that beginners are not welcome here?&lt;br&gt;
&lt;br&gt;
Barry</description>
    </item>
    <item>
      <pubDate>Wed, 19 Mar 2008 20:55:03 -0400</pubDate>
      <title>Re: Newbie optimization problem</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/165755#421819</link>
      <author>D. Ismay</author>
      <description>Barry wrote on 17-Mar-08 08:59 :&lt;br&gt;
[...]&lt;br&gt;
&amp;gt; D., I only gave this preface to let people know &lt;br&gt;
&amp;lt;slap&amp;gt;&lt;br&gt;
&lt;br&gt;
&quot;Say what you mean, mean what you say.&quot;</description>
    </item>
    <item>
      <pubDate>Thu, 20 Mar 2008 17:29:02 -0400</pubDate>
      <title>Re: Newbie optimization problem</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/165755#422000</link>
      <author>Thomas Clark</author>
      <description>Barry,&lt;br&gt;
&lt;br&gt;
Welcome to MATLAB. From the sounds of your post, your work&lt;br&gt;
involves topics which MATLAB is greatly suited for. I almost&lt;br&gt;
guarantee that in a year's time you'll have stopped using&lt;br&gt;
excel for anything other than basic accounting.&lt;br&gt;
&lt;br&gt;
Kudos for getting it (excel) to optimise on linear algebra&lt;br&gt;
problems though!&lt;br&gt;
&lt;br&gt;
Don't worry about being a newbie. I'm an experienced MATLAB&lt;br&gt;
user - but am just getting into a different C++ application&lt;br&gt;
too, so know what you're going through. It's SO hard to&lt;br&gt;
learn a language at the same time as trying to solve a&lt;br&gt;
specific problem.&lt;br&gt;
&lt;br&gt;
As for optimisation, I'm not really up on linear algebra&lt;br&gt;
either, but I do have a very well commented set of functions&lt;br&gt;
to perform an optimisation. It should guide you quite well&lt;br&gt;
through the use of functions like fminsearch. I imagine my&lt;br&gt;
application was quite different to yours, but as a tool to&lt;br&gt;
learn about program structure, it's pretty good.&lt;br&gt;
&lt;br&gt;
I don't want to post it on the FEX as I've sold it in the&lt;br&gt;
past, and it wouldn't feel ethical... However, if you email me:&lt;br&gt;
t,clarkato2,co,uk (replace 'at' with '@' and commas with dots)&lt;br&gt;
I'll supply you with a copy.&lt;br&gt;
&lt;br&gt;
Cheers&lt;br&gt;
&lt;br&gt;
Tom Clark</description>
    </item>
    <item>
      <pubDate>Fri, 21 Mar 2008 09:10:16 -0400</pubDate>
      <title>Re: Newbie optimization problem</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/165755#422108</link>
      <author>zaman</author>
      <description>Barry&lt;br&gt;
&lt;br&gt;
Pls keep putting some more interesting questions.&lt;br&gt;
We are here to share , to learn and to cooperate.&lt;br&gt;
-zaman-</description>
    </item>
  </channel>
</rss>

