Showing posts with label mathematics. Show all posts
Showing posts with label mathematics. Show all posts

May 29, 2012

Newton's method as feedback system

This entry is inspired by the work by K. Kashima and Y. Yamamoto.


To obtain an approximated value of sqrt(a), one can use Newton's method:


with a given real x[0]. This can be easily implemented in computer programs such as MATLAB or SCILAB, but today I will represent this as a feedback system.

First, the iteration can be represented by


where σ denotes the shift operator


In control theory or signal processing, this operator is also denoted by z-1. Next, the iteration is divided into two parts, φ and σ, that is,


Finally, this can be represented by the following block diagram:


Based on this, you can run simulation with XCOS in SCLAB (xcos file is here).


This is a "feedback system" for sqrt(2). You can change the initial value x[0] by double-clicking "1/z" block.  Also, if you want another square root, double-click the "Expression" block and change "2" in the numerator to another positive number. But, if you feel like wilding out, use a negative number instead. In this case, the sequence will not converge, but show some chaotic behavior. The following is the result for "-2."

Related entries:


May 27, 2012

Play with scientific calculator

I posted an entry where I showed a very simple method to solve x = cos(x) by using a scientific calculator. Now, let's continue playing with a scientific calculator.
  1. Bring your scientific calculator (you can use your iphone or a web calculator).
  2. Change the mode to "rad" (radian).
  3. Push "1" (one) key.
  4. Push "sin" key.
  5. Push "1/x" key.
  6. Go back to step 4, unless you want out.
You will see two numbers:
  • 0.8975395... (after step 4.)
  • 1.1141571... (after step 5.)
The second number is a solution of the equation x = 1/sin(x)(this equation has infinite number of solutions), and the first number is its inverse.


Then, change "sin" to "cos" in step 4. Does it converge?

No.

I simulated the procedure by using SCILAB, and obtained a sequence shown below.


This looks like a chaotic sequence.

May 23, 2012

The simplest way to solve "x=cos(x)"


The following is the simplest way to solve the equation "x=cos(x)" by using a scientific calculator:
  1. Bring your scientific calculator (you can use your iphone or a web calculator).
  2. Change the mode to "rad" (radian).
  3. Push "1" (one) key.
  4. Continue to push "cos" key until you feel bored.
The result should be an approximated value of the solution, x=0.73908513...

Why?

The procedure is exactly the following iteration:
x[n+1] = cos(x[n]),  n=0,1,2,...,  x[0]=1.
By a fixed-point theorem, you can prove that the sequence {x[n]} converges to the solution.

I used this demo when I taucht iteration methods in a "numerical computation" class. This is a nice example for motivating students to learn more abstract theory.

May 17, 2012

Mathematical Notation in Email

I sometimes use email to communicate with researchers and engineers for mathematical discussion. Then, I always have a problem of writing mathematical notation.  How do you write, for example, the following equation in email?


A nice web page suggests to write

lim{x->0}sin(x)/x  =  1

This is an unambiguous expression. Alternatively, you can use "LaTeX" commands:

\lim_{x\rigtharrow 0}\sin(x)/x = 1

How about the following?


I suggest to use "matlab like" expression:

inv([a,b;c,d]) = 1/(ad-bc)[d,-b;-c,a]

This wil be unambiguous if the other person also knows matlab commands.

If you want to write so complicated mathematical expression as those in the cubic formula, I suggest to make a PDF file and just attach it!