Before reading this article, please first read the basics on "How do I create a parameterised exercise?".
In this article 4 value types for the "formula" parameter are discussed:
Exact numbers
Rounded numbers
Symbolic functions
Matrices and Vectors (Linear Algebra)
Finally, also the possibility of making calculations (e.g. "parameter1 * parameter2"), adding conditions (e.g. "parameters can not be equal to 0") and operations (e.g. "take the integral of this parameter value w.r.t. x").
Parameter Values
Exact numbers
The standard method for parameters in Grasple is that they remain exact. You can type in the value using the math editor. For example: type "3/2 * \pi" and you will get an exact representation of that value. See an example of exact parameter values below:
β
Rounded numbers
When you want to round off the values, you can generate these values by creating a new parameter of the type 'Round' and adding the parameter you want to round in the parameter definition. There are multiple rounding methods available as well as the option to select the amount of decimals. Note that his option only works if the value of the parameter is a value, and not a symbolic function or matrix. See the additional rounded parameter and the generated values below:
Symbolic functions
A parameter can also hold a symbolic function. You can type a symbolic function with the math editor. In addition, you can also calculate with the symbolic functions. See the example below:
Matrices and Vectors (Linear Algebra)
Parameters can also hold Matrix and Vector values, which consequently can be used in Linear Algebra exercises (read more about creating Linear Algebra Exercises). Use the math editor to create a Matrix value for the parameter. See an example below:
Parameter Options & Operations
Calculating in a parameter value
You can make calculations in a parameter value. The resulting value will be the simplified version of the value (e.g. entering "2+2" will give the parameter the value "4"). You can combine parameters with other values, as long as they match in dimensions (e.g. adding a matrix and a number (scalar) will result in an error). See two examples below for calculating with algebra and matrices below:
β
βCalculating in a parameter - Algebra
Calculating in a parameter - Linear Algebra
Parameter conditions
You can apply conditions on a parameter. There are five conditions available: greater than or equal to, greater than, not equal to, less than and less than or equal to.
Apply the conditions by using the "+condition" on the right side of the specific parameter row.
Note: when your conditions contradict each other, the engine cannot compute your commands and will stop after 30 seconds to return an error.
If you want to apply a condition that two parameters are not equal to each other (e.g. if "parameter1 - parameter2" is the denominator in a fraction), you can achieve this by creating a new parameter which is equal to "parameter1 - parameter2" and applying the condition "not equal to zero". See an example below:
Be aware that expressions which do not have numeric values (e.g. a matrix, an equation, the Imaginary I) are not filtered by conditions in parameters.
Operations on parameters
You can apply operations on parameters by selecting the appropriate operator from the dropdown menu. Examples of operators are calculating the integral of function, derivative of a function and the inverse of a matrix.
Want to know which operators are available? See the list of operators.
We are actively expanding the set of operators and are keen to receive feature requests for new operators. Are you missing an operator? Let us know by providing
a (short) example exercise
description of the input and output of the operator
Operator name suggestion
We will quickly get back to you whether we can implement such an operator.
Do you have any questions about parameterising an exercise or any other options in Grasple? You can contact us via the the chat icon in the bottom right corner.