Showing posts with label system of equations. Show all posts
Showing posts with label system of equations. Show all posts

Saturday, February 22, 2025

Casio fx-991 CW: Solving Linear Systems of Complex Numbers

Casio fx-991 CW: Solving Linear Systems of Complex Numbers


Introduction


The fx-991 CW is a capable calculator. It even handles complex number calculations and linear systems up to four variables. So we should be able to handle problems such as:


(A + Bi) * (x + yi) + (C + Di) * (z + ti) = E + Fi

(G +Hi) * (x + yi) + (J + Ki) * (z + ti) = L + Mi


where i=√-1 and A, B, C, D, E, F, G, H, J, K, L, and M are real and imaginary parts of complex numbers.


Well, yes. But the Equation mode does not allow for complex numbers, and the complex mode handles arithmetic and rectangular/polar conversions. True. However, all is not lost.


If we multiply the left side of both equations, we get:


(A * x – B * y + C * z – D * t) + (B * x + A * y + D * z + C * t)i = E + Fi

(G * x – H * y + J * z – K * t) + (H * x + G * y + K * z + J * t)i = L + Mi


Equating the real and imaginary parts, we get four equations since the real and imaginary parts are separated by addition.


A * x – B * y + C * z – D * t = E (real part)

B * x + A * y + D * z + C * t = F (imaginary part)

G * x – H * y + J * z – K * t = L (real part)

H * x + G * y + K * z + J * t = M (imaginary part)


In this form, we can use the linear system solver of the fx-991CW (as well as many other calculators).


In matrix form:


[ [ A, -B, C, D ] [ [ x ]   [ [ E ]

[ B, A, D, C ]   * [ y ]  = [ F ]

[ G, -H, J, -K ]   [ z ]    [ L ]

[ H, G, K, J ] ]   [ t ] ]  [ M ] ]



Casio fx-991CW: Algorithm


Step 1. Press the [ HOME ] key and select Equation.


Step 2. Select Simul Equation.


Step 3. Select 4 Unknowns.


Step 4. Set up the equations as follows:

A * x – B * y + C * z – D * t = E

B * x + A * y + D * z + C * t = F

G * x – H * y + J * z – K * t = L

H * x + G * y + K * z + J * t = M


Step 5. Press [ EXE ], or [ SHIFT ] [ EXE ] (≈) for all approximate solutions. Scroll to see the results x, y, z, and t. In the default setting, every answer, except for x is expressed in standard form. I’m not sure why this is. This is your solution to x + yi and z + ti.


Step 6. To do a new calculation, press [ EXE ] again.


Examples


Example 1:


(6 + 4i) * (x + yi) + (2 + 5i) * (z + ti) = 11 + 63i

(8 + 14i) * (x + yi) + (16 + 7i) * (z + ti) = 213 + 105i


Set up the four equations as:


6x – 4y + 2z – 5t = 11

4x + 6y + 5z + 2t = 63

8x -14y + 16z – 7t = 213

14x + 8y + 7z + 16t = 105


Results:

x ≈ -1.682508574

y = -2109 / 2041 ≈ -1.033317001

z = 2239 / 157 ≈ 14.2611465

t = 363 / 157 ≈ 2.312101911


x + yi ≈ -1.682508574 – 1.033317001i

z + ti ≈ 14.2611465 + 2.312101911i


Example 2:


(3 + 3i) * (x + yi) + (-9 + 7i) * (z + ti) = -4 + 2i

(-5 + 3i) * (x + yi) +(2 + 8i) * (z + ti) = 11 + 0i


Set up the four equations as:


3x – 3y - 9z – 7t = -4

3x + 3y + 7z - 9t = 2

-5x - 3y + 2z – 8t = 11

3x - 5y + 8z + 2t = 0


Results:


x ≈ -1.252444271

y = -1245 / 5114 ≈ -0.2434493547

z = 2131 / 5114 ≈ 0.4166992569

t = -2029 / 5114 ≈ -0.3967540086


x + yi ≈ -1.252444271 – 0.2434493547i

z + ti ≈ 0.4166992569 – 0.3967540086i


Until next time, take care,


Eddie


All original content copyright, © 2011-2025. Edward Shore. Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited. This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.

Tuesday, March 19, 2019

Algebra: Solving Simple Non-Linear Systems

Algebra: Solving Simple Non-Linear Systems




System I:  

x + y = a
x^2 + y = b

Solving for y:
x + y = a
y = a - x

Subtracting the two equations from the system:
x + y = a
- [x^2 + y] = -[ b ]

x - x^2 = a - b
x^2 - x = b - a
x^2 - x - (b - a) = 0

Solving for x:
x = ( 1 ± √(1 - 4*(b - a) ) / 2

Summary for System I:
x = ( 1 ± √(1 - 4*(b - a) ) / 2
y = a - x

If a and b are real numbers, then 1 - 4*(b - a) ≥ 0, and
1 ≥ 4*(b - a)

System II:

x + y = a
x + y^2 = b

Solving for x:
x + y = a
x  = a - y

Subtracting the two equations from the system:
x + y = a
- [ x + y^2 ] = -[ b ]

y - y^2 = a - b
y^2 - y = b - a
y^2 - y - (b - a) = 0

Solving for y:
y = ( 1 ± √(1 - 4*(b - a) )/2

Summary for System II:
x  = a - y
y = ( 1 ± √(1 - 4*(b - a) )/2

System III:

x + y = a
x^2 + y^2 = b

Solving for y:
y = a - x

Solving for x:
x^2 + (a - x)^2 = b
x^2 + a^2 - 2*a*x + x^2 = b
2*x^2 - 2*a*x + (a^2 - b) = 0

x = ( 2*a ± √(4*a^2 - 4*2*(a^2 - b) ) / 4
x = ( 2*a ± √(4*a^2 - 8*(a^2 - b) ) / 4
x = ( 2*a ± √(4*a^2 - 8*a^2 + 8*b) ) / 4
x = ( 2*a ± √(8*b - 4*a^2) ) / 4
x = ( a ± √(2*b - a^2) ) / 2

Summary for System III:
x = ( a ± √(2*b - a^2) ) / 2
y = a - x

System IV:

x^2 + y^2 = a
x * y = b

Solving for y:
y = b / x 

I'm assuming that x ≠0 and y ≠0.

x^2 + y^2 = a
x^2 + (b / x)^2 = a
x^4 + b^2 = a * x^2
x^2 - a * x^2 + b^2 = 0

Let w = x^2, then w^2 = x^4

Then:
w^2 - a*w + b^2 = 0

Then:
w = (a ± √(a^2 - 4 * b^2) )/ 2

And:
x = ± √( (a ± √(a^2 - 4 * b^2) )/ 2 )

We have four answers to the system.

Summary for System IV:
x = ± √( (a ± √(a^2 - 4 * b^2) )/ 2 )
y = b / x 

A lot of fun,

Eddie

All original content copyright, © 2011-2019.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.

Monday, September 2, 2013

Differential Equations #9: Solving x'(t) = f(y(t)), y'(t) = g(x(t))

Solving
x'(t) = f(y(t))
y'(t) = g(x(t))


Sometimes using algebra can be more efficient than using Laplace transforms in solving systems of differential equations.

Procedure - two paths we can take:

1. Take the derivative of x', x" = f'(y)
2. Solve for y' and equate it to g(x).
3. Solve for x(t).
4. Solve for y(t).

OR

1. Take the derivative of y', y" = g'(x)
2. Solve for x' and equate it to f(y).
3. Solve for y(t).
4. Solve for x(t).

Let's take some examples and see how this works. In all examples presented, x and y are functions of t.

1.
x'= 2y
y'= -2x


x" = 2y'

Solving for y':
y' = x"/2

Equate to g(x):
x"/2 = -2x
0 = x"/2 - 2x
0 = x" - 4x

We have a homogenous second order differential equation.

Characteristic Equation: λ^2 + 4 = 0
Roots: λ = ± 2i

Hence
x = C1 cos(2t) + C2 sin(2t)

Note x' = 2y.
y = x'/2
y = [d/dt C1 cos(2t) + C2 sin(2t) ] /2
y = -C1 sin(2t) + C2 cos(2t)

Solution:
x = C1 cos(2t) + C2 sin(2t)
y = -C1 sin(2t) + C2 cos(2t)


The practical approach to this type of problem is to end up working with a homogenous second order differential equation, if possible.

2.
x' = y + 1
y' = 2x


Note
x" = y'

Then
y' = x" = 2x
0 = x" - 2x

We have a homogenous second order equation where the characteristic equation is
λ^2 - 2 = 0 and λ = ±√2 (-√2 and √2).

So
x = C1 e^(√2 * t) + C2 * e^(-√2 * t)

With
x' = √2 * C1 * e^(√2 * t) - √2 * C2 * e^(-√2 * t) = y + 1
y = √2 * C1 * e^(√2 * t) - √2 * C2 * e^(-√2 * t) - 1

Solution:
x = C1 e^(√2 * t) + C2 * e^(-√2 * t)
y = √2 * C1 * e^(√2 * t) - √2 * C2 * e^(-√2 * t) - 1


If we run into a non-homogenous second order differential equation, its not the end other world, refer to Part 8 ( http://edspi31415.blogspot.com/2013/09/differential-equations-8-second-order.html) on how to deal with such equations.

The next example I purposely set it up so we are going to use variation of parameters.
3.
x' = y + 3
y' = -3x


Observe that y" = -3x' and x' = -y"/3, and

y"/3 + y + 3 = 0
y" + 3y + 9 = 0
y" + 3y = -9
y = y_h + y_p

y_h:
λ^2 + 3 = 0, λ = ± i*√3
y_h =C1 cos(t * √3) + C2 sin (t * √3)

y_p:
y1 = cos(t * √3)
y2 = sin(t * √3)
f(t) = -9
W = sin(t * √3) * d/dt cos(t * √3) - cos(t * √3) * d/dt sin(t * √3) = -√3
∫ y2 * f(t)/W dt = ∫ sin(t*√3) * -9 / -√3 dt = -3 * cos(t * √3)
∫ y1 * f(t)/W dt = ∫ cos(t*√3)*-9/-√3 dt = 3 * sin(t * √3)
y_p = cos(t * √3) * -3 * cos(t * √3) - sin(t * √3) * 3 * sin(t * √3) = -3

y = C1 cos(t * √3) + C2 sin (t * √3) - 3

We only have to do the variation of parameters once.

y' = -C1 * √3 * sin(t * √3) + C2 * √3 * cos(t * √3) = -3x
x = √3/3 * C1 * sin(t * √3) - √3/3 * C2 * cos(t * √3)

Solution:
x = √3/3 * C1 * sin(t * √3) - √3/3 * C2 * cos(t * √3)
y = C1 cos(t * √3) + C2 sin (t * √3) - 3


That concludes Part 9 of our series. Until next time,

Eddie


This blog is property of Edward Shore. 2013

Python in Numworks: Duplicating and Grayscale

Python in Numworks: Duplicating and Grayscale All three scripts presented today use the math, random, and the Numworks specific ...