News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

The calculator

Started by RuiLoureiro, May 31, 2012, 10:59:09 PM

Previous topic - Next topic

RuiLoureiro

Gunther,
               yes, the calculator uses that method.

dedndave


Gunther

Rui,

Quote from: RuiLoureiro on November 10, 2013, 08:15:50 AM
yes, the calculator uses that method.

okay. Did you test some ill conditioned equation systems?

Gunther
You have to know the facts before you can distort them.

RuiLoureiro

Quote from: Gunther on November 10, 2013, 09:15:37 PM
Rui,

Quote from: RuiLoureiro on November 10, 2013, 08:15:50 AM
yes, the calculator uses that method.

okay. Did you test some ill conditioned equation systems?

Gunther
Hi Gunther,
                 use the calculator and see yourself the answers  :t

Gunther

Rui,

Quote from: RuiLoureiro on November 10, 2013, 11:01:57 PM
use the calculator and see yourself the answers  :t

okay, I'll give you a report.

Gunther
You have to know the facts before you can distort them.

RuiLoureiro

Quote from: Gunther on November 10, 2013, 11:06:33 PM
Rui,

Quote from: RuiLoureiro on November 10, 2013, 11:01:57 PM
use the calculator and see yourself the answers  :t

okay, I'll give you a report.

Gunther
Gunther,
                ok, thank you ! :t

RuiLoureiro

Quote from: dedndave on November 10, 2013, 11:45:47 AM
sorry Rui   :t
i like you give me answers,
               no problems with you, Dave  :t :t

RuiLoureiro

Hi all,

In Reply #39 on: November 10, 2013, 05:34:30 AM
i showed how to get the function arccos(z).
Now i show all other because i rarely use formulas
without knowing from where they come from.
The calculator uses them.
---------------------------------------------------------------------------------
about
      trigonometric sin(w)=z and the inverse function w=arcsin(z)
      trigonometric tan(w)=z and the inverse function w=arctan(z)

      hyperbolic sinh(w)=z and the inverse function w=arcsinh(z)
      hyperbolic cosh(w)=z and the inverse function w=arccosh(z)
      hyperbolic tanh(w)=z and the inverse function w=arctanh(z)
---------------------------------------------------------------------------------

                  -----------------------------
                  Trigonometric functions
                  -----------------------------
By definition
                sin(w)= (e^iw-e^-iw)/2i = z   => w=arcsin(z)

    From
                   e^iw-e^-iw
                 z=----------   doing t=e^iw
                       2i
    we get
                          1
                2iz= t - ---  <=> 2iz t = t^2 - 1  ( t<>0 )
                          t

                <=> t^2 -2iz t - 1 = 0

                <=>   t= iz + SQRT(1-z^2)        - positive solution I
                   or
                      t= iz - SQRT(1-z^2)        - negative solution I

    From
            SQRT(1-z^2)= SQRT[(-1).(z^2-1)]= i SQRT(z^2-1)

    we have
                      t= iz + i SQRT(z^2-1)      - positive solution II
                   or
                      t= iz - i SQRT(z^2-1)      - negative solution II

    From
            t=e^iw  we get w=-i ln(t)

    Solutions:
   
            w=arcsin(z)= -i ln(iz +  SQRT(1-z^2))       - positive solution I
            w=arcsin(z)= -i ln(iz -  SQRT(1-z^2))       - negative solution I
            w=arcsin(z)= -i ln(iz +i SQRT(z^2-1))       - positive solution II
            w=arcsin(z)= -i ln(iz -i SQRT(z^2-1))       - negative solution II

    note1:  sin(w)=z and sin(-w)=-z
    note2:  the calculator uses positive solution I
----------------------------------------------------------------------------------
By definition

                       sin(w)      e^iw - e^-iw       e^2iw - 1
                tan(w)=------- = --------------- = --------------= z
                       cos(w)    i(e^iw + e^-iw)    i(e^2iw + 1)

                w= arctan(z)
                                       
         Doing
                (1)     t=e^2iw    we have   

                        2iw= ln(t)  => w = -i/2 ln(t) = i/2 ln(t^-1)

                              t - 1
                (2)     iz = -------    <=>   iz (t+1) = t - 1    ( t<>-1 )
                              t + 1

                                               
                        izt + iz -t = -1  <=> (iz-1)t = - (iz + 1)

                        <=>  (1-iz) t = (1 + iz)
                                             
                             (1 + iz)   i (1 + iz)    i - z
                        t= -----------= -----------=---------
                             (1 - iz)   i (1 - iz)    i + z

                        t^-1 = (i+z)/ (i-z)


               =>       w = arctan(z) =  i/2 ln( (i+z)/(i-z) )     
------------------------------------------------------------------------
                    -------------------------
                    Hyperbolic functions
                    -------------------------
               
By definition
                sinh(w)= (e^w-e^-w)/2 = z   => w=arcsinh(z)

    From
                   e^w-e^-w
                 z=----------   doing t=e^w
                       2
    we get
                         1
                2z= t - ---  <=> 2z t = t^2 - 1  ( t<>0 )
                         t

                <=> t^2 -2z t - 1 = 0

                <=>   t= z + SQRT(z^2+1)        - positive solution I
                   or
                      t= z - SQRT(z^2+1)        - negative solution I

    From
            t=e^w  we get w=ln(t)

    Solutions:
       
            w=arcsinh(z)= ln(z +  SQRT(z^2+1))       - positive solution I
            w=arcsinh(z)= ln(z -  SQRT(z^2+1))       - negative solution I

    note1:  sinh(w)=z and sinh(-w)=-z
    note2:  the calculator uses positive solution I
-------------------------------------------------------------------------
By definition
                cosh(w)= (e^w+e^-w)/2 = z   => w=arccosh(z)

    From
                   e^w+e^-w
                 z=----------   doing t=e^w
                       2
    we get
                         1
                2z= t + ---  <=> 2z t = t^2 + 1  ( t<>0 )
                         t

                <=> t^2 -2z t + 1 = 0

                <=>   t= z + SQRT(z^2-1)        - positive solution I
                   or
                      t= z - SQRT(z^2-1)        - negative solution I

    From
            SQRT(z^2-1)= SQRT[(-1).(1-z^2)]= i SQRT(1-z^2)

    we have
                      t= z + i SQRT(1-z^2)      - positive solution II
                   or
                      t= z - i SQRT(1-z^2)      - negative solution II


    From
            t=e^w  we get w=ln(t)

    Solutions:
       
            w=arccosh(z)= ln(z +  SQRT(z^2-1))       - positive solution I
            w=arccosh(z)= ln(z -  SQRT(z^2-1))       - negative solution I
            w=arccosh(z)= ln(z +i SQRT(1-z^2))       - positive solution II
            w=arccosh(z)= ln(z -i SQRT(1-z^2))       - negative solution II

    note1:  Because cosh(w)=z and cosh(-w)=z

            arccosh(z)= w or -w
   
    note2:  The calculator uses positive solution I
-----------------------------------------------------------------------------
By definition

                        sinh(w)     e^w - e^-w       e^2w - 1
                tanh(w)=------- = --------------- = ---------- = z
                        cosh(w)    (e^w + e^-w)     (e^2w + 1)

                w= arctanh(z)
                                       
         Doing
                (1)     t=e^2w    we have   

                        2w= ln(t)  => w = 1/2 ln(t)

                              t - 1
                (2)      z = -------    <=>    z (t+1) = t - 1    ( t<>-1 )
                              t + 1

                                               
                         zt + z -t = -1  <=> (z-1)t = - (z + 1)

                        <=>  (1 - z) t = (1 + z)
                                             

                        t = (1+z)/ (1-z)


               =>       w = arctanh(z) =  1/2 ln( (1+z)/(1-z) )


RuiLoureiro

Quote from: Gunther on November 10, 2013, 11:06:33 PM
Rui,

Quote from: RuiLoureiro on November 10, 2013, 11:01:57 PM
use the calculator and see yourself the answers  :t

okay, I'll give you a report.

Gunther

Hi Gunther,

            I think you are talking about some cases like
           
                0x+0y+0z=1; x+y+z=2;x+y+z=3;
            or
                0x+0y+0z=0; x+y+z=2;x+y+z=3;
            or
                0x+0y+0z=0; x+y+z=3;x+y+z=3;
            or
                x+y+z=1; x+y+z=2;x+y+z=3;

            The calculator doesnt give a clear message because
            i didnt test that cases. I will do in the next version.

            Thanks  Gunther :t

RuiLoureiro

#54
Hi,
        In the NEXT version v3.10.2 (calcula60.exe)
        that i will post soon,

        When the calculator gives the message

        «The System of linear equations has no solution»
        it means that «there isn't any solution»

        When the calculator gives the message

        «The System of linear equations has no unique solution»
        it means that «there is infinite solutions»

        The problem is completely solved now.

Gunther,
              I don't know if you have any other question.
              If you have, please give me the report.
              Thanks  :t
              Rui
                       
Here are some results
----------------------------

x+y+z=1; x+y+z=2; x+y+z=3;
The System of linear equations has no solution
Determinant:  0

x+y+z=1; x+y+z=3; x+y+z=2;
The System of linear equations has no solution
Determinant:  0

x+y+z=3; x+y+z=2; x+y+z=1;
The System of linear equations has no solution
Determinant:  0

0x+0y+0z=1; x+y+z=2; x+y+z=3;
The System of linear equations has no solution
Determinant:  0

0x+0y+0z=0; x+y+z=2; x+y+z=3;
The System of linear equations has no solution
Determinant:  0

0x+0y+0z=0; x+y+z=3; x+y+z=3;
The System of linear equations has no unique solution
Determinant:  0

0x+0y+0z=0; 0x+0y+0z=0; x+y+z=3;
The System of linear equations has no unique solution
Determinant:  0

0x+0y+0z=0; 0x+0y+0z=0; 0x+0y+0z=3;
The System of linear equations has no solution
Determinant:  0

0x+0y+0z=0; 0x+0y+0z=0; 0x+0y+0z=0;
The System of linear equations has no unique solution
Determinant:  0

x+y=1; x+y+z=2; y+x=3;
The System of linear equations has no solution
Determinant:  0

x+y=1; x+y+z=2; y+x=1;
The System of linear equations has no unique solution
Determinant:  0
; ----------------------------------------------------
x+y+z+t=1; x+y+z+t=2; x+y+z+t=1; x+y+z+t=2;
The System of linear equations has no solution
Determinant:  0

x+y+z+t=1; x+y+z+t=2; x+y+z+t=3; x+y+z+t=4;
The System of linear equations has no solution
Determinant:  0

x+y+z+t=4; x+y+z+t=4; x+y+z+t=4; x+y+z+t=4;
The System of linear equations has no unique solution
Determinant:  0


Gunther

Rui,

sorry for the delay, but I'm sick and I'm confined to bed.

My question has that background:
Given is the following linear equation system A:

x - 2y = 1
x +  y = 4

The solution is: x = 3 and y = 1

If we change the coefficients a bit, we've the system A':

x - 2y    = 1
x +  1.2y = 4

The solution is now: x = 2.875 and y = 0.9375

But the relationship between the two solutions is still recognizable.

Lets have a look at the following system B:

x   +  2y  = 3
2x +  4.1y = 4

The solution is: x = 43 and y = -20

Again, we're changing only 1 coefficient by 0.2. That leads to system B':

x   +  2y  = 3
2x +  3.9y = 4

The solution is now: x =-37 and y = 20

There's no relationship between the two solutions; even the sign has been reversed. That's a simple example of an ill conditioned linear equation system.

Gunther
You have to know the facts before you can distort them.

RuiLoureiro

#56
Hi Gunther,
Quote
sorry for the delay, but I'm sick and I'm confined to bed.

        Oh, i hope you get better soon as possible  :t
       
Quote
Lets have a look at the following system B:
x   +  2y    = 3
2x +  4.1y = 4

        The solution is: x = 43 and y = -20

Again, we're changing only 1 coefficient by 0.2. That leads to system B':
x   +  2y  = 3
2x +  3.9y = 4

        The solution is now: x =-37 and y = 20

        (1) Ok, i think i understood the question
       
        (2) If we multiply both systems by 10 we have this

Quote
10 x + 20 y= 30
20 x + 41 y= 40     solution B  => vector (x,y)=(43,-20)

Quote
10 x + 20 y= 30
20 x + 39 y= 40     solution B' => vector (x,y)=(-37,20)

        It seems that there are something "wrong" when
        we change from 41 to 39
        But  from 41 to 39 we have "40"
       
Quote
this:
     10 x + 20 y= 30
     20 x + 40 y= 40

is equivalent to

    20 x + 40 y = 60
    20 x + 40 y = 40     solution C => has no solution

        It behaves like a function that passes through
        a discontinuity point: (its only an image)

Quote
10 x + 20 y= 30
20 x + 39 y= 40     solution B' => vector (x,y)=(-37,20)

10 x + 20 y= 30
20 x + 40 y= 40     solution C  => has no solution

10 x + 20 y= 30
20 x + 41 y= 40     solution B  => vector (x,y)=(43,-20)

        Many years ago, i wrote hundreds of sheets of
        exercises about this type of problems
as examples
        to my son when he was at the university studying
        mathematics.
        For instance: study the system
        x+y+z=3
        x-y+z=1
        2x-2y+az=2

        In this case, we have:

            1. If a =2  the system has no unique solution
            2. If a<>2  the system has a  unique solution 
       
        I took this example from a book that i have here
        about linear algebra and not from what i did because
        i have no room to all my library in my house.

        I think this is what you call
        an ill conditioned linear equation system:
        a linear equation system that depends on one or more
        parameters.

        I hope you recover soon as possible.
        By the way, i have had some headaches
        these days. Not too fine.

dedndave

hope you're feeling better, Gunther   :t

for those simple equations, i usually solve them by substitution   :P
but, i'm sure Gunther is just using it as an example of a possibly more complex system

RuiLoureiro

 :biggrin:
Quote
those simple equations, i usually solve them by substitution   :P
it is when we are on the first class, Dave :greensml:

RuiLoureiro

I am playing with you Dave  :t
playing ? kidding.