Difference between revisions of "ZCubes/How to Apply Z Programming and Combinatorial Arguments"

From ZCubes Wiki
Jump to navigation Jump to search
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==How to Apply Z Programming and Combinatorial Arguments==
+
==Z Programming and Combinatorial Arguments==
 
<br/>
 
<br/>
 
This video demonstrates how to enable functions to be able to process arrays of values, instead of single value arguments. Using the ‘arrayfy’ feature, the function that handles a set of parameters can handle a range of values for each parameter. This powerful feature of handling 'combinatorial arguments' opens up the possibility of evaluating functions for wide range of values without any changes to the function code.
 
This video demonstrates how to enable functions to be able to process arrays of values, instead of single value arguments. Using the ‘arrayfy’ feature, the function that handles a set of parameters can handle a range of values for each parameter. This powerful feature of handling 'combinatorial arguments' opens up the possibility of evaluating functions for wide range of values without any changes to the function code.
Line 14: Line 14:
 
1. To find the final velocity (V), use the ZCubes code as-
 
1. To find the final velocity (V), use the ZCubes code as-
 
<br/>
 
<br/>
V =: u+a*t;
+
<math>V := u+a*t;</math>
 
<br/>
 
<br/>
V(1,9.8,1)
+
<math>V(1,9.8,1)</math>
  
 
displays the result as ''10.8''.
 
displays the result as ''10.8''.
Line 23: Line 23:
 
2. To find the final velocity(V) for array of values of 't' from 1 to 30, use the following ZCubes code as-
 
2. To find the final velocity(V) for array of values of 't' from 1 to 30, use the following ZCubes code as-
 
<br/>
 
<br/>
V =: u+a*t;
+
<math>V := u+a*t;</math>
 
<br/>
 
<br/>
V arr;              //typing arr and pressing Shift+Space key gives an character '#'
+
<math>V arr;</math>               //typing arr and pressing Shift+Space key gives an character '#'
 
<br/>
 
<br/>
V(1,9.8,1..30)
+
<math>V(1,9.8,1..30)</math>
  
 
displays the final velocity values with varying inputs of time as:  
 
displays the final velocity values with varying inputs of time as:  
 
<br/>
 
<br/>
 
  u      t      V
 
  u      t      V
9.8  1 10.8
+
<br/>  9.8  1 10.8
 
<br/> 9.8 2 20.6
 
<br/> 9.8 2 20.6
 
<br/> 9.8 3 30.400000000000002
 
<br/> 9.8 3 30.400000000000002
Line 66: Line 66:
 
3. To find the final velocity(V) for array of values of 't' and 'u' from 1 to 30, use the following ZCubes code as-
 
3. To find the final velocity(V) for array of values of 't' and 'u' from 1 to 30, use the following ZCubes code as-
 
<br/>
 
<br/>
V =: u+a*t;
+
<math>V := u+a*t;</math>
 
<br/>
 
<br/>
V arr;              //typing arr and pressing Shift+Space key gives an character '#'
+
<math>V arr;</math>               //typing arr and pressing Shift+Space key gives an character '#'
 
<br/>
 
<br/>
V(1..30,9.8,1..30)
+
<math>V(1..30,9.8,1..30)</math>
  
  
  
  
<<[[Learn_ZCubes | Learn ZCubes ]]
+
<br/>
 +
*[[Z3 | Z3 home]]
 +
*[[Z^3 Language Documentation]]
 +
*[[ZCubes_Videos | ZCubes Videos and Tutorials]]
 +
*[[Main_Page | About ZCubes ]]
 +
<br/>
 
<br/>
 
<br/>
 
&copy; Copyright 1996-2020, ZCubes, Inc.
 
&copy; Copyright 1996-2020, ZCubes, Inc.

Latest revision as of 13:08, 14 September 2021

Z Programming and Combinatorial Arguments


This video demonstrates how to enable functions to be able to process arrays of values, instead of single value arguments. Using the ‘arrayfy’ feature, the function that handles a set of parameters can handle a range of values for each parameter. This powerful feature of handling 'combinatorial arguments' opens up the possibility of evaluating functions for wide range of values without any changes to the function code.

Video


Z Programming and Combinatorial Arguments















Examples

Finding velocity : Final velocity (v) of an object equals initial velocity (u) of that object plus acceleration (a) of the object times the elapsed time (t) from u to v. For standard gravity, a = 9.80665 m/s2.

1. To find the final velocity (V), use the ZCubes code as-

displays the result as 10.8.


2. To find the final velocity(V) for array of values of 't' from 1 to 30, use the following ZCubes code as-

//typing arr and pressing Shift+Space key gives an character '#'

displays the final velocity values with varying inputs of time as:

u      t       V


9.8 1 10.8
9.8 2 20.6
9.8 3 30.400000000000002
9.8 4 40.2
9.8 5 50
9.8 6 59.800000000000004
9.8 7 69.60000000000001
9.8 8 79.4
9.8 9 89.2
9.8 10 99
9.8 11 108.80000000000001
9.8 12 118.60000000000001
9.8 13 128.4
9.8 14 138.20000000000002
9.8 15 148
9.8 16 157.8
9.8 17 167.60000000000002
9.8 18 177.4
9.8 19 187.20000000000002
9.8 20 197
9.8 21 206.8
9.8 22 216.60000000000002
9.8 23 226.4
9.8 24 236.20000000000002
9.8 25 246.00000000000003
9.8 26 255.8
9.8 27 265.6
9.8 28 275.40000000000003
9.8 29 285.20000000000005
9.8 30 295


3. To find the final velocity(V) for array of values of 't' and 'u' from 1 to 30, use the following ZCubes code as-

//typing arr and pressing Shift+Space key gives an character '#'






© Copyright 1996-2020, ZCubes, Inc.