Creating a variable
to create a variable:
create new variable by typing it's identifier (name) and assigning a value:
initializing expression (on right side) can refer to variables (or other entities) created before:
You can refer non-existing entities as well and define them later. In other words, you can create not fully defined variables and functions. However, such entities cannot be calculated, until they are fully defined. Vectors and matrices should be fully defined at the moment of creation.
if we consider, that a and b are cathetus of a rectangular triangle, then it's hypotenuse can be obtained as:
when changing a value, variables b and c will also change, because they are depending on a.
To change the variable simply redefine it:
You can also add a dimension to the variable as a postscript expression. Use comment sign "//" to separate main expression from the postscript expression:
Note: there is no dimension support in Dysolve, postscript expression is treated as a comment only. However, it is parsed as a math expression and thus appears in formatted style.
Some variables are available by default (predefined variables). These are:
pi | 3.14159265359 |
e | 2.71828182846 |
g | 9.81 (acceleration of gravity) |
however, you can redefine or delete them.