Translate

이 블로그 검색

2012년 5월 16일 수요일

Tips for Matrix Calc

1. Roots of Higher-order Equations
ex) 3x^4 - 5x^3 + 11x^2 - 8 = 0
-Change Mode to Matrix
-Make a matrix of coefficients
 #x4=[3,-5,11,0,-8]
-Execute the function 'roots'
 roots(#x4)
-The result should be
 [ 0.945216
  -0.706456
   0.714+i1.866
   0.714-i1.866 ]

2. Solving System of Linear Equations
ex) 2x -y + z = -1
    3x +3y + 9z = 0
    3x + 3y + 5z = 4
-Change Mode to Matrix
-Make two matrices of coefficients
 #a=[2,-1,1;3,3,9;3,3,5]
 #b=[-1;0;4]
-Use the function '\'(backslash)
 #b\#a
 #a\#b
-The result should be
 [ 1.0
   2.0
  -1.0 ]

3. Calc Regression (Least Square Equation)
ex1) x = {2, 3, 6, 8, 12, 15}
     y = {10, 17, 24, 37, 49, 70}
     If you suppose that y = ax + b
     Then What would a and b be?
-Change Mode to Matrix
-Make two matrices of coefficients
 #x=[2,1;3,1;6,1;8,1;12,1;15,1]
 #y=[10;17;24;37;49;70]
-Use the function '\'(backslash)
 #y\#x
 #x\#y
-The result should be
 [ 4.345361
   1.185567 ]
 That is, a = 4.34536 and b = 1.185567

ex2) x = {2, 3, 6, 8, 12, 15}
     y = {55, 43, 32, 26, 44, 70}
     If you suppose that y = ax^2 + bx + c
     Then What would a, b and c be?
-Change Mode to Matrix
-Make two matrices of coefficients
 #x=[2^2,2,1;3^2,3,1;6^2,6,1;8^2,8,1;12^2,12,1;15^2,15,1]
 #y=[55,43,32,26,44,70]
 #y=[55;43;32;26;44;70]
-Use the function '\'(backslash)
 #y\#x
 #x\#y
-The result should be
 [ 0.796157
  -12.2257
   74.77246 ]
 That is, a = 0.796157, b = -12.2257 and c  = 74.77246

2012년 5월 11일 금요일

Usage of Variables

1. Assign a value to a variable
-Input a variable (ex. @a)
-Push '=' button
Then '@a = ?' is displayed.
-Input a value (ex. 7 or sin(45))

2. Use variables in expression
-Input an expression including variables (ex. @a^2-3*@a+sin(30))
-Push '=' button as usual

3. Use variables to assign another variable
-Input a new variable (ex. @b)
-Push '=' button
Then '@b = ?' is displayed.
-Push del button to erase the prompt line.
And
-Input an expression including other variables (ex. @a*2-1 or sin(@a)+@a^2)
-Push '=' button

* Causion : DO NOT assign recursively with unassigned variables, which will make the app frozen !

4. Re-assign some variables to re-calc a formula
-Push '4mul' button and select a formula among popped list
-Calc it, that means, push '=' buttons several times until finish calc
And if you want to calc again with other values for some variables,
just re-assign some variables to other valuses as above and then
-Push 'hist' button on the top-left corner (not the button below character-input box)
-Choose the formula
-Push '=' button once again
This way is better than using '4mul' button again if only a few variables should be re-assigned while the latter is easier if almost all variables should be.

NumberMania V2.0β5 Update

The usage of Constants and Variables has been improved so that they can be easily accessed and edited for Calc.

For Constants, they can be chosen after being filtered by group when touching character-input box.

Now Variables can be assigned (for example, after input @a,  push '=' button and input any value or expression then it will be assigned to the variable '@a'.) and values of which will be kept and used in subsequent calc until the app exits.

Here are some screenshots.