<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/159189</link>
    <title>MATLAB Central Newsreader - Solve Equation Symbolically</title>
    <description>Feed for thread: Solve Equation Symbolically</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>Mon, 12 Nov 2007 19:24:43 -0500</pubDate>
      <title>Solve Equation Symbolically</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/159189#400911</link>
      <author>evan klinger</author>
      <description>Good afternoon all,&lt;br&gt;
&lt;br&gt;
I am trying to solve the equation cv3 below using the solve&lt;br&gt;
command but for some reason Matlab is not able to solve for&lt;br&gt;
x. Or it returns strange constants in the result. It also&lt;br&gt;
sometimes is dropping some of the symbols. I am just trying&lt;br&gt;
to find out what x equals to. Any help would be greatly&lt;br&gt;
appreciated.&lt;br&gt;
cv0, p[n], x, db and cr are all symbols&lt;br&gt;
&lt;br&gt;
cv1 = (cv0 + p1 - (x)*(db-cv0))*(1+cr)&lt;br&gt;
cv2 = (cv1 + p2 - (x)*(db-cv1))*(1+cr)&lt;br&gt;
cv3 = (cv2 + p3 - (x)*(db-cv2))*(1+cr)&lt;br&gt;
&lt;br&gt;
I was using solve(cv3, 'x') but this is giving strange&lt;br&gt;
constants.</description>
    </item>
    <item>
      <pubDate>Mon, 12 Nov 2007 20:35:47 -0500</pubDate>
      <title>Re: Solve Equation Symbolically</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/159189#400925</link>
      <author>roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)</author>
      <description>In article &amp;lt;fha99r$osc$1@fred.mathworks.com&amp;gt;,&lt;br&gt;
evan klinger &amp;lt;eklinger1-nospam@cox.net&amp;gt; wrote:&lt;br&gt;
&amp;gt;Good afternoon all,&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;I am trying to solve the equation cv3 below using the solve&lt;br&gt;
&amp;gt;command but for some reason Matlab is not able to solve for&lt;br&gt;
&amp;gt;x. Or it returns strange constants in the result. It also&lt;br&gt;
&amp;gt;sometimes is dropping some of the symbols. I am just trying&lt;br&gt;
&amp;gt;to find out what x equals to. Any help would be greatly&lt;br&gt;
&amp;gt;appreciated.&lt;br&gt;
&amp;gt;cv0, p[n], x, db and cr are all symbols&lt;br&gt;
&lt;br&gt;
&amp;gt;cv1 = (cv0 + p1 - (x)*(db-cv0))*(1+cr)&lt;br&gt;
&amp;gt;cv2 = (cv1 + p2 - (x)*(db-cv1))*(1+cr)&lt;br&gt;
&amp;gt;cv3 = (cv2 + p3 - (x)*(db-cv2))*(1+cr)&lt;br&gt;
&lt;br&gt;
&amp;gt;I was using solve(cv3, 'x') but this is giving strange&lt;br&gt;
&amp;gt;constants.&lt;br&gt;
&lt;br&gt;
It's a cubic in x, so there are three solutions. Two of them&lt;br&gt;
involve imaginary numbers. Because of the numbers of terms involved,&lt;br&gt;
each of the three solutions runs to pages and pages.&lt;br&gt;
&lt;br&gt;
If you were using maple directly, you would,&lt;br&gt;
&lt;br&gt;
&amp;gt; collect(expand(cv3),x);&lt;br&gt;
&lt;br&gt;
(-db+3*cv0*cr^2-3*db*cr+3*cv0*cr+cv0*cr^3-3*db*cr^2-db*cr^3+cv0)*x^3+(-2*db*cr&lt;br&gt;
^3+3*cv0-8*db*cr+3*p1*cr^2+p1-7*db*cr^2-3*db+p1*cr^3+3*p1*cr+3*cv0*cr^3+9*cv0*&lt;br&gt;
cr^2+9*cv0*cr)*x^2+(-3*db+3*cv0-4*db*cr^2+9*cv0*cr^2-db*cr^3-6*db*cr+9*cv0*cr+&lt;br&gt;
3*cv0*cr^3+2*p1+6*p1*cr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lt;br&gt;
&lt;br&gt;
&amp;nbsp;-1/12/A*(36*C*B*A-108*D*A^2-8*B^3+12*3^(1/2)*(4*C^3*A-C^2*B^2-18*C*B*A*&lt;br&gt;
D+27*D^2*A^2+4*D*B^3)^(1/2)*A)^(1/3)+1/3*(3*C*A-B^2)/A/(36*C*B*A-108*D*A^2-8*B&lt;br&gt;
^3+12*3^(1/2)*(4*C^3*A-C^2*B^2-18*C*B*A*D+27*D^2*A^2+4*D*B^3)^(1/2)*A)^(1/3)-1&lt;br&gt;
/3*B/A-1/2*I*3^(1/2)*(1/6/A*(36*C*B*A-108*D*A^2-8*B^3+12*3^(1/2)*(4*C^3*A-C^2*&lt;br&gt;
B^2-18*C*B*A*D+27*D^2*A^2+4*D*B^3)^(1/2)*A)^(1/3)+2/3*(3*C*A-B^2)/A/(36*C*B*A-\&lt;br&gt;
108*D*A^2-8*B^3+12*3^(1/2)*(4*C^3*A-C^2*B^2-18*C*B*A*D+27*D^2*A^2+4*D*B^3)^(1/&lt;br&gt;
2)*A)^(1/3))]&lt;br&gt;
&lt;br&gt;
The second and third of these involve imaginary numbers, so select&lt;br&gt;
the first of them,&lt;br&gt;
&lt;br&gt;
1/6/A*(36*C*B*A-108*D*A^2-8*B^3+12*3^(1/2)*(4*C^3*A-C^2*B^2-18*C*B*A*D+27*D^2&lt;br&gt;
*A^2+4*D*B^3)^(1/2)*A)^(1/3)-2/3*(3*C*A-B^2)/A/(36*C*B*A-108*D*A^2-8*B^3+12*3^&lt;br&gt;
(1/2)*(4*C^3*A-C^2*B^2-18*C*B*A*D+27*D^2*A^2+4*D*B^3)^(1/2)*A)^(1/3)-1/3*B/A&lt;br&gt;
&lt;br&gt;
and substitute by comparison with the expanded cv3,&lt;br&gt;
&lt;br&gt;
A = (-db+3*cv0*cr^2-3*db*cr+3*cv0*cr+cv0*cr^3-3*db*cr^2-db*cr^3+cv0)&lt;br&gt;
B = (-2*db*cr^3+3*cv0-8*db*cr+3*p1*cr^2+p1-7*db*cr^2-3*db+p1*cr^3+3*p1*cr +&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;3*cv0*cr^3+9*cv0*cr^2+9*cv0*cr)&lt;br&gt;
C = (-3*db+3*cv0-4*db*cr^2+9*cv0*cr^2-db*cr^3-6*db*cr+9*cv0*cr +&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;3*cv0*cr^3+2*p1+6*p1*cr+p2+6*p1*cr^2+2*p2*cr+2*p1*cr^3+p2*cr^2)&lt;br&gt;
D = cv0+p2+p3+p1+p3*cr+cv0*cr^3+3*cv0*cr+3*p1*cr+3*p1*cr^2+2*p2*cr +&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;p1*cr^3+3*cv0*cr^2+p2*cr^2&lt;br&gt;
&lt;br&gt;
and you will have your multi-page solution.&lt;br&gt;
&lt;br&gt;
(Somehow, I suspect that after seeing the multipage solution, you&lt;br&gt;
will decide that maybe solving for x didn't turn out to be&lt;br&gt;
very productive.)&lt;br&gt;
-- &lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&quot;Okay, buzzwords only. Two syllables, tops.&quot;  -- Laurie Anderson</description>
    </item>
    <item>
      <pubDate>Mon, 12 Nov 2007 20:59:50 -0500</pubDate>
      <title>Re: Solve Equation Symbolically</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/159189#400930</link>
      <author>evan klinger</author>
      <description>I guess I'm confused about why there are 3 solutions since&lt;br&gt;
it can really be written as one long equation if you&lt;br&gt;
substitute the cv's in. In other words, you can write cv3 in&lt;br&gt;
terms of cv0s. Am I missing something?&lt;br&gt;
&lt;br&gt;
Thanks!&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in&lt;br&gt;
message &amp;lt;fhadf3$o58$1@canopus.cc.umanitoba.ca&amp;gt;...&lt;br&gt;
&amp;gt; In article &amp;lt;fha99r$osc$1@fred.mathworks.com&amp;gt;,&lt;br&gt;
&amp;gt; evan klinger &amp;lt;eklinger1-nospam@cox.net&amp;gt; wrote:&lt;br&gt;
&amp;gt; &amp;gt;Good afternoon all,&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt;I am trying to solve the equation cv3 below using the solve&lt;br&gt;
&amp;gt; &amp;gt;command but for some reason Matlab is not able to solve for&lt;br&gt;
&amp;gt; &amp;gt;x. Or it returns strange constants in the result. It also&lt;br&gt;
&amp;gt; &amp;gt;sometimes is dropping some of the symbols. I am just trying&lt;br&gt;
&amp;gt; &amp;gt;to find out what x equals to. Any help would be greatly&lt;br&gt;
&amp;gt; &amp;gt;appreciated.&lt;br&gt;
&amp;gt; &amp;gt;cv0, p[n], x, db and cr are all symbols&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &amp;gt;cv1 = (cv0 + p1 - (x)*(db-cv0))*(1+cr)&lt;br&gt;
&amp;gt; &amp;gt;cv2 = (cv1 + p2 - (x)*(db-cv1))*(1+cr)&lt;br&gt;
&amp;gt; &amp;gt;cv3 = (cv2 + p3 - (x)*(db-cv2))*(1+cr)&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &amp;gt;I was using solve(cv3, 'x') but this is giving strange&lt;br&gt;
&amp;gt; &amp;gt;constants.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; It's a cubic in x, so there are three solutions. Two of them&lt;br&gt;
&amp;gt; involve imaginary numbers. Because of the numbers of terms&lt;br&gt;
involved,&lt;br&gt;
&amp;gt; each of the three solutions runs to pages and pages.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; If you were using maple directly, you would,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; collect(expand(cv3),x);&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt;&lt;br&gt;
(-db+3*cv0*cr^2-3*db*cr+3*cv0*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-\&lt;br&gt;
&amp;gt;&lt;br&gt;
108*D*A^2-8*B^3+12*3^(1/2)*(4*C^3*A-C^2*B^2-18*C*B*A*D+27*D^2*A^2+4*D*B^3)^(1/&lt;br&gt;
&amp;gt; 2)*A)^(1/3))]&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; The second and third of these involve imaginary numbers,&lt;br&gt;
so select&lt;br&gt;
&amp;gt; the first of them,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt;&lt;br&gt;
1/6/A*(36*C*B*A-108*D*A^2-8*B^3+12*3^(1/2)*(4*C^3*A-C^2*B^2-18*C*B*A*D+27*D^2&lt;br&gt;
&amp;gt;&lt;br&gt;
*A^2+4*D*B^3)^(1/2)*A)^(1/3)-2/3*(3*C*A-B^2)/A/(36*C*B*A-108*D*A^2-8*B^3+12*3^&lt;br&gt;
&amp;gt;&lt;br&gt;
(1/2)*(4*C^3*A-C^2*B^2-18*C*B*A*D+27*D^2*A^2+4*D*B^3)^(1/2)*A)^(1/3)-1/3*B/A&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; and substitute by comparison with the expanded cv3,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; A =&lt;br&gt;
(-db+3*cv0*cr^2-3*db*cr+3*cv0*cr+cv0*cr^3-3*db*cr^2-db*cr^3+cv0)&lt;br&gt;
&amp;gt; B =&lt;br&gt;
(-2*db*cr^3+3*cv0-8*db*cr+3*p1*cr^2+p1-7*db*cr^2-3*db+p1*cr^3+3*p1*cr&lt;br&gt;
+&lt;br&gt;
&amp;gt;      3*cv0*cr^3+9*cv0*cr^2+9*cv0*cr)&lt;br&gt;
&amp;gt; C =&lt;br&gt;
(-3*db+3*cv0-4*db*cr^2+9*cv0*cr^2-db*cr^3-6*db*cr+9*cv0*cr +&lt;br&gt;
&amp;gt;     &lt;br&gt;
3*cv0*cr^3+2*p1+6*p1*cr+p2+6*p1*cr^2+2*p2*cr+2*p1*cr^3+p2*cr^2)&lt;br&gt;
&amp;gt; D =&lt;br&gt;
cv0+p2+p3+p1+p3*cr+cv0*cr^3+3*cv0*cr+3*p1*cr+3*p1*cr^2+2*p2*cr +&lt;br&gt;
&amp;gt;     p1*cr^3+3*cv0*cr^2+p2*cr^2&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; and you will have your multi-page solution.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; (Somehow, I suspect that after seeing the multipage&lt;br&gt;
solution, you&lt;br&gt;
&amp;gt; will decide that maybe solving for x didn't turn out to be&lt;br&gt;
&amp;gt; very productive.)&lt;br&gt;
&amp;gt; -- &lt;br&gt;
&amp;gt;    &quot;Okay, buzzwords only. Two syllables, tops.&quot;  -- Laurie&lt;br&gt;
Anderson</description>
    </item>
    <item>
      <pubDate>Mon, 12 Nov 2007 21:03:21 -0500</pubDate>
      <title>Re: Solve Equation Symbolically</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/159189#400932</link>
      <author>Ben Hinkle</author>
      <description>&lt;br&gt;
&quot;evan klinger&quot; &amp;lt;eklinger1-nospam@cox.net&amp;gt; wrote in message &lt;br&gt;
news:fha99r$osc$1@fred.mathworks.com...&lt;br&gt;
&amp;gt; Good afternoon all,&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I am trying to solve the equation cv3 below using the solve&lt;br&gt;
&amp;gt; command but for some reason Matlab is not able to solve for&lt;br&gt;
&amp;gt; x. Or it returns strange constants in the result. It also&lt;br&gt;
&amp;gt; sometimes is dropping some of the symbols. I am just trying&lt;br&gt;
&amp;gt; to find out what x equals to. Any help would be greatly&lt;br&gt;
&amp;gt; appreciated.&lt;br&gt;
&amp;gt; cv0, p[n], x, db and cr are all symbols&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; cv1 = (cv0 + p1 - (x)*(db-cv0))*(1+cr)&lt;br&gt;
&amp;gt; cv2 = (cv1 + p2 - (x)*(db-cv1))*(1+cr)&lt;br&gt;
&amp;gt; cv3 = (cv2 + p3 - (x)*(db-cv2))*(1+cr)&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I was using solve(cv3, 'x') but this is giving strange&lt;br&gt;
&amp;gt; constants.&lt;br&gt;
&lt;br&gt;
Since MATLAB uses 'x' as the default independent variable all you need to do &lt;br&gt;
is:&lt;br&gt;
&lt;br&gt;
syms cv0 p1 p2 p3 x db cr&lt;br&gt;
cv1 = (cv0 + p1 - (x)*(db-cv0))*(1+cr)&lt;br&gt;
cv2 = (cv1 + p2 - (x)*(db-cv1))*(1+cr)&lt;br&gt;
cv3 = (cv2 + p3 - (x)*(db-cv2))*(1+cr)&lt;br&gt;
solve(collect(expand(cv3))&lt;br&gt;
&lt;br&gt;
Hope that helps,&lt;br&gt;
-Ben Hinkle </description>
    </item>
    <item>
      <pubDate>Mon, 12 Nov 2007 21:08:23 -0500</pubDate>
      <title>Re: Solve Equation Symbolically</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/159189#400939</link>
      <author>Ben Hinkle</author>
      <description>&lt;br&gt;
&amp;gt; solve(collect(expand(cv3))&lt;br&gt;
&lt;br&gt;
Sorry for the double post but I tried just solve(cv3) and go the same &lt;br&gt;
solutions so I'm not sure why you are seeing incomplete solutions. </description>
    </item>
    <item>
      <pubDate>Mon, 12 Nov 2007 21:21:43 -0500</pubDate>
      <title>Re: Solve Equation Symbolically</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/159189#400943</link>
      <author>evan klinger</author>
      <description>Is there a way to increase the 25,000 character limit? I&lt;br&gt;
really need to solve up to cv12, I just used up to cv3 to&lt;br&gt;
demonstrate what I'm trying to do. However, using&lt;br&gt;
solve(collect(expand(cv12))) returns an error:&lt;br&gt;
&lt;br&gt;
??? Error using ==&amp;gt; solve at 162&lt;br&gt;
Unable to find closed form solution.&lt;br&gt;
&lt;br&gt;
Error in ==&amp;gt; sym.solve at 49&lt;br&gt;
[varargout{1:max(1,nargout)}] = solve(S{:});&lt;br&gt;
&lt;br&gt;
Thanks&lt;br&gt;
Evan&lt;br&gt;
&lt;br&gt;
&quot;Ben Hinkle&quot; &amp;lt;bhinkle@mathworks.com&amp;gt; wrote in message&lt;br&gt;
&amp;lt;fhafc8$h1$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; solve(collect(expand(cv3))&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Sorry for the double post but I tried just solve(cv3) and&lt;br&gt;
go the same &lt;br&gt;
&amp;gt; solutions so I'm not sure why you are seeing incomplete&lt;br&gt;
solutions. &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; </description>
    </item>
    <item>
      <pubDate>Mon, 12 Nov 2007 21:27:26 -0500</pubDate>
      <title>Re: Solve Equation Symbolically</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/159189#400944</link>
      <author>roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)</author>
      <description>In article &amp;lt;fhaes6$k0h$1@fred.mathworks.com&amp;gt;,&lt;br&gt;
evan klinger &amp;lt;eklinger1-nospam@cox.net&amp;gt; top-posted:&lt;br&gt;
&lt;br&gt;
Please do not post your reply at the top of the material you&lt;br&gt;
are commenting on: it makes it more difficult to hold discussions.&lt;br&gt;
Your posting may be the only posting of interest to -you- today,&lt;br&gt;
but I'm following literally over 100 simultaneous discussions today.&lt;br&gt;
&lt;br&gt;
&amp;gt;roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in&lt;br&gt;
&amp;gt;message &amp;lt;fhadf3$o58$1@canopus.cc.umanitoba.ca&amp;gt;...&lt;br&gt;
&amp;gt;&amp;gt; In article &amp;lt;fha99r$osc$1@fred.mathworks.com&amp;gt;,&lt;br&gt;
&amp;gt;&amp;gt; evan klinger &amp;lt;eklinger1-nospam@cox.net&amp;gt; wrote:&lt;br&gt;
&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt;cv0, p[n], x, db and cr are all symbols&lt;br&gt;
&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt;cv1 = (cv0 + p1 - (x)*(db-cv0))*(1+cr)&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt;cv2 = (cv1 + p2 - (x)*(db-cv1))*(1+cr)&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt;cv3 = (cv2 + p3 - (x)*(db-cv2))*(1+cr)&lt;br&gt;
&lt;br&gt;
&amp;gt;&amp;gt; It's a cubic in x, so there are three solutions. Two of them&lt;br&gt;
&amp;gt;&amp;gt; involve imaginary numbers.&lt;br&gt;
&lt;br&gt;
&amp;gt;I guess I'm confused about why there are 3 solutions since&lt;br&gt;
&amp;gt;it can really be written as one long equation if you&lt;br&gt;
&amp;gt;substitute the cv's in. In other words, you can write cv3 in&lt;br&gt;
&amp;gt;terms of cv0s. Am I missing something?&lt;br&gt;
&lt;br&gt;
Look at cv1: it has x times cv0.&lt;br&gt;
&lt;br&gt;
Now look at cv2: it has x times cv1, so that means it is going&lt;br&gt;
to have x times (x times cv0), or x^2 times cv0.&lt;br&gt;
&lt;br&gt;
Now look at cv3: it has x times cv2, so that means it is going&lt;br&gt;
to have x times (x^2 times cv0), or x^3 times cv0.&lt;br&gt;
&lt;br&gt;
Therefor your cv3 is going to involve x^3, and is thus&lt;br&gt;
a cubic polynomial. When you solve a cubic polynomial for 0,&lt;br&gt;
then according to the Fundamental Theorem of Algebra, you&lt;br&gt;
are going to have 3 roots of the polynomial.&lt;br&gt;
&lt;br&gt;
If your constants -happen- to have very specific (and complicated)&lt;br&gt;
relationships, then all three of the roots would be real, so&lt;br&gt;
for completeness you really shouldn't ignore the two solutions&lt;br&gt;
that involve imaginary numbers: those are of the form&lt;br&gt;
f(x) + g(x)*I and if g(x) just happens to come out to 0 then&lt;br&gt;
you have another real solution. &lt;br&gt;
-- &lt;br&gt;
&amp;nbsp;&amp;nbsp;&quot;I will speculate that [...] applications [...] could actually see a&lt;br&gt;
&amp;nbsp;&amp;nbsp;performance boost for most users by going dual-core [...] because it&lt;br&gt;
&amp;nbsp;&amp;nbsp;is running the adware and spyware that [...] are otherwise slowing&lt;br&gt;
&amp;nbsp;&amp;nbsp;down the single CPU that user has today&quot;           -- Herb Sutter</description>
    </item>
    <item>
      <pubDate>Mon, 12 Nov 2007 21:58:46 -0500</pubDate>
      <title>Re: Solve Equation Symbolically</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/159189#400949</link>
      <author>roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)</author>
      <description>In article &amp;lt;fhag57$bca$1@fred.mathworks.com&amp;gt;,&lt;br&gt;
evan klinger &amp;lt;eklinger1-nospam@cox.net&amp;gt; wrote:&lt;br&gt;
&amp;gt;Is there a way to increase the 25,000 character limit? I&lt;br&gt;
&amp;gt;really need to solve up to cv12, I just used up to cv3 to&lt;br&gt;
&amp;gt;demonstrate what I'm trying to do. However, using&lt;br&gt;
&amp;gt;solve(collect(expand(cv12))) returns an error:&lt;br&gt;
&lt;br&gt;
&amp;gt;??? Error using ==&amp;gt; solve at 162&lt;br&gt;
&amp;gt;Unable to find closed form solution.&lt;br&gt;
&lt;br&gt;
It isn't any 25000 character limit that is getting you:&lt;br&gt;
you are trying to find the closed form solution to a polynomial&lt;br&gt;
of order 12 that does not happen to be factorable down&lt;br&gt;
to polynomials of degree 5 or less (degree 5 is the maximum&lt;br&gt;
for which closed form polynomial solutions always exist.)&lt;br&gt;
&lt;br&gt;
Using Maple directly, there is simply no closed form solution&lt;br&gt;
available for cv12. Beyond cv3, even where the closed form&lt;br&gt;
solutions exist in principle, Maple will just show a generalized&lt;br&gt;
placeholder instead (closed form quadratics and quintics are&lt;br&gt;
pretty messy at the best of times.)&lt;br&gt;
-- &lt;br&gt;
&amp;nbsp;&amp;nbsp;&quot;Is there any thing whereof it may be said, See, this is new? It hath&lt;br&gt;
&amp;nbsp;&amp;nbsp;been already of old time, which was before us.&quot;    -- Ecclesiastes</description>
    </item>
    <item>
      <pubDate>Mon, 12 Nov 2007 22:25:17 -0500</pubDate>
      <title>Re: Solve Equation Symbolically</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/159189#400955</link>
      <author>evan klinger</author>
      <description>roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in&lt;br&gt;
message &amp;lt;fhaiam$k8$1@canopus.cc.umanitoba.ca&amp;gt;...&lt;br&gt;
&amp;gt; In article &amp;lt;fhag57$bca$1@fred.mathworks.com&amp;gt;,&lt;br&gt;
&amp;gt; evan klinger &amp;lt;eklinger1-nospam@cox.net&amp;gt; wrote:&lt;br&gt;
&amp;gt; &amp;gt;Is there a way to increase the 25,000 character limit? I&lt;br&gt;
&amp;gt; &amp;gt;really need to solve up to cv12, I just used up to cv3 to&lt;br&gt;
&amp;gt; &amp;gt;demonstrate what I'm trying to do. However, using&lt;br&gt;
&amp;gt; &amp;gt;solve(collect(expand(cv12))) returns an error:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &amp;gt;??? Error using ==&amp;gt; solve at 162&lt;br&gt;
&amp;gt; &amp;gt;Unable to find closed form solution.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; It isn't any 25000 character limit that is getting you:&lt;br&gt;
&amp;gt; you are trying to find the closed form solution to a&lt;br&gt;
polynomial&lt;br&gt;
&amp;gt; of order 12 that does not happen to be factorable down&lt;br&gt;
&amp;gt; to polynomials of degree 5 or less (degree 5 is the maximum&lt;br&gt;
&amp;gt; for which closed form polynomial solutions always exist.)&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Using Maple directly, there is simply no closed form solution&lt;br&gt;
&amp;gt; available for cv12. Beyond cv3, even where the closed form&lt;br&gt;
&amp;gt; solutions exist in principle, Maple will just show a&lt;br&gt;
generalized&lt;br&gt;
&amp;gt; placeholder instead (closed form quadratics and quintics are&lt;br&gt;
&amp;gt; pretty messy at the best of times.)&lt;br&gt;
&amp;gt; -- &lt;br&gt;
&amp;gt;   &quot;Is there any thing whereof it may be said, See, this is&lt;br&gt;
new? It hath&lt;br&gt;
&amp;gt;   been already of old time, which was before us.&quot;    --&lt;br&gt;
Ecclesiastes&lt;br&gt;
&lt;br&gt;
So what are my options here? I would like a closed form&lt;br&gt;
solution so that I can plug in values into the variables&lt;br&gt;
directly and solve, but if that's not possible, is there any&lt;br&gt;
alternative?&lt;br&gt;
&lt;br&gt;
Thank you for all your help so far</description>
    </item>
    <item>
      <pubDate>Tue, 13 Nov 2007 02:42:42 -0500</pubDate>
      <title>Re: Solve Equation Symbolically</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/159189#400988</link>
      <author>roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)</author>
      <description>In article &amp;lt;fhajsd$bcg$1@fred.mathworks.com&amp;gt;,&lt;br&gt;
evan klinger &amp;lt;eklinger1-nospam@cox.net&amp;gt; wrote:&lt;br&gt;
&amp;gt;roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in&lt;br&gt;
&amp;gt;message &amp;lt;fhaiam$k8$1@canopus.cc.umanitoba.ca&amp;gt;...&lt;br&gt;
&amp;gt;&amp;gt; In article &amp;lt;fhag57$bca$1@fred.mathworks.com&amp;gt;,&lt;br&gt;
&amp;gt;&amp;gt; evan klinger &amp;lt;eklinger1-nospam@cox.net&amp;gt; wrote:&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt;Is there a way to increase the 25,000 character limit? I&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt;really need to solve up to cv12,&lt;br&gt;
&lt;br&gt;
&amp;gt;&amp;gt; you are trying to find the closed form solution to a&lt;br&gt;
&amp;gt;polynomial&lt;br&gt;
&amp;gt;&amp;gt; of order 12 that does not happen to be factorable down&lt;br&gt;
&lt;br&gt;
&amp;gt;So what are my options here? I would like a closed form&lt;br&gt;
&amp;gt;solution so that I can plug in values into the variables&lt;br&gt;
&amp;gt;directly and solve, but if that's not possible, is there any&lt;br&gt;
&amp;gt;alternative?&lt;br&gt;
&lt;br&gt;
What kind of ranges of values can your constants take?&lt;br&gt;
I've been playing around with some test values, and it looks to&lt;br&gt;
me as if you could easily encounter severe problems with loss of&lt;br&gt;
precision in your calculations, especially if cr &amp;gt; 2.&lt;br&gt;
&lt;br&gt;
With random values between -1 and 1 for the cv12 variables, it&lt;br&gt;
was fairly common in my trials for there to be an x root somewhere&lt;br&gt;
just a bit more than 2, but that by x = 3 that the function value&lt;br&gt;
had risen beyond 10^8 or 10^9 -- but with another one of my trials,&lt;br&gt;
the roots ranged from -7 to +4 . &lt;br&gt;
&lt;br&gt;
Unless your values (especially cr) are fairly small, I suspect&lt;br&gt;
you will lose precision so quickly as to make it very doubtful that&lt;br&gt;
you would be able to accurately find the equation roots.&lt;br&gt;
&lt;br&gt;
cr is the biggest contribution to the problem: as well as&lt;br&gt;
cv12 being a 12th order polynomial in x, it is also a 12th order&lt;br&gt;
polynomial in cr (cr and x will have the same polynomial order&lt;br&gt;
as each other in each cv*). Thus even a small change in cr can&lt;br&gt;
make a big change in the x roots. And a small change in cr can&lt;br&gt;
result in -different- 12th order roots becoming the real-valued&lt;br&gt;
roots, so even if you had an closed form solution for one of the&lt;br&gt;
12th-order roots, that root might become imaginary with a small&lt;br&gt;
change in parameters.&lt;br&gt;
&lt;br&gt;
For example, in a particular trial I did&lt;br&gt;
with random values for the parameters except p3, for p3=1/3,&lt;br&gt;
the first and 7th roots were the real roots, but for p3=1/2,&lt;br&gt;
the 6th and 7th roots were the real roots -- and p3 appears only&lt;br&gt;
in its first power in cv12.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
If I recall correctly, I have seen mention of a FEX contribution&lt;br&gt;
that generalizes fzero() to find multiple roots. You are&lt;br&gt;
probably going to have to use something like that, and to&lt;br&gt;
figure out what you want to do with the multiple roots that are&lt;br&gt;
found, but with some kinds of checks in place to ensure that you&lt;br&gt;
are not finding spurious roots (or failing to find valid roots)&lt;br&gt;
due to loss of precision.&lt;br&gt;
-- &lt;br&gt;
We regret to announce that sub-millibarn resolution bio-hyperdimensional&lt;br&gt;
plasmatic space polyimaging has been delayed until the release&lt;br&gt;
of Windows Vista SP2.</description>
    </item>
    <item>
      <pubDate>Tue, 13 Nov 2007 20:35:10 -0500</pubDate>
      <title>Re: Solve Equation Symbolically</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/159189#401113</link>
      <author>evan klinger</author>
      <description>roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in&lt;br&gt;
message &amp;lt;fhb2v2$jqi$1@canopus.cc.umanitoba.ca&amp;gt;...&lt;br&gt;
&amp;gt; In article &amp;lt;fhajsd$bcg$1@fred.mathworks.com&amp;gt;,&lt;br&gt;
&amp;gt; evan klinger &amp;lt;eklinger1-nospam@cox.net&amp;gt; wrote:&lt;br&gt;
&amp;gt; &amp;gt;roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in&lt;br&gt;
&amp;gt; &amp;gt;message &amp;lt;fhaiam$k8$1@canopus.cc.umanitoba.ca&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; In article &amp;lt;fhag57$bca$1@fred.mathworks.com&amp;gt;,&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; evan klinger &amp;lt;eklinger1-nospam@cox.net&amp;gt; wrote:&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt;Is there a way to increase the 25,000 character limit? I&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &amp;gt;really need to solve up to cv12,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; you are trying to find the closed form solution to a&lt;br&gt;
&amp;gt; &amp;gt;polynomial&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; of order 12 that does not happen to be factorable down&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &amp;gt;So what are my options here? I would like a closed form&lt;br&gt;
&amp;gt; &amp;gt;solution so that I can plug in values into the variables&lt;br&gt;
&amp;gt; &amp;gt;directly and solve, but if that's not possible, is there any&lt;br&gt;
&amp;gt; &amp;gt;alternative?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; What kind of ranges of values can your constants take?&lt;br&gt;
&amp;gt; I've been playing around with some test values, and it&lt;br&gt;
looks to&lt;br&gt;
&amp;gt; me as if you could easily encounter severe problems with&lt;br&gt;
loss of&lt;br&gt;
&amp;gt; precision in your calculations, especially if cr &amp;gt; 2.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; With random values between -1 and 1 for the cv12 variables, it&lt;br&gt;
&amp;gt; was fairly common in my trials for there to be an x root&lt;br&gt;
somewhere&lt;br&gt;
&amp;gt; just a bit more than 2, but that by x = 3 that the&lt;br&gt;
function value&lt;br&gt;
&amp;gt; had risen beyond 10^8 or 10^9 -- but with another one of&lt;br&gt;
my trials,&lt;br&gt;
&amp;gt; the roots ranged from -7 to +4 . &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Unless your values (especially cr) are fairly small, I suspect&lt;br&gt;
&amp;gt; you will lose precision so quickly as to make it very&lt;br&gt;
doubtful that&lt;br&gt;
&amp;gt; you would be able to accurately find the equation roots.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; cr is the biggest contribution to the problem: as well as&lt;br&gt;
&amp;gt; cv12 being a 12th order polynomial in x, it is also a 12th&lt;br&gt;
order&lt;br&gt;
&amp;gt; polynomial in cr (cr and x will have the same polynomial order&lt;br&gt;
&amp;gt; as each other in each cv*). Thus even a small change in cr can&lt;br&gt;
&amp;gt; make a big change in the x roots. And a small change in cr can&lt;br&gt;
&amp;gt; result in -different- 12th order roots becoming the&lt;br&gt;
real-valued&lt;br&gt;
&amp;gt; roots, so even if you had an closed form solution for one&lt;br&gt;
of the&lt;br&gt;
&amp;gt; 12th-order roots, that root might become imaginary with a&lt;br&gt;
small&lt;br&gt;
&amp;gt; change in parameters.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; For example, in a particular trial I did&lt;br&gt;
&amp;gt; with random values for the parameters except p3, for p3=1/3,&lt;br&gt;
&amp;gt; the first and 7th roots were the real roots, but for p3=1/2,&lt;br&gt;
&amp;gt; the 6th and 7th roots were the real roots -- and p3&lt;br&gt;
appears only&lt;br&gt;
&amp;gt; in its first power in cv12.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; If I recall correctly, I have seen mention of a FEX&lt;br&gt;
contribution&lt;br&gt;
&amp;gt; that generalizes fzero() to find multiple roots. You are&lt;br&gt;
&amp;gt; probably going to have to use something like that, and to&lt;br&gt;
&amp;gt; figure out what you want to do with the multiple roots&lt;br&gt;
that are&lt;br&gt;
&amp;gt; found, but with some kinds of checks in place to ensure&lt;br&gt;
that you&lt;br&gt;
&amp;gt; are not finding spurious roots (or failing to find valid&lt;br&gt;
roots)&lt;br&gt;
&amp;gt; due to loss of precision.&lt;br&gt;
&amp;gt; -- &lt;br&gt;
&amp;gt; We regret to announce that sub-millibarn resolution&lt;br&gt;
bio-hyperdimensional&lt;br&gt;
&amp;gt; plasmatic space polyimaging has been delayed until the release&lt;br&gt;
&amp;gt; of Windows Vista SP2.&lt;br&gt;
&lt;br&gt;
cr will always be between 0 and 1&lt;br&gt;
db will be in the millions&lt;br&gt;
p is usually between 0 and 1,000,000&lt;br&gt;
cv[n] is usually between 0 and a few million&lt;br&gt;
&lt;br&gt;
This is related to cost of insurance for a life insurance policy</description>
    </item>
    <item>
      <pubDate>Wed, 14 Nov 2007 07:52:20 -0500</pubDate>
      <title>Re: Solve Equation Symbolically</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/159189#401166</link>
      <author>roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)</author>
      <description>In article &amp;lt;fhd1pu$j8d$1@fred.mathworks.com&amp;gt;,&lt;br&gt;
evan klinger &amp;lt;eklinger1-nospam@cox.net&amp;gt; wrote:&lt;br&gt;
&amp;gt;roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in&lt;br&gt;
&amp;gt;message &amp;lt;fhb2v2$jqi$1@canopus.cc.umanitoba.ca&amp;gt;...&lt;br&gt;
&lt;br&gt;
&amp;gt;&amp;gt; What kind of ranges of values can your constants take?&lt;br&gt;
&amp;gt;&amp;gt; I've been playing around with some test values, and it&lt;br&gt;
&amp;gt;looks to&lt;br&gt;
&amp;gt;&amp;gt; me as if you could easily encounter severe problems with&lt;br&gt;
&amp;gt;loss of&lt;br&gt;
&amp;gt;&amp;gt; precision in your calculations, especially if cr &amp;gt; 2.&lt;br&gt;
&lt;br&gt;
&amp;gt;cr will always be between 0 and 1&lt;br&gt;
&amp;gt;db will be in the millions&lt;br&gt;
&amp;gt;p is usually between 0 and 1,000,000&lt;br&gt;
&amp;gt;cv[n] is usually between 0 and a few million&lt;br&gt;
&lt;br&gt;
cv12 has no real solutions if cv0 &amp;gt; db, which is a possibility&lt;br&gt;
under the constraints you have given (db &quot;in the millions&quot;&lt;br&gt;
could be as low as 1 million; cv0 up to &quot;a few million&quot;&lt;br&gt;
could exceed that value.)&lt;br&gt;
&lt;br&gt;
I tried each combination of the lower and upper value you gave&lt;br&gt;
for each parameter. Taking only the extremes, there were&lt;br&gt;
real roots for each case unless cv0 &amp;gt; db. The cases that had&lt;br&gt;
only one real root, that root was &amp;gt;= 0. The cases that had&lt;br&gt;
two real roots, the second root was &amp;lt; 0.&lt;br&gt;
&lt;br&gt;
In random trials over the range of parameters, -usually- there was&lt;br&gt;
one positive and one negative root, but in one of the cases there&lt;br&gt;
were only two negative roots. In one of the cases, the positive root&lt;br&gt;
was about +46 instead of the typical 0.08 - 0.25 range. That's going&lt;br&gt;
to make it difficult to give good starting guesses for the ranges,&lt;br&gt;
since your precision will usually be completely washed out before x = 4.&lt;br&gt;
-- &lt;br&gt;
We regret to announce that sub-millibarn resolution bio-hyperdimensional&lt;br&gt;
plasmatic space polyimaging has been delayed until the release&lt;br&gt;
of Windows Vista SP2.</description>
    </item>
    <item>
      <pubDate>Wed, 14 Nov 2007 16:38:03 -0500</pubDate>
      <title>Re: Solve Equation Symbolically</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/159189#401253</link>
      <author>evan klinger</author>
      <description>roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in&lt;br&gt;
message &amp;lt;fhe9fk$l62$1@canopus.cc.umanitoba.ca&amp;gt;...&lt;br&gt;
&amp;gt; In article &amp;lt;fhd1pu$j8d$1@fred.mathworks.com&amp;gt;,&lt;br&gt;
&amp;gt; evan klinger &amp;lt;eklinger1-nospam@cox.net&amp;gt; wrote:&lt;br&gt;
&amp;gt; &amp;gt;roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in&lt;br&gt;
&amp;gt; &amp;gt;message &amp;lt;fhb2v2$jqi$1@canopus.cc.umanitoba.ca&amp;gt;...&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; What kind of ranges of values can your constants take?&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; I've been playing around with some test values, and it&lt;br&gt;
&amp;gt; &amp;gt;looks to&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; me as if you could easily encounter severe problems with&lt;br&gt;
&amp;gt; &amp;gt;loss of&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; precision in your calculations, especially if cr &amp;gt; 2.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &amp;gt;cr will always be between 0 and 1&lt;br&gt;
&amp;gt; &amp;gt;db will be in the millions&lt;br&gt;
&amp;gt; &amp;gt;p is usually between 0 and 1,000,000&lt;br&gt;
&amp;gt; &amp;gt;cv[n] is usually between 0 and a few million&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; cv12 has no real solutions if cv0 &amp;gt; db, which is a possibility&lt;br&gt;
&amp;gt; under the constraints you have given (db &quot;in the millions&quot;&lt;br&gt;
&amp;gt; could be as low as 1 million; cv0 up to &quot;a few million&quot;&lt;br&gt;
&amp;gt; could exceed that value.)&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I tried each combination of the lower and upper value you gave&lt;br&gt;
&amp;gt; for each parameter. Taking only the extremes, there were&lt;br&gt;
&amp;gt; real roots for each case unless cv0 &amp;gt; db. The cases that had&lt;br&gt;
&amp;gt; only one real root, that root was &amp;gt;= 0. The cases that had&lt;br&gt;
&amp;gt; two real roots, the second root was &amp;lt; 0.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; In random trials over the range of parameters, -usually-&lt;br&gt;
there was&lt;br&gt;
&amp;gt; one positive and one negative root, but in one of the&lt;br&gt;
cases there&lt;br&gt;
&amp;gt; were only two negative roots. In one of the cases, the&lt;br&gt;
positive root&lt;br&gt;
&amp;gt; was about +46 instead of the typical 0.08 - 0.25 range.&lt;br&gt;
That's going&lt;br&gt;
&amp;gt; to make it difficult to give good starting guesses for the&lt;br&gt;
ranges,&lt;br&gt;
&amp;gt; since your precision will usually be completely washed out&lt;br&gt;
before x = 4.&lt;br&gt;
&amp;gt; -- &lt;br&gt;
&amp;gt; We regret to announce that sub-millibarn resolution&lt;br&gt;
bio-hyperdimensional&lt;br&gt;
&amp;gt; plasmatic space polyimaging has been delayed until the release&lt;br&gt;
&amp;gt; of Windows Vista SP2.&lt;br&gt;
&lt;br&gt;
This is what I'm currently using to solve it. It takes about&lt;br&gt;
10 seconds to solve. Is there a way to optimize it?&lt;br&gt;
&lt;br&gt;
Thanks&lt;br&gt;
&lt;br&gt;
function [coi] = calc_coi(cv0, db, cr,&lt;br&gt;
p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,cvgoal)&lt;br&gt;
&lt;br&gt;
syms x&lt;br&gt;
cv1 = (cv0+p1-x*(db-cv0))*(1+cr);&lt;br&gt;
simplify(cv1);&lt;br&gt;
cv2 = (cv1+p2-x*(db-cv1))*(1+cr);&lt;br&gt;
simplify(cv2);&lt;br&gt;
cv3 = (cv2+p3-x*(db-cv2))*(1+cr);&lt;br&gt;
simplify(cv3);&lt;br&gt;
cv4 = (cv3+p4-x*(db-cv3))*(1+cr);&lt;br&gt;
simplify(cv4);&lt;br&gt;
cv5 = (cv4+p5-x*(db-cv4))*(1+cr);&lt;br&gt;
simplify(cv5);&lt;br&gt;
cv6 = (cv5+p6-x*(db-cv5))*(1+cr);&lt;br&gt;
simplify(cv6);&lt;br&gt;
cv7 = (cv6+p7-x*(db-cv6))*(1+cr);&lt;br&gt;
simplify(cv7);&lt;br&gt;
cv8 = (cv7+p8-x*(db-cv7))*(1+cr);&lt;br&gt;
simplify(cv8);&lt;br&gt;
cv9 = (cv8+p9-x*(db-cv8))*(1+cr);&lt;br&gt;
simplify(cv9);&lt;br&gt;
cv10 = (cv9+p10-x*(db-cv9))*(1+cr);&lt;br&gt;
simplify(cv10);&lt;br&gt;
cv11 = (cv10+p11-x*(db-cv10))*(1+cr);&lt;br&gt;
simplify(cv11);&lt;br&gt;
cv12 = (cv11 + p12 - (x)*(db-cv11))*(1+cr);&lt;br&gt;
simplify(cv12);&lt;br&gt;
eq = cv12 - cvgoal;&lt;br&gt;
ret = solve(eq);&lt;br&gt;
&lt;br&gt;
coi = ret(1);&lt;br&gt;
&lt;br&gt;
If I remove the simplify() commands it takes even longer, up&lt;br&gt;
to 18 seconds.</description>
    </item>
    <item>
      <pubDate>Thu, 15 Nov 2007 21:38:56 -0500</pubDate>
      <title>Re: Solve Equation Symbolically</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/159189#401572</link>
      <author>evan klinger</author>
      <description>&quot;evan klinger&quot; &amp;lt;eklinger1-nospam@cox.net&amp;gt; wrote in message&lt;br&gt;
&amp;lt;fhf89b$srr$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in&lt;br&gt;
&amp;gt; message &amp;lt;fhe9fk$l62$1@canopus.cc.umanitoba.ca&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; In article &amp;lt;fhd1pu$j8d$1@fred.mathworks.com&amp;gt;,&lt;br&gt;
&amp;gt; &amp;gt; evan klinger &amp;lt;eklinger1-nospam@cox.net&amp;gt; wrote:&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;message &amp;lt;fhb2v2$jqi$1@canopus.cc.umanitoba.ca&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;&amp;gt; What kind of ranges of values can your constants take?&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;&amp;gt; I've been playing around with some test values, and it&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;looks to&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;&amp;gt; me as if you could easily encounter severe problems with&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;loss of&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;&amp;gt; precision in your calculations, especially if cr &amp;gt; 2.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;cr will always be between 0 and 1&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;db will be in the millions&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;p is usually between 0 and 1,000,000&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;cv[n] is usually between 0 and a few million&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; cv12 has no real solutions if cv0 &amp;gt; db, which is a&lt;br&gt;
possibility&lt;br&gt;
&amp;gt; &amp;gt; under the constraints you have given (db &quot;in the millions&quot;&lt;br&gt;
&amp;gt; &amp;gt; could be as low as 1 million; cv0 up to &quot;a few million&quot;&lt;br&gt;
&amp;gt; &amp;gt; could exceed that value.)&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; I tried each combination of the lower and upper value&lt;br&gt;
you gave&lt;br&gt;
&amp;gt; &amp;gt; for each parameter. Taking only the extremes, there were&lt;br&gt;
&amp;gt; &amp;gt; real roots for each case unless cv0 &amp;gt; db. The cases that had&lt;br&gt;
&amp;gt; &amp;gt; only one real root, that root was &amp;gt;= 0. The cases that had&lt;br&gt;
&amp;gt; &amp;gt; two real roots, the second root was &amp;lt; 0.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; In random trials over the range of parameters, -usually-&lt;br&gt;
&amp;gt; there was&lt;br&gt;
&amp;gt; &amp;gt; one positive and one negative root, but in one of the&lt;br&gt;
&amp;gt; cases there&lt;br&gt;
&amp;gt; &amp;gt; were only two negative roots. In one of the cases, the&lt;br&gt;
&amp;gt; positive root&lt;br&gt;
&amp;gt; &amp;gt; was about +46 instead of the typical 0.08 - 0.25 range.&lt;br&gt;
&amp;gt; That's going&lt;br&gt;
&amp;gt; &amp;gt; to make it difficult to give good starting guesses for the&lt;br&gt;
&amp;gt; ranges,&lt;br&gt;
&amp;gt; &amp;gt; since your precision will usually be completely washed out&lt;br&gt;
&amp;gt; before x = 4.&lt;br&gt;
&amp;gt; &amp;gt; -- &lt;br&gt;
&amp;gt; &amp;gt; We regret to announce that sub-millibarn resolution&lt;br&gt;
&amp;gt; bio-hyperdimensional&lt;br&gt;
&amp;gt; &amp;gt; plasmatic space polyimaging has been delayed until the&lt;br&gt;
release&lt;br&gt;
&amp;gt; &amp;gt; of Windows Vista SP2.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; This is what I'm currently using to solve it. It takes about&lt;br&gt;
&amp;gt; 10 seconds to solve. Is there a way to optimize it?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thanks&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; function [coi] = calc_coi(cv0, db, cr,&lt;br&gt;
&amp;gt; p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,cvgoal)&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; syms x&lt;br&gt;
&amp;gt; cv1 = (cv0+p1-x*(db-cv0))*(1+cr);&lt;br&gt;
&amp;gt; simplify(cv1);&lt;br&gt;
&amp;gt; cv2 = (cv1+p2-x*(db-cv1))*(1+cr);&lt;br&gt;
&amp;gt; simplify(cv2);&lt;br&gt;
&amp;gt; cv3 = (cv2+p3-x*(db-cv2))*(1+cr);&lt;br&gt;
&amp;gt; simplify(cv3);&lt;br&gt;
&amp;gt; cv4 = (cv3+p4-x*(db-cv3))*(1+cr);&lt;br&gt;
&amp;gt; simplify(cv4);&lt;br&gt;
&amp;gt; cv5 = (cv4+p5-x*(db-cv4))*(1+cr);&lt;br&gt;
&amp;gt; simplify(cv5);&lt;br&gt;
&amp;gt; cv6 = (cv5+p6-x*(db-cv5))*(1+cr);&lt;br&gt;
&amp;gt; simplify(cv6);&lt;br&gt;
&amp;gt; cv7 = (cv6+p7-x*(db-cv6))*(1+cr);&lt;br&gt;
&amp;gt; simplify(cv7);&lt;br&gt;
&amp;gt; cv8 = (cv7+p8-x*(db-cv7))*(1+cr);&lt;br&gt;
&amp;gt; simplify(cv8);&lt;br&gt;
&amp;gt; cv9 = (cv8+p9-x*(db-cv8))*(1+cr);&lt;br&gt;
&amp;gt; simplify(cv9);&lt;br&gt;
&amp;gt; cv10 = (cv9+p10-x*(db-cv9))*(1+cr);&lt;br&gt;
&amp;gt; simplify(cv10);&lt;br&gt;
&amp;gt; cv11 = (cv10+p11-x*(db-cv10))*(1+cr);&lt;br&gt;
&amp;gt; simplify(cv11);&lt;br&gt;
&amp;gt; cv12 = (cv11 + p12 - (x)*(db-cv11))*(1+cr);&lt;br&gt;
&amp;gt; simplify(cv12);&lt;br&gt;
&amp;gt; eq = cv12 - cvgoal;&lt;br&gt;
&amp;gt; ret = solve(eq);&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; coi = ret(1);&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; If I remove the simplify() commands it takes even longer, up&lt;br&gt;
&amp;gt; to 18 seconds.&lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Bump&lt;br&gt;
&amp;nbsp;</description>
    </item>
  </channel>
</rss>

