Difference between revisions of "ZCubes/How to Apply Evaluate Algebraic Functions"
(→Video) |
|||
(2 intermediate revisions by one other user not shown) | |||
Line 9: | Line 9: | ||
+ | ==EXAMPLES== | ||
+ | <br/> | ||
+ | Algebraic experssions such as (a+b)^2, (a+b)*(a-b), (a+b)^3 etc can be calculated using a pre-defined function 'ALGEBRA' in ZCubes. | ||
− | <<[[ | + | E.g 1] To calculate (a+b)^2 |
+ | |||
+ | |||
+ | '''ALGEBRA("(a+b)^2")''' | ||
+ | |||
+ | |||
+ | displays the result as <math>2*a*b+a^2+b^2</math> | ||
+ | |||
+ | |||
+ | E.g 2] To calculate (a+b)*(a-b) | ||
+ | |||
+ | |||
+ | '''ALGEBRA("(a+b)*(a-b)")''' | ||
+ | |||
+ | |||
+ | displays the result as <math>a^2-b^2</math> | ||
+ | |||
+ | |||
+ | E.g 3] To calculate the array of values such as 3^2, 3^3, 3^4 etc., the ZCubes function 'FUNCT' can be used as: | ||
+ | |||
+ | '''FunctionArray= FUNCT("[x^2,x^3,x^4]");''' | ||
+ | |||
+ | '''FunctionArray(3)''' | ||
+ | |||
+ | |||
+ | displays the result as ''9'' ''27'' ''81'' | ||
+ | |||
+ | |||
+ | E.g 4] The expansion of algebraic expressions such as (a+b),(a+b)^2,(a+b)^3 and so on till (a+b)^10 can be executed in ZCubes using EXPAND command as - | ||
+ | |||
+ | |||
+ | '''(1..10)@(x=>EXPAND("(a+b)^"+x))''' | ||
+ | |||
+ | |||
+ | displays the result as - | ||
+ | |||
+ | </br>1 a+b | ||
+ | </br>2 2*a*b+a^2+b^2 | ||
+ | </br>3 3*a*b^2+a^3+b^3+3*a^2*b | ||
+ | </br>4 4*a*b^3+a^4+b^4+6*a^2*b^2+4*a^3*b | ||
+ | </br>5 5*a*b^4+a^5+b^5+10*a^2*b^3+10*a^3*b^2+5*a^4*b | ||
+ | </br>6 6*a*b^5+a^6+b^6+15*a^2*b^4+20*a^3*b^3+15*a^4*b^2+6*a^5*b | ||
+ | </br>7 7*a*b^6+a^7+b^7+21*a^2*b^5+35*a^3*b^4+35*a^4*b^3+21*a^5*b^2+7*a^6*b | ||
+ | </br>8 8*a*b^7+a^8+b^8+28*a^2*b^6+56*a^3*b^5+70*a^4*b^4+56*a^5*b^3+28*a^6*b^2+8*a^7*b | ||
+ | </br>9 9*a*b^8+a^9+b^9+36*a^2*b^7+84*a^3*b^6+126*a^4*b^5+126*a^5*b^4+84*a^6*b^3+36*a^7*b^2+9*a^8*b | ||
+ | </br>10 10*a*b^9+a^10+b^10+45*a^2*b^8+120*a^3*b^7+210*a^4*b^6+252*a^5*b^5+210*a^6*b^4+120*a^7*b^3+45*a^8*b^2+10*a^9*b | ||
+ | |||
+ | |||
+ | |||
+ | <br/> | ||
+ | *[[Z3 | Z3 home]] | ||
+ | *[[Z^3 Language Documentation]] | ||
+ | *[[ZCubes_Videos | ZCubes Videos and Tutorials]] | ||
+ | *[[Main_Page | About ZCubes ]] | ||
+ | <br/> | ||
<br/> | <br/> | ||
© Copyright 1996-2020, ZCubes, Inc. | © Copyright 1996-2020, ZCubes, Inc. |
Latest revision as of 13:08, 14 September 2021
How to Evaluate Algebraic Functions
In ZCubes you can evaluate Algebraic expressions by calling the ALGEBRA function and passing the expression as a parameter. These can be then converted to functions and executed for set of parameter values.
Video
EXAMPLES
Algebraic experssions such as (a+b)^2, (a+b)*(a-b), (a+b)^3 etc can be calculated using a pre-defined function 'ALGEBRA' in ZCubes.
E.g 1] To calculate (a+b)^2
ALGEBRA("(a+b)^2")
displays the result as
E.g 2] To calculate (a+b)*(a-b)
ALGEBRA("(a+b)*(a-b)")
displays the result as
E.g 3] To calculate the array of values such as 3^2, 3^3, 3^4 etc., the ZCubes function 'FUNCT' can be used as:
FunctionArray= FUNCT("[x^2,x^3,x^4]");
FunctionArray(3)
displays the result as 9 27 81
E.g 4] The expansion of algebraic expressions such as (a+b),(a+b)^2,(a+b)^3 and so on till (a+b)^10 can be executed in ZCubes using EXPAND command as -
(1..10)@(x=>EXPAND("(a+b)^"+x))
displays the result as -
1 a+b
2 2*a*b+a^2+b^2
3 3*a*b^2+a^3+b^3+3*a^2*b
4 4*a*b^3+a^4+b^4+6*a^2*b^2+4*a^3*b
5 5*a*b^4+a^5+b^5+10*a^2*b^3+10*a^3*b^2+5*a^4*b
6 6*a*b^5+a^6+b^6+15*a^2*b^4+20*a^3*b^3+15*a^4*b^2+6*a^5*b
7 7*a*b^6+a^7+b^7+21*a^2*b^5+35*a^3*b^4+35*a^4*b^3+21*a^5*b^2+7*a^6*b
8 8*a*b^7+a^8+b^8+28*a^2*b^6+56*a^3*b^5+70*a^4*b^4+56*a^5*b^3+28*a^6*b^2+8*a^7*b
9 9*a*b^8+a^9+b^9+36*a^2*b^7+84*a^3*b^6+126*a^4*b^5+126*a^5*b^4+84*a^6*b^3+36*a^7*b^2+9*a^8*b
10 10*a*b^9+a^10+b^10+45*a^2*b^8+120*a^3*b^7+210*a^4*b^6+252*a^5*b^5+210*a^6*b^4+120*a^7*b^3+45*a^8*b^2+10*a^9*b
© Copyright 1996-2020, ZCubes, Inc.