HowTo: Sowiso Maths question in Cirrus
The SOWISO question type for the exact sciences is an open ended question type that allows the answers to be in the form of formulas. The answers can be scored and checked automatically and can be accompanied with targeted feedback. Moreover, questions can be created with random parameters, that make every question unique. Read more about 'What types of questions Sowiso items can be used for?"
This manual describes the different options for the Sowiso maths question in Cirrus:
 What types of questions can Sowiso items be used for?
 Enabling the Sowiso question for your environment
 Formative versus Summative mathematical questions and their delivery
 The 'QuestionTab' of your Maths Item
 Variables Tab
 Feedback Rules
 Evaluation types
 Sowiso question sets: using variables over multiple questions
 PHP functions  used in a Definition field of a variable
 SOWISO php functions
 Plot and draw examples
What types of questions can Sowiso items be used for?
English  Dutch 


Enabling Sowiso Maths Item
To start using the Sowiso Maths Item please reach out to your Cirrus contact for commercial details before we can fully enable this.
When using the SOWISO (Maths) Item in Cirrus please be aware that the decimal delimiter will be a point (.) no matter your environment's or user's Regional Settings.
SOWISO will train you and can help you develop questions. Alternatively you can import your SOWISO questions into Cirrus or buy large sets of predeveloped content, just sent us a mail.
Important differences between Sowiso questions in Cirrus and Sowiso standalone usage
The Sowiso 'maths' question is a unique collaboration with our partners at sowiso. Please be aware that the integration has some limitations because of usage and (technical) setup:
 Sowiso questions are not meant to be used for questions requiring the candidate to draw an answer.
 This question type in Cirrus is based on what Sowiso calls the exercise type 'open':
 If you are familiar with Sowiso please be aware of this and do not use other Sowiso excercise types to import in Cirrus.
 Also Sowiso has elaborate table layout opportunities. Be aware that this does not translate 1:1 to the table editor in Cirrus. When you want to import questions made in Sowiso keep it simple or have your question fully finished before importing them into Cirrus.
Formative versus Summative mathematical questions and their delivery
There is an important difference between sowiso questions that are set to formative instead of summative:
 A formative sowiso question like any formative question in Cirrus will only be available when creating an assessment of type 'formative' or 'mixed'.
 When taking their assessment candidates can (have to) press a 'Check' button. They are allowed to practice the singular (formative) question an unlimited amount of times  thought this will of course lead to less time for the other question in the assessment. Only the last given answer will be stored as the given answer in Cirrus.
Question Tab of your Sowiso Maths Item
The `Question` tab allows you to edit different placeholders in an exercise:
The following fields/options are available under ‘Question’:
 Question is the text the user gets to see during the assessment
 Settings  is where you set the maximum score for this question
 Solution (text) this solution text is shown to the candidate if setup by the author of an assessment to:
 Pre and post input are the texts before and after the answer field (for example for x= ... , or for a unit, like …. meters).
 Solutions  This is where you set the 'Evaluation Type, Definition of your solution et cetera.
Input of formulas in a Sowiso maths question
When you enter the formulas in a sowiso maths question, you need to use the appropriate LaTex and Tex or asciimathml delimiters:
LaTex and TeX delimiter:
 inline math opens and closes with #, or opens with \( and closes with \). Use the delimiters \[ \] or ## ## for display math with centered alignment on a separate line. If you want inline math to be centered, you can use the html *Align center* option () of the editor. If you want inline math to be printed as displaymath, you can use the \displaystyle command before the TeX
 e.g. for #\frac{1}{2}=0.5#, use #\frac{1}{2}=0.5#
asciimathml delimiter:

open and close with @. e.g. @1/2=0.5@
 For more information on asciimathml, please go to: http://www1.chapman.edu/~jipsen/asciimath.html
http://www1.chapman.edu/~jipsen/mathml/asciimathsyntax.html
The Solutions area is where you define what the correct answer is.
 Choose an ‘Evaluation type’ for the mathematical area from the dropdownlist. Evaluation types are used to interpret the answer and give appropriate feedback. See more information on evaluation types below, including a list of evalutation types.
 Evaluation type in combination with the Definition field is used to define the correct answer.
 You can add multiple solution rules via ‘Add solution’ to score multiple answers as correct.
Variables Tab
In the Variables tab you can define variables that can be use to randomise your question content.
To create a new variable go to the Variables tab and click the Add variable button. Variables are named alphabetically and a new variable will be created with the name next in line of the alphabet. i.e. when variables $a, and $b already exist variable $c will be created.
Variables have an id and four fields to maintain:
 id: is a letter from the alphabet. Whenever you want to reference this variable, use the id of the variable with a $ as a prefix: e.g. reference variable a as $a. After $v, the variable list continues with wa, wb, etc. The maximum number of variables per exercise is 126.
 definition:: here you define the value of the variable by using valid php syntax. You can use php (math) functions, as described here:
 e.g. to create a random variable between 1 and 10, use the function rand(1,10).
 Existing variables can be used in the definition. e.g. if variable
 $a = rand(1,10), then $b can be
 $b = rand($a,10).
 Extra functions created by SOWISO are available via the prefix sw_. A list of extra functions can be found at the end of this document.
 decimals: In case the result of the variable is a float, this field sets the number of decimals. Note that when a variable is used in another variable, the variable is not rounded. Only when the variable is used outside other variables (in texts and definition fields of rules) it will be rounded. e.g.
$a = 1/7 with 2 decimals, so 0.14
$b = 7*$a = 1.00 with 2 decimals  If you want an explicit rounding, use the php round($value, $precision, $roundmode) function.
 trailing zeros checkbox: when checked and the number of decimals is larger than 0, trailing zeros are removed from the end of any float value. e.g. 1.200 => 1.2
Feedback Rules Tabs
When answers are evaluated, the answers goes through the following flow:
 The user inserts a formula using the keyboard and optionally, also the virtual keyboard. When the answer contains a syntax error, this is immediately show on screen.
 a. based on the selected evaluation type, sometimes feedback can be given for an incorrect form. For example. for some evaluation types it is always necessary to get the answer in the form of an equation. If this is not the case, default feedback will be given.
b. the solution rules are checked for mathematical equivalence.  If a positive feedback rule is hit, the corresponding feedback is presented and the user is not ´finished´ with the exercise in a formative assessment, or in a summative assessment he will only get a partial score (or 0).
 If a negative feedback rule is hit, the corresponding feedback is presented and the user is not ´finished´ with the exercise, or in a summative assessment he will get a score of 0.
Finally, if the answer is correct according to the solution(s) and no positive feedback rules are hit, the answer is marked correct, the student is ´finished´ with the exercise and can progress, or receives the full score in a summative assessment.
Evaluation types
 Definition: this is an input field, where the required input depends on the chosen evaluation type. See the table below.
 Answer field: in case you have more than 1 answer field in the exercise, you can choose the field to apply the rule to here.
 Evaluation type: See the table below.
 Opposite evaluation: This negates the working of the rule. For instance, if you select evaluation type "is not a number", the rule is hot when the answer is not a number. However, when you select "Opposite evaluation", the rule is hit when the answer is a number.
 Test usage: Select this option to apply this rule in high stakes mode. When selected, you can choose a desired partial score when the answer hits this rule.
Evaluation types table
For mathematical answers the evaluation types are listed in the table underneath. In case of relations like equations or inequalities, you can specify a rule to only apply to a side of the relations using rhs:
for right hand side or lhs:
for left hand side, before the definition. e.g. contains_var with Definition rhs:x
checks for the variable x in only the right hand side.
For text based answer fields the evaluation types are listed in the table underneath
name  description 

contains_word  Checks whether the user input contains all the words from the Definition field (not in the same order). The words must be separated by semicolon ';'. Variations of the same word (e.g. contractions) can also be added by placing them between square brackets [ ] and separating them by comma ','. e.g. [is not,isn't];and;tree then the user input must include the words 'and', 'tree' and one of the words 'is not' or 'isn't' in order to be considered correct. 
contains_text  Checks whether the user input contains all the texts from the Definition field (not in the same order). The texts must be separated by semicolon ';'. Variations of the same text (e.g. contractions) can also be added by placing them between square brackets '[ ]' and separating them by comma ','. For example if Definition: [is not,isn't];and;tree; then the user input must include the texts 'and', 'tree' and one of the words 'is not' or 'isn't' in order to be considered correct. Caution! The texts 'band' and 'trees' will also be correct because both 'and' and 'tree' are included in the two texts respectively. 
text_case_insensitive  Checks whether the user input is equal to the text in the Definition field with a case insensitive check. 
text_case_sensitive  Checks whether the user input is equal to the text in the Definition field with a case sensitive check. 
text_combination  Checks whether the user input is unique across the answer fields out of the set supplied in the Definition field as a list with square brackets [ ] and separating them by comma , . e.g. apple[1,2] means 'apple' must be in either answer field 1 or 2, but cannot be in both. Caution! Currently only works in question type open free. 
Subscript notation
Subscript notation is possible in SOWISO.
Just make sure that in the Definition fields, you use the syntax as a_(b)
for abab, where a is the variable and b is the subscript.
name 
description 
contains_float 
Checks whether the user input contains floats. With no arguments at least one occurrence triggers the rule. With one argument, the argument defines the number of occurrences, optionally specified by one of le, lt, ge, gt, ne, eq, <=, >=, <>, ==, !=, <, >, = 
contains_integer 
Checks whether the user input contains integers. With no arguments at least one occurrence triggers the rule. With one argument, the argument defines the number of occurrences, optionally specified by one of le, lt, ge, gt, ne, eq, <=, >=, <>, ==, !=, <, >, = 
contains_number 
Checks whether the number in the Definition field is present in the user input. Without argument (Definition field is empty), at least one occurrence of a number in the answer triggers the rule. With two arguments (; separated) , the second argument defines the number of occurrences. e.g. 2;2 optionally specified by one of le, lt, ge, gt, ne, eq, <=, >=, <>, ==, !=, <, >, =. eg. 2; le 2 
contains_one_base_power 
Answer contains exactly one power at the base. 
contains_symbol 
Checks whether the user input contains the symbol from the Definition field. With one argument, at least one occurrence triggers the rule. e.g. minus With two arguments (; separated) , the second argument defines the number of occurrences. e.g. minus;2 , optionally specified by one of le, lt, ge, gt, ne, eq, <=, >=, <>, ==, !=, <, >, =. eg. minus; le 2. With a list in the Definition field like [arg1,arg2], each element will be treated as an argument like above, where the arguments will be treated as an OR. i.e. [cos;lt2,sin;lt2] is whether either sin or cos occur less than two times. Alternatively, the occurrence can be placed after the list, like so [arg1,arg2];lt2. I.e. [sin,cos];lt2 checks whether sin or cos together occur less than two times. Checks whether the user input contains the symbol from the Definition field, where symbol is one of operators: abs, divide, minus, plus, power, root, times, unary_minus, factorial relations: approx, eq, geq, gt, leq, lt, neq trigonometry: arccos, arcsec, arcsin, arctan, cos, cot, sec, sin, tan logarithms: ln, log numbers: e, i, infinity, pi linear algebra: matrix,vector logic: and, equivalent, false, implies, not, or, true, xor sets: N, Q, R, Z, cartesian_product, in, intersect, notin, notsubset, set, setdiff, size, subset, union, emptyset, suchthat With one argument, at least one occurrence triggers the rule. e.g. minus With two arguments (; separated) , the second argument defines the number of occurrences. e.g. minus;2 , optionally specified by one of le, lt, ge, gt, ne, eq, <=, >=, <>, ==, !=, <, >, =. eg. minus; le 2 
contains_symbol_other_than 
The user answer does not contain any other symbol than the one in the list in the Definition field, separated by ;, e.g. plus;minus means that only the symbols plus or minus may be present in the user`s answer. The symbol is one of operators: abs, divide, minus, plus, power, root, times, unary_minus, factorial relations: approx, eq, geq, gt, leq, lt, neq trigonometry: arccos, arcsec, arcsin, arctan, cos, cot, sec, sin, tan logarithms: ln, log numbers: e, i, infinity, pi linear algebra: matrix,vector logic: and, equivalent, false, implies, not, or, true, xor sets: N, Q, R, Z, cartesian_product, in, intersect, notin, notsubset, set, setdiff, size, subset, union, emptyset, suchthat<br 
contains_symbol_within 
Checks if the second operator in the definition field is present in the first operator of the answer. i.e. Definition: times,plus checks whether there is a multiplication that has a plus as a descendant. The second argument can be a list, where multiple symbols can be searched with an OR. The third argument optionally specifies the position of the child. i.e. Definition:times,[plus,minus] checks whether there is a multiplication that has a plus or a minus as a descendant. Definition divide,[plus,minus],2 checks whether the denominator of a fraction is a plus or minus or has one in it. 
contains_variable 
Checks whether the user input contains the variable from the Definition field. Without argument (Definition field is empty), at least one occurrence of a variable in the answer triggers the rule. With one argument, at least one occurrence triggers the rule. e.g. x With two arguments (; separated) , the second argument defines the number of occurrences. e.g. x;2, optionally specified by one of le, lt, ge, gt, ne, eq, <=, >=, <>, ==, !=, <, >, =. eg. x;gt 2 With a list in the Definition field like [arg1,arg2], each element will be treated as an argument like above, where the arguments will be treated as an OR. i.e. [x;lt2,y;lt2] is whether either x or y occur less than two times. Alternatively, the occurrence can be placed after the list, like so [arg1,arg2];lt2. I.e. [x,y];lt2 checks whether x or y together occur less than two times. 
contains_variable_other_than 
The user answer does not contain any other variable than the one in the list in the Definition field, separated by ;, e.g. x;y means that only the variables x or y may be present in the user answer. 
default_incorrect 
Always reacts on wrong answers. 
domain_dependence 
Use only with rule solve_inequality or solve_equality in the solution to give feedback on how the domain of the answer compares to the domain of the solution. In the Definition use one of the following.  0 or none: the answer domain is neither in nor around the solution domain  2 or inside: The answer is in the solution domain, but it does not contain it; it is too small.  3 or contains: The answer contains the solution domain, but is not contained in it; it is too big. 
eq_one_side 
One side of the equation must be equal to the variable in the Definition. 
eval_domain 
Checks whether the user input is equal to the domain in Definition field where both should be in the form of a simplified equation in the disjunctive normal form with only one variable,like x=3 or x=3. 
eval_eq_exact 
Exact mathematical check whether solutions indicated in the Definition field are solutions to the equation in the user input. Define a list of equations in the Definition field that should be substituted in the equation the user input. 
eval_eq_numeric 
Numerical check whether solutions indicated in the Definition field are solutions to the equation in the user input. The Precision field indicates the accepted margin of error. Define a list of variables in the Definition field that should be substituted in the equation the student answers. e.g. [x=3,y=4] when correct answer: x^2+y=13. 
eval_exact 
Exact mathematical comparison of expression in the Definition field with user input. 
eval_graphs 
Lines: Checks whether each pair of points from the user input is on a line defined in the Definition field and whether each line in the Definition fields has two points in the user input. e.g. x=y+1 Points: Checks whether each point from the user input is defined once in the Definition field. e.g. [2,1] Vector: Checks whether the start and end point of the vector from the user input is defined in the Definition field via a 2x2 matrix. Define the vector via a matrix e.g. matrix([0,0],[2,1]) 
eval_logic_equiv 
Comparison of logical form in the Definition field with normal form of user input.0 
eval_matrix_element 
Numerically compares the [row,column entry of the matrix from the user input [row,col]=...with the number represented by the expression in the Definition field. 
eval_normal 
Exact mathematical comparison of normal form of expression in the Definition field with normal form of user input. e.g. x^2. 
eval numeric 
Numeric comparison of expression in the Definition field with user input, e.g. 2*3. The Precision field defines the accepted absolute value of the margin of error for numerical answers, e.g. if the correct answer is 1, you can use 0.1 to accept all answers between 0.9 and 1.1. If any of the Range fields are used (not 0), the system checks whether the answer is within the range. A warning has been added when your Definition is not within Range. 
eval_param_rep 
Evaluate a parameter representation of the solution set of a list of linear equations. In the Definition field, use 2 arguments (separated with a ;), where the first is the list of linear equations [eq1,eq2,...] and the second is a list of the coordinates [x,y,...]. Optionally, you can add a third argument to prescribe the parameters that may be used, like [lambda,mu]. e.g. [zy+2*x1=0,3*z+11*y4*u+9=0];[x,y,z,u] or with a third argument [zy+2*x1=0,3*z+11*y4*u+9=0];[x,y,z,u];[lambda,mu] 
eval_statement 
Evaluate the statement in the Definition field, where the user input can be referenced using “answer". e.g. elementp(answer,{sin(1),sin(2),sin(3)}) 
eval_vector_rep 
Checks whether the vector representation of the user input corresponds to the line defined by the linear equation in x and y in the Definition field. e.g. y+3*x=1 
eval_vector_lin 
Checks whether the two dimensional vector of the user input and the two dimensional vector in the Definition field are linearly dependant. e.g. [2,1] 
eval_list 
Checks if the answer is a list and if each expression is equal to the expression at the same index in the list of the Definition field, using eval normal. The list in the Definition field should be ; separated. e.g. [2,3,1]. Note that this evaluation types automatically checks for the right input form (list or vector) and the length of the list and gives appropriate feedback accordingly. 
fraction_denominator 
Checks whether the user input contains a fraction with another denominator as defined in the Definition field. e.g. 4 
fraction_diff_denominators 
When the user input has more than one fraction, it checks whether all fractions have the same denominator. 
fraction_is_improper 
Checks whether the absolute value of all fractions in user input is bigger than or equal to one 
fraction_lcm_not_used 
Checks for each fraction in user input if the denominators are not equal to or bigger than the number in the Definition field. 
fraction_not_simplified 
Checks whether all fractions in the user input are simplified 
ideas_linear_equation 
Evaluate linear equation with ideas. 
is_decimal_length 
Checks whether the user input is a float with the same number of decimals as specified in the Definition field, optionally specified by one of le, lt, ge, gt, ne, eq, <=, >=, <>, ==, !=, <, >, =. eg. gt 2 
is_not_factorized 
Comparison of the factors in the Definition with the factors of the answer. 
is_not_fraction 
Check whether the user input is not a fraction. 
is_not_integer 
Checks whether the user input is not an integer. 
is_not_number 
Checks whether the user input is not an integer and not a float. 
is_not_polynomial 
Checks if the answer is a polynomial in the variables in the list from the Definition field. With two arguments, the second is a test for the grade. e.g. x;le6 checks if the answer is a polynomial in x of degree at most 6. 
is_not_rational 
Check whether the user input is either an integer or a fraction with the denominator unequal to zero. 
is_not_simplified_fraction 
Checks whether the user input is a simplified fraction. Also works for equations, where it checks whether at least one side is a simplified fraction. With Definition set to  1 the final form must be an improper fractions or integer like 112, 1 or 12 but not 32 or 42  2 allows for both proper and improper fractions and integers like 112 and 32 but not 42  3 same as 1, only also float values will be accepted  4 same as 2, only also float values will be accepted  otherwise it only allows for proper fractions and integers like 12 or 32 but not 112 
is_not_simplified_root 
Checks whether the answer (which is assumed to be an expression involving integers, multiplications, divisions, and higher roots) is in the normal form (a/b) * (cth root of d), where b,c,d are positive integers and a is an integer. 
is_not_simplified_complex 
Checks whether the answer is not in the form a+b*i, b*i, i or c where a,b and c are either simplified fractions, floats or integers and a and b are not 0 and, in the case ofa+b*i, there's no minus in b*i. Examples of allowed forms are 3+2i,3+i,−3−2i,0,2,12+12i,2i,2.2i,1.5+0.5i,0.5,34 Examples of disallowed forms are 0+i,1+0i,1+42i,22+2⋅i,1+1+i,1+i2,1+−2i,1−−2i,42 
is_not_top_symbol 
Checks whether the symbol with the highest precedence in the answer is not equal to one of the symbols in the Definition field. Define a list of one or more symbols in the Definition field. e.g. times;root means the highest symbol is either a times or a root symbol. 
same_form 
Checks the answer and the definition for having exactly the same form after maxima translation 
solve_equation 
Automatically solve and give feedback on 1st or 2nd degree equation. This type is limited to one variable equations. 
solve_inequality 
Evaluate the inequality in the Definition field and evaluate the student answer accordingly. This type is limited to one variable inequalities. 
Sowiso question sets: using variables over multiple questions
Please note: this feature will be released in Q1 of 2019
Upon opening a Sowiso question in Cirrus you can also find a tab 'Question set'. Using this tab unlocks the power of sowiso question sets:
 Using the question set tab you can:
 Add several questions to create a set of sowiso questions which use shared parameters.
 These will show as one set 1a, 1b etc. on one page in preview, Candidate Delivery and when Marking.
 You can click on the item on the Sowiso tab to directly edit it. You can move the order of the items in a set
 Properties like Taxonomy, Learning Objective, Purpose are applied to the set as a whole. If you edit these you will get a warning explaining this.
 The max score for a question set is determined by the points per question.
Tips when using sowiso question sets:
 On the Library overview page listing items in a collection you cannot see if the question is used as a part of a set. Tip: use labels if you want this marked as such.
 Only single Sowiso items can be used in Sections.
 If a Sowiso question uses a question set it cannot be used in Sections and also will not be available for Blueprint question selection.
 It is not possible to copy/import the set to another collection
 It is not possible to delete sowiso question from a set. Like for sections in Cirrus: you can only delete the set (section) as a whole.
PHP functions
The following functions can be used in a Definition field of a variable:
abs, acos, acosh, addcslashes,
SOWISO php functions
Extra functions created by SOWISO are available via the prefix sw_
function  returns 

[0,"a",2,3]  returns a random item from the list. The list can be a mixed list of strings and numbers. 
sw_answer(a)  gives access to the last given answers in text and in evaluation, where a is the reference to the number of the answer field. 
sw_alist([1,2,3],b)  returns an item from the array in the first argument at position bfrom the second argument. Note that the first position is at index 0. e.g. sw_alist(array(1,2,3),2) 3 
sw_comma(a)  returns the input string a with all comma's replace by \comma for TeX presentation, e.g. sw_comma("1,2") returns
1
. Useful when presenting decimals with the comma as decimal sign because 1,2 is displayed as 1,21,2, where 1\comma 2 is displayed as 1,21,2 
sw_concat(["a","b","c"])  returns the concatenation of the strings in the argument, e.g. sw_concat(["a","b","c"]) abc 
sw_descriptive(a, opt1, opt2)  loads the maxima package descriptive for making descriptive statistical computations ( http://maxima.sourceforge.net opt1: when 1 , the output is in tex, otherwise output is in maxima native syntaxopt2: when output is in tex, set the tex type as per sw_maxima()'s second argument 
sw_distrib(a, opt1, opt2)  loads the maxima package distrib for making probability computations ( http://maxima.sourceforge.net opt1: when 1 , the output is in tex, otherwise output is in maxima native syntaxopt2: when output is in tex, set the tex type as per sw_maxima()'s second argument 
sw_divisor(a, opt1, opt2)  gives a random divisor of number a opt1: when 1, also add self to random list opt2: when 1, also add 1 to random list 
sw_draw(a,opt2)  draw objects in a in dimension opt1 ( options are 2 (two dimensional, this is the default), 3 (three dimensional) or "df" for direction fields. 
sw_eq(a, b)  returns 1 if a is equal to b, otherwise it returns 0 
sw_eq_sign(a, b)  returns "=" if a is equal to b when both a and b are rounded to 10 decimals, otherwise it returns "\approx". a and b must both be numerical. Used for presenting decimal rounding as the solution after randomizing e.g. sw_eq_sign(1.2,12/10) ret sw_eq_sign(sqrt(2),1.4) 
sw_fact(a)  returns the factorial of a 
sw_finance(a, opt1, opt2)  loads the maxima package finance for making financial computations ( http://maxima.sourceforge.net opt1: when 1 , the output is in tex, otherwise output is in maxima native syntaxopt2: when output is in tex, set the tex type as per sw_maxima()'s second argument 
sw_fraction(a, b, opt1, opt2)  gives a presentation of the fraction a/b as a simplified mixed fraction for asciimathml use of with opt2 set to 1 in tex use. opt1: when 1, print as proper fraction, otherwise it's a mixed fraction (3232 in stead of 112112) opt2: when 1, use tex syntax instead of asciimathml. 
sw_gcd(a,b)  gcd of a and b (the return value is always a positive number.) acan also be an array (in that case, b is ignored). 
sw_ge(a, b)  returns 1 if a is greater than or equal to b, otherwise it returns 0 
sw_gt(a, b)  returns 1 if a is greater than b, otherwise it returns 0 
sw_iplot("a")  displays a plot of one or more expressions in implicit form 
sw_ilist(a, b)  searches for b in the array in the first argument and returns its index. Note that the first position is at index 0, e.g. sw_list_index([4,5,6,7], 6) returns 2 
sw_int(a)  returns the integer part of a, e.g. sw_int(10.9382) returns
1

sw_lang("a")  a way to make use preset text values to make text in a variable multilingual. As an index, you can choose from "all", "none", "yes, "no", "indeed", "not" . e.g. sw_lang("yes") 
sw_lang([a])  a way to make text in a variable multilingual. Use with a list of strings, where index 0 is Dutch, 1 is English, 2 is French and 3 is Spanish. e.g.
sw_lang(["twee","two","de

sw_lcm(a,b)  lcm of a and b. Optionally, a list of multiple integers can be supplied in the first argument like sw_lcm([2,4,8]) 
sw_le(a, b)  returns 1 if a is less than or equal to b, otherwise it returns 0 
sw_logic(a)  can be used to call maxima with logic package loaded. e.g. sw_logic(" pcnf(not(p and q) implies (p or q) )") returns p or q 
sw_lsu(a, b)  returns the unit in the bth significant place of a, e.g. sw_lsu(9.7472, 4) returns 0.001 
sw_lt(a, b)  returns 1 if a is less than b, otherwise it returns 0 
sw_mathml("a")  converts OpenMath object from string a to mathml 
sw_maxima("a",opt1)  where a has to be of type string, that means with double quotes. Returns maxima interpretation of input in tex notation. Use for simplifying in text field and presentation form of maxima (native) syntax opt1: can be used to adjust the behaviour of the tex, where traditional is the default,traditional_times is without a \cdot like ⋅⋅ for a multiplication orraw for the unchanged maxima tex function output.e.g. sw_maxima("2/6") returns

sw_maxima_native("a", opt1)  use native maxima to calculate a variable and maxima's grind()output. Use true for opt1 to get maxima's full answer.e.g.
sw_maxima_native("diff(3*
returns 15x^4 
sm_maxima_list(a,opt1,opt2)  converts a maxima list a into a string that can be interpreted by sw_tex_list . Set opt1 to true to get output in tex, otherwise it is in maxima native syntax. Set opt2 to true to get the output in unsimplified format, e.g. 2/2 remains 2/2 , otherwise it becomes 1 . 
sw_name  gets the current user's first name. 
sw_ne(a, b)  returns 1 if a is not equal b, otherwise it returns 0 
sw_normal(a)  normalizes a domain a, which is in the logic expression form 
sw_not(a)  returns 1 if a equals 0, otherwise it returns 0 
sw_number_of_divisors(a, opt1, opt2)  gives the number of divisors of number a opt1: when 1, also add self to the count opt2: when 1, also add 1 to the count 
sw_openmath("a")  evaluates a and converts maxima syntax to an OpenMathexpression 
sw_plot("a",b,"c")  plot functions in a in dimension b (2 or 3) with arguments c 
sw_rand_sign(a)  a with random sign 
sw_rand_sign(a,b)  random integer between a and b or a and b 
sw_rand_exclude(a,b,c)  random integer between a and b, but not c, where c can be an integer or a list of integers, e.g.
sw_rand_exclude(1,10,[3,7

sw_rand_steps(a, b, c)  random integer between a and b with steps of c 
sw_rand_divisors(a, b)  gives a random integer smaller or equal to a that has at least bdivisors 
sw_rand_float(a, b, opt1)  returns a random float between a and b. The optional argument opt1 indicates to which significant digit the float should be rounded. Note that the number of displayed decimals also needs to be adjusted in the variable editor. 
sw_rank(a, b)  returns the bth largest item of the array in the first argument, e.g. sw_rank([40,30,50,20], 2) returns 40 
sw_round_sig(a, b)  returns a as a float rounded to b significant digits, e.g. sw_round_sig(10.7673, 3) returns 10.8 
sw_root("a", opt1)  rewrites an expression with products, roots, sqrts, integers and divisions from maxima syntax to TeX in the form (a/b)sqrtc. When opt1 is set to fraction the output form will be (asqrtc)/b 
sw_sn(a,b,opt1,opt2)  scientific notation of number a with precision b and opt1 as an optional argument 'e' or 'E' (default 'e'). opt2 is an optional argument for the rounding mode, where 0 is the default and the scientific notation standard, meaning It rounds number in the proper scientific way. It rounds up if the next digit is greater than five. Rounds down if the next digit is less than five. If the next digit is five it rounds up half the time and down half the time based on whether the previous digit is even or odd. This ensures that cumulative rounding errors do not skew the data. 1 is ROUND_HALF_UP Round a up to b decimal places away from zero, when it is half way there. Making 1.5 into 2 and 1.5 into 2. 2 is ROUND_HALF_DOWN Round a down to b decimal places towards zero, when it is half way there. Making 1.5 into 1 and 1.5 into 1. 3 is ROUND_HALF_EVEN Round a to b decimal places towards the next even value. 4 is ROUND_HALF_ODD Round a to b decimal places towards the next odd value. 
sw_tex_list(a,b)  returns the bth element of a list a generated by sm_maxima_list , starting at index 1 (b > 0). 
Plot and Draw examples
Plot lines k and l
sw_plot(
"
[(2*x  3 )/6,(4*x  7 )/10] ,
[x,30,30] ,
[y,30,30]
"
,2,
"grid2d,
[style,[lines,3],[lines,4]],
[legend, \"k\", \"j\"],
[box, false],
[axes, solid]
")
Draw triangles
sw_draw(" fill_color =white, axis_right = false, axis_left = false, axis_top = false, axis_bottom = false, xtics = false, ytics = false, proportional_axes = xy, dimensions=[300, 300], color = yellow, fill_color = yellow, triangle([3,0],[3,1],[4,0]), triangle([2,1],[3,2],[3,1]), triangle([2,0],[2,1],[3,1]), triangle([2,1],[3,2],[2,2]), triangle([3,1],[4,2],[3,2]), color = blue, fill_color = blue, triangle([3,1],[4,2],[4,1]), triangle([4,0],[4,1],[3,1]), triangle([3,0],[3,1],[2,0]) ")
Draw a graph from connected points
sw_draw(" points_joined = true, fill_color =white, axis_right = false, axis_left = false, axis_top = false, axis_bottom = false, xtics = false, ytics = false, color = black, proportional_axes = xy, point_type = filled_circle, point_size = 1, dimensions=[600, 300], points([[0,15],[10,0],[30,30],[30,0],[10,30],[40,15]]), points_joined = false ")
Implicit plot
sw_iplot("x^2 = y^3  3*y + 1, [x, 4, 4], [y, 4, 4]")
Implicit plot with size setting and grid
sw_iplot("[y^2= (x^3  (1/2)* x + 1)/5,x=5],[x,5,10],[y,10,10]" ,"[legend, \"\", \"\"] , [gnuplot_term, \"pngcairo enhanced size 400,400\"] ,[gnuplot_preamble, \"set grid;\"]")
Comments 0