[go: up one dir, main page]

Showing posts with label hyperbolic cosine. Show all posts
Showing posts with label hyperbolic cosine. Show all posts

Sunday, August 11, 2024

Swiss Micros DM41X and fx-6500G: Complex Gudermannian Function and Its Inverse

Swiss Micros DM41X and fx-6500G: Complex Gudermannian Function and Its Inverse


Introduction


The Complex Gudermannian Function and the inverse are calculated as:


gd(x + yi) = u +vi where:

i = √-1

u = arctan( sinh x / cos y) = angle( cos y + i*sinh x )

v = arctanh( sin y / cosh x )


gd^-1(u + vi) = x + yi where:

i = √-1

x = arctanh( sin u / cosh v )

y = arctan( sinh v / cos u ) = angle(cos u + i*sinh v )


Notes:


* The calculator is set to radians mode during program execution.

* The arctangent function is handled using the rectangular to polar conversion (using the angle part). Doing so will increase the range between -π to π. The results are normalized.

* The results may not necessarily be the only answer but an attempt to get the principle branch.



Swiss Micros DM41X: Gudermannian and Inverse Gudermannian Functions


The DM41X is similar to the Hewlett Packard HP 41C series. Assuming we have no mathematical modules plugged in, the hyperbolic functions must be programmed as they were not included in the original function set.


Keeping with RPN notation, the imaginary part is placed on the Y stack and the real part is placed on the X stack. The memory registers used:


R01 = X

R02 = Y

R03 = U

R04 = V

gd(X + Yi) = U + Vi


The hyperbolic functions operate on real values only, and the in the Gudermannian and its inverse functions handle the real and imaginary parts separately.


DM41X: Hyperbolic Sine Routine: SINH


01 LBL^T SINH

02 ENTER↗

03 E↗X

04 X<>Y

05 CHS

06 E↗X

07 -

08 2

09 /

10 RTN

11 END


DM41X: Hyperbolic Cosine Routine: COSH


01 LBL^T COSH

02 ENTER↗

03 E↗X

04 X<>Y

05 CHS

06 E↗X

07 +

08 2

09 /

10 RTN

11 END


DM41X: Hyperbolic Arctangent Routine: ATANH


01 LBL^T ATANH

02 ENTER↗

03 ENTER↗

04 1

05 +

06 X<>Y

07 CHS

08 1

09 +

10 /

11 LN

12 2

13 /

14 RTN

15 END


Now to the main programs:


DM41X: Complex Gudermannian Function: CDG


01 LBL^T CGD

02 RAD

03 STO 01

04 X<>Y

05 STO 02

06 RCL 01

07 XEQ^T SINH

08 RCL 02

09 COS

10 R-P

11 X<>Y

12 STO 03

13 RCL 02

14 SIN

15 RCL 01

16 XEQ^T COSH

17 /

18 XEQ^T ATANH

19 STO 04

20 RCL 03

21 RTN

22 END


DM41X: Inverse Complex Gudermannian Function: CGDI


01 LBL^T CGDI

02 STO 03

03 X<>Y

04 STO 04

05 RAD

06 RCL 03

07 SIN

08 RCL 04

09 XEQ^T COSH

10 /

11 XEQ^T ATANH

12 STO 01

13 RCL 04

14 XEQ^T SINH

15 RCL 03

16 COS

17 R-P

18 X<>Y

19 STO 02

20 RCL 01

21 RTN

22 END


Casio fx-6500G: Gudermannian and Inverse Gudermannian Functions


The code can easily be adapted to other Casio calculators.


gd(X + Yi) = U + Vi


In these program listings, the real and imaginary parts are handled separately. For the fx-6500G (and same for the fx-7000G, 7500G, and 8000G), the Rectangular to Polar (Pol(x,y)) conversion stores the radius in the variable I and angle (θ) in the variable J. For the early Casio models, switch to Radians mode by pressing [ MODE ] [ 5 ].


gd(X + Yi) → U + Vi

Code:

Rad

“GD(X+YI)”

“X”:? → X

“Y”:? → Y

Pol(cos Y, sinh X)

J → U

tanh^-1 (sin Y ÷ cosh X) → V

“U + VI=”

U ⊿

V


gd^-1(U + Vi) → X + Yi


Code:

Rad

“GD^-1(U+YI)”

“U”:? → U

“V”:? → V

tanh^-1 (sin U ÷ cosh V) → X

Pol(cos U, sinh V)

J → Y

“X + YI=”

X ⊿

Y


Examples


Results are rounded to six decimal places. Be aware only one answer is given.


1. gd(3 + 4i) ≈ 1.635952 – 0.075314i

2. gd(-7 + 2i) ≈ -1.571555 + 0.001658i

3. gd(0 + 3i) ≈ 3.141593 + 0.142068i

4. gd(-3 + 0i) ≈ -1.471304 + 0i



Sources


“The Complex Gudermannian Function” analyticphysics.com. Uploaded June 16, 2021. Accessed June 23, 2024. https://analyticphysics.com/Complex%20Variables/The%20Complex%20Gudermannian%20Function.htm


“Gudermannian function” Wikipedia. Last Edited May 23, 2024. Accessed June 20, 2024.

https://en.wikipedia.org/wiki/Gudermannian_function#:~:text=The%20Gudermannian%20function%20relates%20the,sector%20is%20%CF%95%20%3D%20gd%20%CF%88.



Eddie


All original content copyright, © 2011-2024. 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.

Saturday, July 6, 2024

HP 12C: Hyperbolic Sine and Cosine, and their Inverses

HP 12C: Hyperbolic Sine and Cosine, and their Inverses


Introduction


The following program calculates four hyperbolic functions:


sinh x = (e^x – e^(-x)) / 2

cosh x = (e^x + e^(-x)) / 2

arcsinh x = ln(x + √(x^2 + 1))

arccosh x = ln(x + √(x^2 - 1)) (principal arccosh x)



HP 12C Program: sinh x, cosh x, arcsinh x, arccosh x



Step #: Step Code: [ keys ]


# sinh x: GTO 01, R/S

01: __, 43, 22: [ g ] e^x

02: __, 43, 36: [ g ] LST x

03: __, __, 16: [ CHS ]

04: __, 43, 22: [ g ] e^x

05: __, __, 30: [ - ]

06: __, __, _2: [ 2 ]

07: __, __, 10: [ ÷ ]

08: 43, 33, 00: [ g ] GTO 00


# cosh x: GTO 09, R/S

09: __, 43, 22: [ g ] e^x

10: __, 43, 36: [ g ] LST x

11: __, __, 16: [ CHS ]

12: __, 43, 22: [ g ] e^x

13: __, __, 40: [ + ]

14: __, __, _2: [ 2 ]

15: __, __, 10: [ ÷ ]

16: 43, 33, 00: [ g ] GTO 00


# arcsinh x: GTO 17, R/S

17: __, __, 36: [ ENTER ]

18: __, __, 36: [ ENTER ]

19: __, __, _2: [ 2 ]

20: __, __, 21: [ y^x ]

21: __, __, _1: [ 1 ]

22: __, __, 40: [ + ]

23: __, 43, 21: [ √ ]

24: __, __, 40: [ + ]

25: __, 43, 23: [ g ] LN

26: 43, 33, 00: [ g ] GTO 00


# arccosh x: GTO 27 R/S

27: __, __, 36: [ ENTER ]

28: __, __, 36: [ ENTER ]

29: __, __, _2: [ 2 ]

30: __, __, 21: [ y^x ]

31: __, __, _1: [ 1 ]

32: __, __, 30: [ - ]

33: __, 43, 21: [ √ ]

34: __, __, 40: [ + ]

35: __, 43, 23: [ g ] LN

36: 43, 33, 00: [ g ] GTO 00



Instructions


1. Enter x

2. To calculate, press [ g ] GTO ##, then press [ R/S ].

* GTO 01 R/S: sinh x

* GTO 09 R/S: cosh x

* GTO 17 R/S: arcsinh x

* GTO 27 R/S: arccosh x


Examples

(Fix 4)

x

sinh x

cosh x

-0.64

-0.6846

1.2119

0.59

0.6248

1.1792

1.23

1.5645

1.8568

3.74

21.0371

21.0609


Note: arccosh(1.2119) returns 0.64



Source


Selby, Samuel M. Ph. D. Sc. D. CRC Standard Mathematics Tables: Nineteenth Edition. The Chemical Rubber Co. Cleveland, OH. 1971. pp. 202, 211



Until next time,

Eddie


All original content copyright, © 2011-2024. 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.

Friday, November 29, 2019

Working with Hyperbolic Sine and Cosine

Working with Hyperbolic Sine and Cosine

Definition of sinh and cosh

Hyperbolic Sine

sinh x = (e^x - e^-x) / 2

Hyperbolic Cosine

cosh x = (e^x + e^-x) / 2

Properties

Adding sinh to cosh

cosh x + sinh x
= (e^x + e^-x) / 2 + (e^x - e^-x) / 2
= (2*e^x + e^-x - e^-x) / 2
= (2*e^x) / 2
= e^x

Subtracting sinh from cosh

cosh x - sinh x
= (e^x + e^-x) / 2 - (e^x - e^-x) / 2
= (e^x + e^-x - e^x + e^-x) / 2
= (2*e^-x) / 2
= e^-x

Multiplication of sinh and cosh

(I)
cosh x * cosh y
= (e^x + e^-x) / 2 * (e^y + e^-y) / 2
= (e^x * e^y + e^x * e^-y + e^-x * e^y + e^-x * e^-y) / 4

sinh x * sinh y
= (e^x - e^-x) / 2 * (e^y - e^-y) / 2
= (e^x * e^y - e^x * e^-y - e^-x * e^y + e^-x * e^-y) / 4

cosh x * cosh y + sinh x * sinh y
= (e^x * e^y + e^x * e^-y + e^-x * e^y + e^-x * e^-y) / 4
+ (e^x * e^y - e^x * e^-y - e^-x * e^y + e^-x * e^-y) / 4
= (2 * e^x * e^y + 2 * e^-x * e^-y) / 4
= (e^x * e^y + e^-x * e^-y) / 2
= (e^(x+y) + e^-(x+y)) / 2
= cosh(x + y)

(II)
sinh x * cosh y
= (e^x - e^-x) / 2 * (e^y + e^-y) / 2
= (e^x * e^y + e^x * e^-y - e^-x * e^y - e^-x * e^-y) / 4

sinh y * cosh x
= (e^y - e^-y) / 2 * (e^x + e^-x) / 2
= (e^x * e^y - e^x * e^-y - e^-x * e^-y + e^-x * e^y) / 4

sinh x * cosh y + sinh y * cosh x
= (e^x * e^y + e^x * e^-y - e^-x * e^y - e^-x * e^-y) / 4
+ (e^x * e^y - e^x * e^-y - e^-x * e^-y + e^-x * e^y) / 4
= (2 * e^x * e^y - 2 * e^-x * e^-y) / 4
= (e^(x+y) - e^-(x+y)) / 2
= sinh(x + y)

(III)
cosh^2 x
= ((e^x + e^-x) / 2)^2
= (e^(2*x) + 2 * e^x * e^-x + e^-(2*x)) / 4
= (e^(2*x) + 2 + e^-(2*x)) / 4

sinh^2 x
= ((e^x - e^-x) / 2)^2
= (e^(2*x) - 2 * e^x * e^-x + e^-(2*x)) / 4
= (e^(2*x) - 2 + e^-(2*x)) / 4

cosh^2 x + sinh^2 x
= (e^(2*x) + 2 + e^-(2*x)) / 4 + (e^(2*x) - 2 + e^-(2*x)) / 4
= (2*e^(2*x) + 2*e^-(2*x)) / 4
= (e^(2*x) + e^-(2*x)) / 2
= cosh(2*x)

Summary

cosh x + sinh x = e^x
cosh x - sinh x = e^-x
cosh x * cosh y + sinh x * sinh y = cosh(x + y)
sinh x * cosh y + sinh y * cosh x = sinh(x + y)
cosh^2 x + sinh^2 x = cosh(2*x)

Source:
Oldham, Keith, Myland, Jan, and Spainer, Jerome.  An Atlas of Functions  2nd Edition.  Springer:  New York.  ISBN 978-0-387-48806-6  2009

Stay safe and sane this Black Friday,

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.

Wednesday, November 27, 2019

HP Prime: Hyperoblic CAS Transformations

HP Prime:  Hyperbolic CAS Transformations

Introduction

These CAS transforms some expressions involving hyperbolic functions, mainly sinh (hyperbolic sine) and cosh (hyperbolic cosine). 

Let ϕ and Ω be any algebraic expression, real number, or complex number.  These commands are meant to work in CAS mode. 

Exponential Definitions

sinhexp

sinhexp(ϕ) = (e^(ϕ) - e^(-ϕ)) / 2 = ((e^ϕ)^2 - 1) / (2 * e^ϕ)

#cas
sinhexp(f):=
BEGIN
RETURN (e^(f)-e^(−f))/2
END;
#end

coshexp

coshexp(ϕ) =  (e^(ϕ) + e^(-ϕ)) / 2 = ((e^ϕ)^2 + 1) / (2 * e^ϕ)

#cas
coshexp(f):=
BEGIN
RETURN (e^(f)+e^(−f))/2
END;
#end

tanhexp

tanhexp(ϕ) = (e^(ϕ) - e^(-ϕ)) / (e^(ϕ) + e^(-ϕ))

#cas
tanhexp(f):=
BEGIN
RETURN (e^(f)-e^(−f))/
(e^(f)+e^(−f))
END;
#end

Adding Properties

addsinh

addsinh(ϕ + Ω) = sinh ϕ * cosh Ω + sinh Ω * cosh ϕ

#cas
addcosh(f,g):=
BEGIN
RETURN COSH(f)*COSH(g)+
SINH(f)*SINH(g);
END;
#end

addcosh

addcosh(ϕ + Ω) = csoh ϕ * cosh Ω + sinh Ω * sinh ϕ

#cas
addsinh(f,g):=
BEGIN
RETURN SINH(f)*COSH(g)+
COSH(f)*SINH(g);
END;
#end

addtanh

addtanh(ϕ + Ω) = (tanh ϕ + tanh Ω) / (1 + tanh ϕ * tanh Ω)

#cas
addtanh(f,g):=
BEGIN
RETURN (TANH(f)+TANH(g))/
(1+TANH(f)*TANH(g));
END;
#end

Squaring Properties

sqsinh

sqsinh(ϕ) = sinh^2 ϕ = 1/2 * cosh(2 * ϕ) - 1/2

#cas
sqsinh(f):=
BEGIN
RETURN COSH(2*f)/2-1/2;
END;
#end

sqcosh

sqcosh(ϕ) = cosh^2 ϕ = 1/2 * cosh(2 * ϕ) + 1/2

#cas
sqcosh(f):=
BEGIN
RETURN COSH(2*f)/2+1/2;
END;
#end

Product Properties

sinhsinh

sinhsinh(ϕ, Ω) = 1/2 * (cosh(ϕ + Ω) - cosh(ϕ - Ω))

#cas
sinhsinh(f,g):=
BEGIN
RETURN 1/2*(COSH(f+g)-
COSH(f-g));
END;
#end

coshcosh

coshcosh(ϕ, Ω) = 1/2 * (cosh(ϕ + Ω) + cosh(ϕ - Ω))

#cas
coshcosh(f,g):=
BEGIN
RETURN 1/2*(COSH(f+g)+
COSH(f-g));
END;
#end

sinhcosh

sinhcosh(ϕ, Ω) = 1/2 * (sinh(ϕ + Ω) + sinh(ϕ - Ω))

#cas
sinhcosh(f,g):=
BEGIN
RETURN 1/2*(SINH(f+g)+
SINH(f-g));
END;
#end

Source:

Spiegel, Murray R. and Seymour Lipschutz, John Liu.  Schuam's Outlines:  Mathematical Handbook of Formulas and Tables  5th Edition   McGraw Hill: New York  2018  ISBN 978-1-260-01053-4


A little early start to our Thanksgiving feast,

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.

Spotlight: Calculated Industries QR Calc

Spotlight: Calculated Industries QR Calc <Title> Quick Facts Model: 3375 Name: QR Calc Company: Calculated Industries ...