Sorry, an error occurred while loading the content.

## Re: Line Chart: problem with polynomial equation

Expand Messages
• Yes, it s E is indeed 10 to the power of . There s also a shortcut in javascript for that 3e-18 is also the same as the one you posted below... I maybe
Message 1 of 5 , Aug 26, 2009
• 0 Attachment
Yes, it's E is indeed "10 to the power of ". There's also a shortcut in javascript for that 3e-18 is also the same as the one you posted below...

I maybe absent-minded when this was taught at high school math !
:D
Thanks !

--- In ydn-javascript@yahoogroups.com, "mattatlamplight" <matt@...> wrote:
>
> Isn't E in this context 10 to the power of, so:
>
> y= 3*Math.pow( 10,-18)*Math.pow( x, 4) - 1*Math.pow(10,-12)*Math.pow(x,3) and so on.
>
> It's a bit hard to tell from the formatting of the equation in your post, but I think the above should be right. E is usually the scientific notation (10^x), I'd have thought. Euler's e is always lower case, as far as I know.
>
> Matt
>
> --- In ydn-javascript@yahoogroups.com, "r2b2_ry" <r2b2_ry@> wrote:
> >
> > Well, that equation runs, but its not really giving the correct result.
> >
> > For example , if we set x to 40,000 m3/d (its capex should be \$1,400) but the equation gives - 46080768011199996000 which is not correct.
> >
> > I just assumed the E in "3E" is Euler's constant but I think I'm wrong. If only there's a way to convert Excel's methods to Javascript (look for the 3rd order polynomial):
> >
> > http://spreadsheetpage.com/index.php/tip/chart_trendline_formulas/
> >
> >
> >
> > --- In ydn-javascript@yahoogroups.com, Ruben Leon <lightsteel@> wrote:
> > >
> > > y = 3*Math.E - 18*Math.pow(x,4) - Math.E + 12*Math.pow(x,3) + 2*Math.E - 7*Math.pow(x,2) - 0.0148*x + 1766.2;
> > >
> > > Why all the extra parenthesis?
> > > Are you not getting the results you expected in the final calculation?
> > >
> > >
> > >
> > >
> > > ________________________________
> > > From: r2b2_ry <r2b2_ry@>
> > > To: ydn-javascript@yahoogroups.com
> > > Sent: Tuesday, August 25, 2009 7:14:35 PM
> > > Subject: [ydn-javascript] Line Chart: problem with polynomial equation
> > >
> > >
> > > Hello,
> > > I have this data which should be plotted in line chart to make a curve:
> > >
> > > (x axis)Capacity CAPEX (y axis)
> > >
> > > 1,000 m3/d \$1,800/(m3/d)
> > > 5,000 m3/d \$1,700/(m3/d)
> > > 10,000 m3/d \$1,600/(m3/d)
> > > 15,000 m3/d \$1,550/(m3/d)
> > > 20,000 m3/d \$1,500/(m3/d)
> > > 25,000 m3/d \$1,475/(m3/d)
> > > 30,000 m3/d \$1,450/(m3/d)
> > > 35,000 m3/d \$1,425/(m3/d)
> > > 40,000 m3/d \$1,400/(m3/d)
> > > 45,000 m3/d \$1,380/(m3/d)
> > >
> > > ..and so on
> > >
> > > I have to plot another data series called 'Trendline'. The formula associated with that trend line is then used to calculate costs for intermediate capacities that do not appear above, eg 43,000 m3/d, or 23,000 m3/d.
> > >
> > > Excel generated the formula for that trendline series, my only problem is how I can convert the complex polynomial formula to javascript. Here it is:
> > >
> > > y = 3E - 18x4 - 1E - 12x3 + 2E-07x2 - 0.0148x + 1766.2
> > >
> > > And this is my futile attempt to have this formula in javascript :
> > >
> > > I assumed the variable E stands for Euler's constant, and x being the given Capacity
> > >
> > > x = 40000;
> > > y = ((3 * Math.E ) - (18 * Math.pow(x,4) )) - ((1 * Math.E) + (12 * Math.pow(x,3) )) + ((2 * Math.E) - (7 * Math.pow(x,2) )) - (( 0.0148 * x ) + 1766.2);
> > >
> > > Please help .. thanks !
> > >
> >
>
Your message has been successfully submitted and would be delivered to recipients shortly.