Difference between revisions of "ZCubes/How to Apply Symbolic Math in ZCubes"
(→Video) |
|||
(One intermediate revision by one other user not shown) | |||
Line 9: | Line 9: | ||
+ | ==EXAMPLES== | ||
+ | <br/> | ||
+ | Expansion of algebraic experssions such as (a+b)^2, (a+b)^3 etc can be calculated using a pre-defined function 'EXPAND' in ZCubes. | ||
− | <<[[ | + | E.g 1] To calculate (a+b)^2 |
+ | |||
+ | |||
+ | '''EXPAND("(a+b)^2")''' | ||
+ | |||
+ | |||
+ | displays the result as 2*a*b+a^2+b^2 | ||
+ | |||
+ | |||
+ | E.g 2] To calculate (a+b)^4 | ||
+ | |||
+ | |||
+ | '''EXPAND("(a+b)^4")''' | ||
+ | |||
+ | |||
+ | displays the result as '''4∗a∗b^3+a^4+b^4+6*a^2*b^2+4*a^3*b''' | ||
+ | |||
+ | |||
+ | |||
+ | E.g 3] The expansion of algebraic expressions such as (a+b),(a+b)^2,(a+b)^3 and so on till (a+b)^24 can be executed in ZCubes using EXPAND command as - | ||
+ | |||
+ | |||
+ | '''(1..24)@(x=>EXPAND("(a+b)^"+x))''' | ||
+ | |||
+ | |||
+ | displays the result as - | ||
+ | |||
+ | </br>Symbol C | ||
+ | </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>11 11*a*b^10+a^11+b^11+55*a^2*b^9+165*a^3*b^8+330*a^4*b^7+462*a^5*b^6+462*a^6*b^5+330*a^7*b^4+165*a^8*b^3+55*a^9*b^2+11*a^10*b | ||
+ | </br>12 12*a*b^11+a^12+b^12+66*a^2*b^10+220*a^3*b^9+495*a^4*b^8+792*a^5*b^7+924*a^6*b^6+792*a^7*b^5+495*a^8*b^4+220*a^9*b^3+66*a^10*b^2+12*a^11*b | ||
+ | </br>13 13*a*b^12+a^13+b^13+78*a^2*b^11+286*a^3*b^10+715*a^4*b^9+1287*a^5*b^8+1716*a^6*b^7+1716*a^7*b^6+1287*a^8*b^5+715*a^9*b^4+286*a^10*b^3+78*a^11*b^2+13*a^12*b | ||
+ | </br>14 14*a*b^13+a^14+b^14+91*a^2*b^12+364*a^3*b^11+1001*a^4*b^10+2002*a^5*b^9+3003*a^6*b^8+3432*a^7*b^7+3003*a^8*b^6+2002*a^9*b^5+1001*a^10*b^4+364*a^11*b^3+91*a^12*b^2+14*a^13*b | ||
+ | </br>15 15*a*b^14+a^15+b^15+105*a^2*b^13+455*a^3*b^12+1365*a^4*b^11+3003*a^5*b^10+5005*a^6*b^9+6435*a^7*b^8+6435*a^8*b^7+5005*a^9*b^6+3003*a^10*b^5+1365*a^11*b^4+455*a^12*b^3+105*a^13*b^2+15*a^14*b | ||
+ | </br>16 16*a*b^15+a^16+b^16+120*a^2*b^14+560*a^3*b^13+1820*a^4*b^12+4368*a^5*b^11+8008*a^6*b^10+11440*a^7*b^9+12870*a^8*b^8+11440*a^9*b^7+8008*a^10*b^6+4368*a^11*b^5+1820*a^12*b^4+560*a^13*b^3+120*a^14*b^2+16*a^15*b | ||
+ | </br>17 17*a*b^16+a^17+b^17+136*a^2*b^15+680*a^3*b^14+2380*a^4*b^13+6188*a^5*b^12+12376*a^6*b^11+19448*a^7*b^10+24310*a^8*b^9+24310*a^9*b^8+19448*a^10*b^7+12376*a^11*b^6+6188*a^12*b^5+2380*a^13*b^4+680*a^14*b^3+136*a^15*b^2+17*a^16*b | ||
+ | </br>18 18*a*b^17+a^18+b^18+153*a^2*b^16+816*a^3*b^15+3060*a^4*b^14+8568*a^5*b^13+18564*a^6*b^12+31824*a^7*b^11+43758*a^8*b^10+48620*a^9*b^9+43758*a^10*b^8+31824*a^11*b^7+18564*a^12*b^6+8568*a^13*b^5+3060*a^14*b^4+816*a^15*b^3+153*a^16*b^2+18*a^17*b | ||
+ | </br>19 19*a*b^18+a^19+b^19+171*a^2*b^17+969*a^3*b^16+3876*a^4*b^15+11628*a^5*b^14+27132*a^6*b^13+50388*a^7*b^12+75582*a^8*b^11+92378*a^9*b^10+92378*a^10*b^9+75582*a^11*b^8+50388*a^12*b^7+27132*a^13*b^6+11628*a^14*b^5+3876*a^15*b^4+969*a^16*b^3+171*a^17*b^2+19*a^18*b | ||
+ | </br>20 20*a*b^19+a^20+b^20+190*a^2*b^18+1140*a^3*b^17+4845*a^4*b^16+15504*a^5*b^15+38760*a^6*b^14+77520*a^7*b^13+125970*a^8*b^12+167960*a^9*b^11+184756*a^10*b^10+167960*a^11*b^9+125970*a^12*b^8+77520*a^13*b^7+38760*a^14*b^6+15504*a^15*b^5+4845*a^16*b^4+1140*a^17*b^3+190*a^18*b^2+20*a^19*b | ||
+ | </br>21 21*a*b^20+a^21+b^21+210*a^2*b^19+1330*a^3*b^18+5985*a^4*b^17+20349*a^5*b^16+54264*a^6*b^15+116280*a^7*b^14+203490*a^8*b^13+293930*a^9*b^12+352716*a^10*b^11+352716*a^11*b^10+293930*a^12*b^9+203490*a^13*b^8+116280*a^14*b^7+54264*a^15*b^6+20349*a^16*b^5+5985*a^17*b^4+1330*a^18*b^3+210*a^19*b^2+21*a^20*b | ||
+ | </br>22 22*a*b^21+a^22+b^22+231*a^2*b^20+1540*a^3*b^19+7315*a^4*b^18+26334*a^5*b^17+74613*a^6*b^16+170544*a^7*b^15+319770*a^8*b^14+497420*a^9*b^13+646646*a^10*b^12+705432*a^11*b^11+646646*a^12*b^10+497420*a^13*b^9+319770*a^14*b^8+170544*a^15*b^7+74613*a^16*b^6+26334*a^17*b^5+7315*a^18*b^4+1540*a^19*b^3+231*a^20*b^2+22*a^21*b | ||
+ | </br>23 23*a*b^22+a^23+b^23+253*a^2*b^21+1771*a^3*b^20+8855*a^4*b^19+33649*a^5*b^18+100947*a^6*b^17+245157*a^7*b^16+490314*a^8*b^15+817190*a^9*b^14+1144066*a^10*b^13+1352078*a^11*b^12+1352078*a^12*b^11+1144066*a^13*b^10+817190*a^14*b^9+490314*a^15*b^8+245157*a^16*b^7+100947*a^17*b^6+33649*a^18*b^5+8855*a^19*b^4+1771*a^20*b^3+253*a^21*b^2+23*a^22*b | ||
+ | </br>24 24*a*b^23+a^24+b^24+276*a^2*b^22+2024*a^3*b^21+10626*a^4*b^20+42504*a^5*b^19+134596*a^6*b^18+346104*a^7*b^17+735471*a^8*b^16+1307504*a^9*b^15+1961256*a^10*b^14+2496144*a^11*b^13+2704156*a^12*b^12+2496144*a^13*b^11+1961256*a^14*b^10+1307504*a^15*b^9+735471*a^16*b^8+346104*a^17*b^7+134596*a^18*b^6+42504*a^19*b^5+10626*a^20*b^4+2024*a^21*b^3+276*a^22*b^2+24*a^23*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:10, 14 September 2021
How to Apply Symbolic Math in ZCubes
ZCubes solves symbolic expressions and equations in a simple and easy manner. The EXPAND function takes the algebraic expression as a parameter. You can use a single line command to convert it to a function and run it for a series of values.
Video
EXAMPLES
Expansion of algebraic experssions such as (a+b)^2, (a+b)^3 etc can be calculated using a pre-defined function 'EXPAND' in ZCubes.
E.g 1] To calculate (a+b)^2
EXPAND("(a+b)^2")
displays the result as 2*a*b+a^2+b^2
E.g 2] To calculate (a+b)^4
EXPAND("(a+b)^4")
displays the result as 4∗a∗b^3+a^4+b^4+6*a^2*b^2+4*a^3*b
E.g 3] The expansion of algebraic expressions such as (a+b),(a+b)^2,(a+b)^3 and so on till (a+b)^24 can be executed in ZCubes using EXPAND command as -
(1..24)@(x=>EXPAND("(a+b)^"+x))
displays the result as -
Symbol C
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
11 11*a*b^10+a^11+b^11+55*a^2*b^9+165*a^3*b^8+330*a^4*b^7+462*a^5*b^6+462*a^6*b^5+330*a^7*b^4+165*a^8*b^3+55*a^9*b^2+11*a^10*b
12 12*a*b^11+a^12+b^12+66*a^2*b^10+220*a^3*b^9+495*a^4*b^8+792*a^5*b^7+924*a^6*b^6+792*a^7*b^5+495*a^8*b^4+220*a^9*b^3+66*a^10*b^2+12*a^11*b
13 13*a*b^12+a^13+b^13+78*a^2*b^11+286*a^3*b^10+715*a^4*b^9+1287*a^5*b^8+1716*a^6*b^7+1716*a^7*b^6+1287*a^8*b^5+715*a^9*b^4+286*a^10*b^3+78*a^11*b^2+13*a^12*b
14 14*a*b^13+a^14+b^14+91*a^2*b^12+364*a^3*b^11+1001*a^4*b^10+2002*a^5*b^9+3003*a^6*b^8+3432*a^7*b^7+3003*a^8*b^6+2002*a^9*b^5+1001*a^10*b^4+364*a^11*b^3+91*a^12*b^2+14*a^13*b
15 15*a*b^14+a^15+b^15+105*a^2*b^13+455*a^3*b^12+1365*a^4*b^11+3003*a^5*b^10+5005*a^6*b^9+6435*a^7*b^8+6435*a^8*b^7+5005*a^9*b^6+3003*a^10*b^5+1365*a^11*b^4+455*a^12*b^3+105*a^13*b^2+15*a^14*b
16 16*a*b^15+a^16+b^16+120*a^2*b^14+560*a^3*b^13+1820*a^4*b^12+4368*a^5*b^11+8008*a^6*b^10+11440*a^7*b^9+12870*a^8*b^8+11440*a^9*b^7+8008*a^10*b^6+4368*a^11*b^5+1820*a^12*b^4+560*a^13*b^3+120*a^14*b^2+16*a^15*b
17 17*a*b^16+a^17+b^17+136*a^2*b^15+680*a^3*b^14+2380*a^4*b^13+6188*a^5*b^12+12376*a^6*b^11+19448*a^7*b^10+24310*a^8*b^9+24310*a^9*b^8+19448*a^10*b^7+12376*a^11*b^6+6188*a^12*b^5+2380*a^13*b^4+680*a^14*b^3+136*a^15*b^2+17*a^16*b
18 18*a*b^17+a^18+b^18+153*a^2*b^16+816*a^3*b^15+3060*a^4*b^14+8568*a^5*b^13+18564*a^6*b^12+31824*a^7*b^11+43758*a^8*b^10+48620*a^9*b^9+43758*a^10*b^8+31824*a^11*b^7+18564*a^12*b^6+8568*a^13*b^5+3060*a^14*b^4+816*a^15*b^3+153*a^16*b^2+18*a^17*b
19 19*a*b^18+a^19+b^19+171*a^2*b^17+969*a^3*b^16+3876*a^4*b^15+11628*a^5*b^14+27132*a^6*b^13+50388*a^7*b^12+75582*a^8*b^11+92378*a^9*b^10+92378*a^10*b^9+75582*a^11*b^8+50388*a^12*b^7+27132*a^13*b^6+11628*a^14*b^5+3876*a^15*b^4+969*a^16*b^3+171*a^17*b^2+19*a^18*b
20 20*a*b^19+a^20+b^20+190*a^2*b^18+1140*a^3*b^17+4845*a^4*b^16+15504*a^5*b^15+38760*a^6*b^14+77520*a^7*b^13+125970*a^8*b^12+167960*a^9*b^11+184756*a^10*b^10+167960*a^11*b^9+125970*a^12*b^8+77520*a^13*b^7+38760*a^14*b^6+15504*a^15*b^5+4845*a^16*b^4+1140*a^17*b^3+190*a^18*b^2+20*a^19*b
21 21*a*b^20+a^21+b^21+210*a^2*b^19+1330*a^3*b^18+5985*a^4*b^17+20349*a^5*b^16+54264*a^6*b^15+116280*a^7*b^14+203490*a^8*b^13+293930*a^9*b^12+352716*a^10*b^11+352716*a^11*b^10+293930*a^12*b^9+203490*a^13*b^8+116280*a^14*b^7+54264*a^15*b^6+20349*a^16*b^5+5985*a^17*b^4+1330*a^18*b^3+210*a^19*b^2+21*a^20*b
22 22*a*b^21+a^22+b^22+231*a^2*b^20+1540*a^3*b^19+7315*a^4*b^18+26334*a^5*b^17+74613*a^6*b^16+170544*a^7*b^15+319770*a^8*b^14+497420*a^9*b^13+646646*a^10*b^12+705432*a^11*b^11+646646*a^12*b^10+497420*a^13*b^9+319770*a^14*b^8+170544*a^15*b^7+74613*a^16*b^6+26334*a^17*b^5+7315*a^18*b^4+1540*a^19*b^3+231*a^20*b^2+22*a^21*b
23 23*a*b^22+a^23+b^23+253*a^2*b^21+1771*a^3*b^20+8855*a^4*b^19+33649*a^5*b^18+100947*a^6*b^17+245157*a^7*b^16+490314*a^8*b^15+817190*a^9*b^14+1144066*a^10*b^13+1352078*a^11*b^12+1352078*a^12*b^11+1144066*a^13*b^10+817190*a^14*b^9+490314*a^15*b^8+245157*a^16*b^7+100947*a^17*b^6+33649*a^18*b^5+8855*a^19*b^4+1771*a^20*b^3+253*a^21*b^2+23*a^22*b
24 24*a*b^23+a^24+b^24+276*a^2*b^22+2024*a^3*b^21+10626*a^4*b^20+42504*a^5*b^19+134596*a^6*b^18+346104*a^7*b^17+735471*a^8*b^16+1307504*a^9*b^15+1961256*a^10*b^14+2496144*a^11*b^13+2704156*a^12*b^12+2496144*a^13*b^11+1961256*a^14*b^10+1307504*a^15*b^9+735471*a^16*b^8+346104*a^17*b^7+134596*a^18*b^6+42504*a^19*b^5+10626*a^20*b^4+2024*a^21*b^3+276*a^22*b^2+24*a^23*b
© Copyright 1996-2020, ZCubes, Inc.