Table Head (thead) |
---|
Table Row (tr) |
---|
| Table Head (th) |
---|
| Method Details |
|
|
Table Body (tbody) |
---|
id | addPolynomial-Polynomial |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
addPolynomial |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Adds another polynomial to this polynomial. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| // (x+1) + 2*(x+1)*x + 3*(x+1)*x^2 + 4*(x+1)*x^3
var eq = plugins.amortization.newPolynomial();
for (var i = 0; i < 4; i++)
{
var base = plugins.amortization.newPolynomial();
base.addTerm(1, 1);
base.addTerm(1, 0);
base.multiplyByTerm(1, i);
base.multiplyByTerm(i + 1, 0);
eq.addPolynomial(base);
}
application.output(eq.getValue(2)); |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
(coefficient, exponent) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Adds a term to this polynomial. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| // (x+1) + 2*(x+1)*x + 3*(x+1)*x^2 + 4*(x+1)*x^3
var eq = plugins.amortization.newPolynomial();
for (var i = 0; i < 4; i++)
{
var base = plugins.amortization.newPolynomial();
base.addTerm(1, 1);
base.addTerm(1, 0);
base.multiplyByTerm(1, i);
base.multiplyByTerm(i + 1, 0);
eq.addPolynomial(base);
}
application.output(eq.getValue(2)); |
|
|
|
|
Table Body (tbody) |
---|
id | findRoot-Number_Number_Number |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
(startValue, error, iterations) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Finds a root of this polynomial using Newton's method, starting from an initial search value, and with a given precision. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| // Model the quadratic equation -x^2 + 4x + 0.6 = 0
var eq = plugins.amortization.newPolynomial();
|
|
|
|
| base1 base10 basemultiplyByTerm1i
base.multiplyByTerm(i + 1, 0);
eq.addPolynomial(base);
}
application.output(eq.getValue(2));
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=18184999-89C5-4522-A0A0-BCDE3F293FF7}{tr:id=name}{td}h6.addTerm{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}addTerm{span}{span:id=iets|style=float: left;}\(coefficient, exponent){span}{td}{tr}{tr:id=des}{td}{sub-section:18184999-89C5-4522-A0A0-BCDE3F293FF7_des|text=|trigger=button}{sub-section}{sub-section:18184999-89C5-4522-A0A0-BCDE3F293FF7_des|trigger=none|class=sIndent}Adds a term to this polynomial.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:18184999-89C5-4522-A0A0-BCDE3F293FF7_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:18184999-89C5-4522-A0A0-BCDE3F293FF7_prs|trigger=none}coefficient
exponent
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:18184999-89C5-4522-A0A0-BCDE3F293FF7_ret|text=|trigger=button}{sub-section}{sub-section:18184999-89C5-4522-A0A0-BCDE3F293FF7_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:18184999-89C5-4522-A0A0-BCDE3F293FF7_see|text=|trigger=button}{sub-section}{sub-section:18184999-89C5-4522-A0A0-BCDE3F293FF7_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:18184999-89C5-4522-A0A0-BCDE3F293FF7_see|text=|trigger=button}{sub-section}{sub-section:18184999-89C5-4522-A0A0-BCDE3F293FF7_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:18184999-89C5-4522-A0A0-BCDE3F293FF7_sam|text=|trigger=button}{sub-section}{sub-section:18184999-89C5-4522-A0A0-BCDE3F293FF7_sam|class=sIndent|trigger=none}{code:language=javascript}
// Model the quadratic equation -x^2
// Find the roots of the equation.
r1 = eq.findRoot(100, 1E-5, 1000);
r2 = eq.findRoot(-100, 1E-5, 1000);
application.output("eq(" + r1 + ")=" + eq.getValue(r1));
application.output("eq(" + r2 + ")=" + eq.getValue(r2));
// Find the minimum/maximum point by zeroing the first derivative.
var deriv = eq.getDerivative();
rd = deriv.findRoot(0, 1E-5, 1000);
application.output("Min/max point: " + rd);
application.output("Min/max value: " + eq.getValue(rd));
if (deriv.getDerivativeValue(rd) < 0) application.output("Max point.");
else application.output("Min point."); |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getDerivative |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Returns a polynomial that holds the derivative of this polynomial. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| // Model the quadratic equation -x^2 + 4x + 0.6 = 0
var eq = plugins.amortization.newPolynomial();
eq.addTerm(-1, 2);
eq.addTerm(4, 1);
eq.addTerm(0.6, 0);
// Find the roots of the equation.
r1 = eq.findRoot(100, 1E-5, 1000);
r2 = eq.findRoot(-100, 1E-5, 1000);
application.output("eq(" + r1 + ")=" + eq.getValue(r1));
application.output("eq(" + r2 + ")=" + eq.getValue(r2));
// Find the minimum/maximum point by zeroing the first derivative.
var deriv = eq.getDerivative();
rd = deriv.findRoot(0, 1E-5, 1000);
application.output("Min/max point: " + rd);
application.output("Min/max value: " + eq.getValue(rd));
if (deriv.getDerivativeValue(rd) < 0) application.output("Max point.");
else application.output("Min point."); |
|
|
|
|
Table Body (tbody) |
---|
id | getDerivativeValue-Number |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getDerivativeValue |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Returns the value of the derivative of this polynomial in a certain point. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| // Model the quadratic equation -x^2 + 4x + 0.6 = 0
var eq = plugins.amortization.newPolynomial();
eq.addTerm(-1, 2);
eq.addTerm(4, 1);
eq.addTerm(0.6, 0);
// Find the roots of the equation.
r1 = eq.findRoot(100, 1E-5, 1000);
r2 = eq.findRoot(-100, 1E-5, 1000);
application.output("eq(" + r1 + ")=" + eq.getValue(r1));
application.output("eq(" + r2 + ")=" + eq.getValue(r2));
// Find the minimum/maximum point by zeroing the first derivative.
var deriv = eq.getDerivative();
rd = deriv.findRoot(0, 1E-5, 1000);
application.output("Min/max point: " + rd);
application.output("Min/max value: " + eq.getValue(rd));
if (deriv.getDerivativeValue(rd) < 0) application.output("Max point.");
else application.output("Min point."); |
|
|
|
|
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=3C5F007F-48C3-4726-9A69-F5E6D12A7EDC}{tr:id=name}{td}h6.findRoot{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Number]{span}{span:id=iets|style=float: left; font-weight: bold;}findRoot{span}{span:id=iets|style=float: left;}\(startValue, error, iterations){span}{td}{tr}{tr:id=des}{td}{sub-section:3C5F007F-48C3-4726-9A69-F5E6D12A7EDC_des|text=|trigger=button}{sub-section}{sub-section:3C5F007F-48C3-4726-9A69-F5E6D12A7EDC_des|trigger=none|class=sIndent}Finds a root of this polynomial using Newton's method, starting from an initial search value, and with a given precision.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:3C5F007F-48C3-4726-9A69-F5E6D12A7EDC_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:3C5F007F-48C3-4726-9A69-F5E6D12A7EDC_prs|trigger=none}startValue
error
iterations
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:3C5F007F-48C3-4726-9A69-F5E6D12A7EDC_ret|text=|trigger=button}{sub-section}{sub-section:3C5F007F-48C3-4726-9A69-F5E6D12A7EDC_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:3C5F007F-48C3-4726-9A69-F5E6D12A7EDC_see|text=|trigger=button}{sub-section}{sub-section:3C5F007F-48C3-4726-9A69-F5E6D12A7EDC_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:3C5F007F-48C3-4726-9A69-F5E6D12A7EDC_see|text=|trigger=button}{sub-section}{sub-section:3C5F007F-48C3-4726-9A69-F5E6D12A7EDC_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:3C5F007F-48C3-4726-9A69-F5E6D12A7EDC_sam|text=|trigger=button}{sub-section}{sub-section:3C5F007F-48C3-4726-9A69-F5E6D12A7EDC_sam|class=sIndent|trigger=none}{code:language=javascript}
// Model the quadratic equation -x^2 + 4x + 0.6 = 0
var eq = plugins.amortization.newPolynomial();
eq.addTerm(-1, 2);
eq.addTerm(4, 1);
eq.addTerm(0.6, 0);
// Find the roots of the equation.
r1 = eq.findRoot(100, 1E-5, 1000);
r2 = eq.findRoot(-100, 1E-5, 1000);
application.output("eq(" + r1 + ")=" + eq.getValue(r1));
application.output("eq(" + r2 + ")=" + eq.getValue(r2));
// Find the minimum/maximum point by zeroing the first derivative.
var deriv = eq.getDerivative();
rd = deriv.findRoot(0, 1E-5, 1000);
application.output("Min/max point: " + rd);
application.output("Min/max value: " + eq.getValue(rd));
if (deriv.getDerivativeValue(rd) < 0) application.output("Max point.");
else application.output("Min point.");
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=9DF6AC08-6915-4251-B446-478A00E5C8BE}{tr:id=name}{td}h6.getDerivative{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Polynomial]{span}{span:id=iets|style=float: left; font-weight: bold;}getDerivative{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:9DF6AC08-6915-4251-B446-478A00E5C8BE_des|text=|trigger=button}{sub-section}{sub-section:9DF6AC08-6915-4251-B446-478A00E5C8BE_des|trigger=none|class=sIndent}Returns a polynomial that holds the derivative of this polynomial.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:9DF6AC08-6915-4251-B446-478A00E5C8BE_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:9DF6AC08-6915-4251-B446-478A00E5C8BE_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:9DF6AC08-6915-4251-B446-478A00E5C8BE_ret|text=|trigger=button}{sub-section}{sub-section:9DF6AC08-6915-4251-B446-478A00E5C8BE_ret|trigger=none|class=sIndent}[Polynomial]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:9DF6AC08-6915-4251-B446-478A00E5C8BE_see|text=|trigger=button}{sub-section}{sub-section:9DF6AC08-6915-4251-B446-478A00E5C8BE_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:9DF6AC08-6915-4251-B446-478A00E5C8BE_see|text=|trigger=button}{sub-section}{sub-section:9DF6AC08-6915-4251-B446-478A00E5C8BE_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:9DF6AC08-6915-4251-B446-478A00E5C8BE_sam|text=|trigger=button}{sub-section}{sub-section:9DF6AC08-6915-4251-B446-478A00E5C8BE_sam|class=sIndent|trigger=none}{code:language=javascript}
// Model the quadratic equation -x^2 + 4x + 0.6 = 0
var eq = plugins.amortization.newPolynomial();
eq.addTerm(-1, 2);
eq.addTerm(4, 1);
eq.addTerm(0.6, 0);
// Find the roots of the equation.
r1 = eq.findRoot(100, 1E-5, 1000);
r2 = eq.findRoot(-100, 1E-5, 1000);
application.output("eq(" + r1 + ")=" + eq.getValue(r1));
application.output("eq(" + r2 + ")=" + eq.getValue(r2));
// Find the minimum/maximum point by zeroing the first derivative.
var deriv = eq.getDerivative();
rd = deriv.findRoot(0, 1E-5, 1000);
application.output("Min/max point: " + rd);
application.output("Min/max value: " + eq.getValue(rd));
if (deriv.getDerivativeValue(rd) < 0) application.output("Max point.");
else application.output("Min point.");
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=BF1E2877-D68F-4B7C-A852-C56BCA38C8A4}{tr:id=name}{td}h6.getDerivativeValue{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Number]{span}{span:id=iets|style=float: left; font-weight: bold;}getDerivativeValue{span}{span:id=iets|style=float: left;}\(x){span}{td}{tr}{tr:id=des}{td}{sub-section:BF1E2877-D68F-4B7C-A852-C56BCA38C8A4_des|text=|trigger=button}{sub-section}{sub-section:BF1E2877-D68F-4B7C-A852-C56BCA38C8A4_des|trigger=none|class=sIndent}Returns the value of the derivative of this polynomial in a certain point.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:BF1E2877-D68F-4B7C-A852-C56BCA38C8A4_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:BF1E2877-D68F-4B7C-A852-C56BCA38C8A4_prs|trigger=none}x
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:BF1E2877-D68F-4B7C-A852-C56BCA38C8A4_ret|text=|trigger=button}{sub-section}{sub-section:BF1E2877-D68F-4B7C-A852-C56BCA38C8A4_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:BF1E2877-D68F-4B7C-A852-C56BCA38C8A4_see|text=|trigger=button}{sub-section}{sub-section:BF1E2877-D68F-4B7C-A852-C56BCA38C8A4_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:BF1E2877-D68F-4B7C-A852-C56BCA38C8A4_see|text=|trigger=button}{sub-section}{sub-section:BF1E2877-D68F-4B7C-A852-C56BCA38C8A4_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:BF1E2877-D68F-4B7C-A852-C56BCA38C8A4_sam|text=|trigger=button}{sub-section}{sub-section:BF1E2877-D68F-4B7C-A852-C56BCA38C8A4_sam|class=sIndent|trigger=none}{code:language=javascript}
// Model the quadratic equation -x^2 + 4x + 0.6 = 0
var eq = plugins.amortization.newPolynomial();
eq.addTerm(-1, 2);
eq.addTerm(4, 1);
eq.addTerm(0.6, 0);
// Find the roots of the equation.
r1 = eq.findRoot(100, 1E-5, 1000);
r2 = eq.findRoot(-100, 1E-5, 1000);
application.output("eq(" + r1 + ")=" + eq.getValue(r1));
application.output("eq(" + r2 + ")=" + eq.getValue(r2));
// Find the minimum/maximum point by zeroing the first derivative.
var deriv = eq.getDerivative();
rd = deriv.findRoot(0, 1E-5, 1000);
application.output("Min/max point: " + rd);
application.output("Min/max value: " + eq.getValue(rd));
if (deriv.getDerivativeValue(rd) < 0) application.output("Max point.");
else application.output("Min point.");
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=3D893324-7AA0-428C-ACAC-6A96C8CEBFC9}{tr:id=name}{td}h6.getValue{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Number]{span}{span:id=iets|style=float: left; font-weight: bold;}getValue{span}{span:id=iets|style=float: left;}\(x){span}{td}{tr}{tr:id=des}{td}{sub-section:3D893324-7AA0-428C-ACAC-6A96C8CEBFC9_des|text=|trigger=button}{sub-section}{sub-section:3D893324-7AA0-428C-ACAC-6A96C8CEBFC9_des|trigger=none|class=sIndent}Returns the value of this polynomial in a certain point.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:3D893324-7AA0-428C-ACAC-6A96C8CEBFC9_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:3D893324-7AA0-428C-ACAC-6A96C8CEBFC9_prs|trigger=none}x
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:3D893324-7AA0-428C-ACAC-6A96C8CEBFC9_ret|text=|trigger=button}{sub-section}{sub-section:3D893324-7AA0-428C-ACAC-6A96C8CEBFC9_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:3D893324-7AA0-428C-ACAC-6A96C8CEBFC9_see|text=|trigger=button}{sub-section}{sub-section:3D893324-7AA0-428C-ACAC-6A96C8CEBFC9_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:3D893324-7AA0-428C-ACAC-6A96C8CEBFC9_see|text=|trigger=button}{sub-section}{sub-section:3D893324-7AA0-428C-ACAC-6A96C8CEBFC9_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:3D893324-7AA0-428C-ACAC-6A96C8CEBFC9_sam|text=|trigger=button}{sub-section}{sub-section:3D893324-7AA0-428C-ACAC-6A96C8CEBFC9_sam|class=sIndent|trigger=none}{code:language=javascript}
// Model the quadratic equation -x^2 + 4x + 0.6 = 0
var eq = plugins.amortization.newPolynomial();
eq.addTerm(-1, 2);
eq.addTerm(4, 1);
eq.addTerm(0.6, 0);
// Find the roots of the equation.
r1 = eq.findRoot(100, 1E-5, 1000);
r2 = eq.findRoot(-100, 1E-5, 1000);
application.output("eq(" + r1 + ")=" + eq.getValue(r1));
application.output("eq(" + r2 + ")=" + eq.getValue(r2));
// Find the minimum/maximum point by zeroing the first derivative.
var deriv = eq.getDerivative();
rd = deriv.findRoot(0, 1E-5, 1000);
application.output("Min/max point: " + rd);
application.output("Min/max value: " + eq.getValue(rd));
if (deriv.getDerivativeValue(rd) < 0) application.output("Max point.");
else application.output("Min point.");
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=8A796D09-D827-41BE-8844-118872D57F21}{tr:id=name}{td}h6.multiplyByPolynomial{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}multiplyByPolynomial{span}{span:id=iets|style=float: left;}\(polynomial){span}{td}{tr}{tr:id=des}{td}{sub-section:8A796D09-D827-41BE-8844-118872D57F21_des|text=|trigger=button}{sub-section}{sub-section:8A796D09-D827-41BE-8844-118872D57F21_des|trigger=none|class=sIndent}Multiplies this polynomial with another polynomial.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:8A796D09-D827-41BE-8844-118872D57F21_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:8A796D09-D827-41BE-8844-118872D57F21_prs|trigger=none}polynomial
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:8A796D09-D827-41BE-8844-118872D57F21_ret|text=|trigger=button}{sub-section}{sub-section:8A796D09-D827-41BE-8844-118872D57F21_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:8A796D09-D827-41BE-8844-118872D57F21_see|text=|trigger=button}{sub-section}{sub-section:8A796D09-D827-41BE-8844-118872D57F21_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:8A796D09-D827-41BE-8844-118872D57F21_see|text=|trigger=button}{sub-section}{sub-section:8A796D09-D827-41BE-8844-118872D57F21_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:8A796D09-D827-41BE-8844-118872D57F21_sam|text=|trigger=button}{sub-section}{sub-section:8A796D09-D827-41BE-8844-118872D57F21_sam|class=sIndent|trigger=none}{code:language=javascript}
// Model the quadratic equation (x+1)*(x+2) = 0
var eq = plugins.amortization.newPolynomial();
eq.addTerm(1, 1);
eq.addTerm(1, 0);
var eq2 = plugins.amortization.newPolynomial();
eq2.addTerm(1, 1);
eq2.addTerm(2, 0);
eq.multiplyByPolynomial(eq2);
// Find the roots of the equation.
r1 = eq.findRoot(100, 1E-5, 1000);
r2 = eq.findRoot(-100, 1E-5, 1000);
application.output("eq(" + r1 + ")=" + eq.getValue(r1));
application.output("eq(" + r2 + ")=" + eq.getValue(r2));
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=2CB97081-F3E9-4029-8B91-97835FDEA306}{tr:id=name}{td}h6.multiplyByTerm{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}multiplyByTerm{span}{span:id=iets|style=float: left;}\(coefficient, exponent){span}{td}{tr}{tr:id=des}{td}{sub-section:2CB97081-F3E9-4029-8B91-97835FDEA306_des|text=|trigger=button}{sub-section}{sub-section:2CB97081-F3E9-4029-8B91-97835FDEA306_des|trigger=none|class=sIndent}Multiples this polynomial with a term.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:2CB97081-F3E9-4029-8B91-97835FDEA306_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:2CB97081-F3E9-4029-8B91-97835FDEA306_prs|trigger=none}coefficient
exponent
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:2CB97081-F3E9-4029-8B91-97835FDEA306_ret|text=|trigger=button}{sub-section}{sub-section:2CB97081-F3E9-4029-8B91-97835FDEA306_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:2CB97081-F3E9-4029-8B91-97835FDEA306_see|text=|trigger=button}{sub-section}{sub-section:2CB97081-F3E9-4029-8B91-97835FDEA306_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:2CB97081-F3E9-4029-8B91-97835FDEA306_see|text=|trigger=button}{sub-section}{sub-section:2CB97081-F3E9-4029-8B91-97835FDEA306_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:2CB97081-F3E9-4029-8B91-97835FDEA306_sam|text=|trigger=button}{sub-section}{sub-section:2CB97081-F3E9-4029-8B91-97835FDEA306_sam|class=sIndent|trigger=none}{code:language=javascript}
// (x+1) + 2*(x+1)*x + 3*(x+1)*x^2 + 4*(x+1)*x^3
var eq Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Returns the value of this polynomial in a certain point. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| // Model the quadratic equation -x^2 + 4x + 0.6 = 0
var eq = plugins.amortization.newPolynomial();
eq.addTerm(-1, 2);
eq.addTerm(4, 1);
eq.addTerm(0.6, 0);
// Find the roots of the equation.
r1 = eq.findRoot(100, 1E-5, 1000);
r2 = eq.findRoot(-100, 1E-5, 1000);
application.output("eq(" + r1 + ")=" + eq.getValue(r1));
application.output("eq(" + r2 + ")=" + eq.getValue(r2));
// Find the minimum/maximum point by zeroing the first derivative.
var deriv = eq.getDerivative();
rd = deriv.findRoot(0, 1E-5, 1000);
application.output("Min/max point: " + rd);
application.output("Min/max value: " + eq.getValue(rd));
if (deriv.getDerivativeValue(rd) < 0) application.output("Max point.");
else application.output("Min point."); |
|
|
|
|
Table Body (tbody) |
---|
id | multiplyByPolynomial-Polynomial |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
multiplyByPolynomial |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Multiplies this polynomial with another polynomial. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| // Model the quadratic equation (x+1)*(x+2) = 0
var eq = plugins.amortization.newPolynomial();
eq.addTerm(1, 1);
eq.addTerm(1, 0);
var eq2 = plugins.amortization.newPolynomial();
|
|
|
|
| for (var i = 0; i < 4; i++)
{
var base = plugins.amortization.newPolynomial();
base.addTerm(1, 1);
base.addTerm(1, 0);
base.multiplyByTerm(1, i);
base.multiplyByTerm(i + 1, 0);
eq.addPolynomial(base);
}
application.output(eq.getValue(2));
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=0BE3BFC4-A5BE-448C-A5E9-47EA2D84C045}{tr:id=name}{td}h6.setToZero{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}setToZero{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:0BE3BFC4-A5BE-448C-A5E9-47EA2D84C045_des|text=|trigger=button}{sub-section}{sub-section:0BE3BFC4-A5BE-448C-A5E9-47EA2D84C045_des|trigger=none|class=sIndent}Sets this polynomial to zero.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:0BE3BFC4-A5BE-448C-A5E9-47EA2D84C045_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:0BE3BFC4-A5BE-448C-A5E9-47EA2D84C045_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:0BE3BFC4-A5BE-448C-A5E9-47EA2D84C045_ret|text=|trigger=button}{sub-section}{sub-section:0BE3BFC4-A5BE-448C-A5E9-47EA2D84C045_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:0BE3BFC4-A5BE-448C-A5E9-47EA2D84C045_see|text=|trigger=button}{sub-section}{sub-section:0BE3BFC4-A5BE-448C-A5E9-47EA2D84C045_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:0BE3BFC4-A5BE-448C-A5E9-47EA2D84C045_see|text=|trigger=button}{sub-section}{sub-section:0BE3BFC4-A5BE-448C-A5E9-47EA2D84C045_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:0BE3BFC4-A5BE-448C-A5E9-47EA2D84C045_sam|text=|trigger=button}{sub-section}{sub-section:0BE3BFC4-A5BE-448C-A5E9-47EA2D84C045_sam|class=sIndent|trigger=none}{code:language=javascript}
eq2.addTerm(1, 1);
eq2.addTerm(2, 0);
eq.multiplyByPolynomial(eq2);
// Find the roots of the equation.
r1 = eq.findRoot(100, 1E-5, 1000);
r2 = eq.findRoot(-100, 1E-5, 1000);
application.output("eq(" + r1 + ")=" + eq.getValue(r1));
application.output("eq(" + r2 + ")=" + eq.getValue(r2)); |
|
|
|
|
Table Body (tbody) |
---|
id | multiplyByTerm-Number_Number |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
multiplyByTerm |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
(coefficient, exponent) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Multiples this polynomial with a term. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| // (x+1) + 2*(x+1)*x + 3*(x+1)*x^2 + 4*(x+1)*x^3
var eq = plugins.amortization.newPolynomial();
for (var i = 0; i < 4; i++)
{
var base = plugins.amortization.newPolynomial();
base.addTerm(1, 1);
base.addTerm(1, 0);
base.multiplyByTerm(1, i);
base.multiplyByTerm(i + 1, 0);
eq.addPolynomial(base);
}
application.output(eq.getValue(2)); |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Sets this polynomial to zero. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var eq = plugins.amortization.newPolynomial();
eq.addTerm(2, 3);
application.output(eq.getValue(1.1));
eq.setToZero();
application.output(eq.getValue(1.1)); |
|
|
|
|
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table} |