Backlinks

Python and Casio fx-4000P: Transmission and Deviation Angles - Prism

Python and Casio fx-4000P:   Transmission and Deviation Angles - Prism




Celebrating 12 Years in the Blogopshere!   Thank you to my readers, subscribers, and everyone who has stopped by during the years!  




Introduction


Today's program calculates the transmission and deviation angles passing through a prism.   The refractive index of the prism is determined by the material it is made of.   





Formulas Used for the transmission and deviation angles, respectively:


θt = arcsin( α * √(n^2 - sin^2 θi) - sin θi * cos α)


δ = θi + θt - α


The Python program calculates for prisms made of acrylic, glass, fluorite, and plastic.  



Python Script:  prism.py


Program Notes:


1.  The angle mode in Python is always radian angle mode. Conversions between degrees and radians are necessary on this code.


2.  This code was programmed with a Casio fx-9750GIII in the Python app.   I could have used the degrees and radians functions, however, they were not present in the calculator's catalog.  


3.  I used a While loop and initialized the choice variable k as -1 to prevent the user from choosing anything from picking outside the range 0-3.  This simulates the Menu command in Casio graphing calculator programming.


4. The refractive indices are average and approximate.  


5. To make everything fit on the screen, the new line escape character, \n, is used.  


Code:


from math import *

# radians mode

print("Enter in Degrees")

i=float(input("Incidence Angle? \n"))

a=float(input("Top Angle? \n"))


# convert to radians

ir=i*pi/180

ar=a*pi/180


# choice of material

# refractive index

ls=[1.4905,1.52,1.433,1.58]

k=-1

while k<0 or k>3:

  print("Select Material")

  print("0. Acrylic")

  print("1. Glass")

  print("2. Fluorite")

  print("3. Plastic")

  k=int(input())

n=ls[k]


# calculation

t=asin(sin(ar)*sqrt(n**2-sin(ir)**2)-sin(ir)*cos(ar))

d=ir+t-ar


# convert to degrees

td=t*180/pi

dd=d*180/pi


# results

print("Results are in Degrees")

print("Transmission Angle: \n"+str(td))

print("Deviation: \n"+str(dd))



Casio fx-4000P Program:  Prism


Notes:


1.  Variables used:

I = incidence angle

A = top angle of the prism

N = refractive index, must be entered manually


2.  Outputs:

Transmission Angle (T)

Deviation Angle (D)


Code:

(59 steps)


Deg :

"I": ?→ I:

"A": ?→A:

"N": ?→N:

sin⁻¹ ( sin A × √( N² - (sin I)²) - sin I × cos A) → T ◢

I + T - A → D



Examples


I = incidence angle

A = top angle of the prism

T = Transmission Angle

D = Deviation Angle



1.  I = 50°, A = 60°,  Glass (1.52)


T ≈  48.932708276°

D ≈ 38.932708276°


2.  I = 10°, A = 45°, Plastic (1.58)


T ≈ 80.99437617°

D ≈ 45.99437617°


3.  I = 33°, A = 25°,  Acrylic (1.4905)


T ≈ 5.32137979°

I ≈ 13.32137979°


4.  I = 17°, A = 40°, Fluorite (1.433)


T ≈ 42.66957975°

I ≈ 19.66957975°



Source


Woan, Graham.  The Cambridge Handbook of Physics Formulas  Cambridge University Press.  Cambridge, New York.  2003 edition



Here is to many more years, 


Eddie 


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


Urban Sketching Weekend ・津田沼でのスケッチイベントを終えて振り返る

Hong KongのスケッチャーRob SketchermanとBen Lukが、Urban Sketchers Japan とinternationalなイベントができないか、という話をUSk Japanの仲間でアクティブに活動してくれているMomokoさんに持ちかけたのがきっかけで、話が動き出したのが昨年の12月かそこら。Momokoさんが彼女の地元の習志野でなら、文化交流に前向きにイベントをする手伝いをしてくれる黒澤さんご夫妻(Nomdecocoa)の協力でやれると思うので、引き受けた、との寝耳に水発言。え、そうなんだ、と思ったものの、以前から海外組に日本でイベントをやってほしいとの声を聞かされていたもののグループ内では話がまとまらないままズルズルと鎖国していたのもあり、ここはやる気とスキルがある彼女が引っ張ってくれるなら、みんなで協力しながらやってみようと、手探りのイベント企画が始まったのでした。



場所は習志野。集まる会場探し、スケッチのワークショップやdemoの出来そうな場所の下見に加え、Benはフードスケッチのワークショップをしたいので、みんなで入り浸って料理を作るところも見られ、食事を囲んでスケッチできる日本の料理を出す店がないかというハードルの高いリクエストをしてきた。(そんなお店があるのかの交渉もなされた後に、結局のところMichiyaという風情ある場所をお借りして、そこにてリクエストされた料理を料理人の方に来ていただきケータリング、セッティングをしてもらうというなんとも贅沢で素敵な方法に行き着いたのもmomokoさんと習志野組の皆さんの熱意ある尽力の賜物で。)

2日間のイベントにするにはプログラムをどう組んで、値段はどのくらいがいいのか?どうやって代金を回収して、チェックインはどういった方法がいいのか。ボランティアが欲しいけれど、では誰に何が頼めるのか?3月中ごろあたりまでは中国からの飛行機の運行数が制限されていて、そもそも飛行機が飛べるのか?インストラクターが到着できなかったらどうなる?万一の時の代替案は?インストラクターが習志野で泊まるホテル探しと予約に、ついでに参加者で遠方から来る人の宿泊施設の案内はすべき?毎日がそういった個々の事柄についてのチャット(HK組との英語での会話あり、USk Japanのコアメンバー間でのすり合わせあり)の連続で、(実際に一つ一つをよく解決していけたものだと)実際に動いていたのはMomokoさんでしたが、その会話には加わっていた自分はこれはイベント終わる頃には腸内ポリープができちゃうかも、と胃の痛む日々を過ごしていました。自分は海外でのUSk Symposiumは度々参加していたものの、こちらでどこまでいわゆるnormに近づけられるのか、この場所でのオリジナルな企画だと参加費も海外値段には到底引き上げられないだろうという話しあいを(内輪で)散々した後で、とっつきやすい値段設定に最終的にきめ、支払いも事前にNet払いのPertixを使おうと決め、(この管理もMomokoさんにお任せ)ハンドアウトの翻訳のラフや、リーフレットに載せる地図の作画などのラフを作ったり、動けることはするものの、全てにおいて不慣れなことだらけ。しかも当初はRobのワークショップやdemoでは自分が通訳もするか、の流れだったのでしたがそこにきてWeb Designのできる瞳さん、Gloverさんや通訳をしてくれるあきほさんがいてくれたので、どんどん見栄えのいいサイトができ、スポンサーもつき商品のPaint ONの提供をいただき、印刷物に関してもNaokoさんの助けで綺麗な印刷がなされたり、自分は一つワークショップをするのと、スケッチウォークの説明、グッズの販売などという分担となりました。Casey Toriumiさんんもdemoを担当。グッズデザインは白川さんがやってくださいました。Atsukoさんもお土産セットのgoodie bagに直接直筆でイラストを描いたり名札制作もしてくれたり。Rafidaさんには突然カメラマンや通訳もしていただきとても助かりました。



不安は尽きず、地図を見てもよくわからないというアドバイスにはMomokoさんが行き方説明写真を掲載、イベント保険にも加入。桜が予定より早く開花し始まったので、散らないだろうか、散らないまでも雨になりそうじゃないかと気をもんだ前日までの日々。



蓋を開けたら花も咲いてる、天気も悪くない。来た人はちょっと時間に遅れたり迷ったりはあったものの、この風変わりな場所にちゃんと到着でき、何より楽しむぞの気合いが入っていて、その存在のおかげで拙い進行で始めたイベントを適度に脱力系の和やかな場に変えてくれていたのでした。

参加数も完売ではないものの、なかなかの出席があり、リラックスできる習志野の町にスケッチャーが溶け込んで過ごすことのできた2日間でした。こんな機会がなかったら、一生の中で津田沼に行くこともなかっただろうと思うのですが、(ぶっちゃけ自分の住んでいる場所も都会でも田舎でもない普通の変哲のない所ですが)その町で朝から晩まで2日間歩き回り、お店でお昼を食べ、夜は飲み会もやり、描き、を繰り返すごとに不思議な親しみを持つことができました。なんだか親戚の家を訪れたようなちょっとしたボンドが生まれた、というか。

とにかく全方面に感謝です、無事にイベントを終えることができました。

HK組のインストラクターたちはその後のオークランドのシンポジウムにてさらに同様のWSをするというので、今回のイベントはその合間のリハーサル(?)的なこぢんまりとした会でしたが、彼らはまた来たいと言っています。今後このような国際的なイベントを続けてやりながら、裏方が消耗するだけでない、ウィンウィンな関係を保って、持続できるようにやれるかは今後のグループでの仲間同士の関わり方、反省と修正、まだ学ぶところがいっぱいです。

やるよ、と言って有言実行したMomokoさんの人柄と人たらしぶり、パワーに拍手、脱帽でした。

以前、隅田のTshirt会社社長の久米さんからこんな言葉を聞いたことがありました。

何かを新しく始めるには「若者、よそ者、ばか者」がいると。あらま、今回文字通り3拍子揃ってましたね。

DM42, Free42, HP 42S: Birthday Probability Function

DM42, Free42, HP 42S:  Birthday Probability Function



The Age Old Birthday Question


You probably have read or heard about when there is 23 random people in a room, half of the time someone shares a birthday.   This is the classic birthday problem.   


Consider a room with 3 people and assume a 365 day year calendar.   What are are the odds that no one shares a birthday?


For the first person, they clearly have any day of the calendar.

For the second person, they only have 364 days out of the calendar.

For the third person, they only have 363 days available.


The probability that no one shares a birthday is:


P = 365/365 * 364/365 * 363/365

= (365 * 364 * 363) / (365^3)

≈ 0.99180


About 99.180% chance none of the three people share a birthday. 


Note that:

365/365 * 364/365 * 363/365

= (365/365) * (365 - 1)/365 * (365 - 2)/365

=  1 *  (365/365 - 1/365) * (365/365 - 2/365)

=  1 *  (1 - 1/365) * (1 - 2/365)


The derivation above leads to the formula stated by Persi Diaconis and Brain Skyrms (pg. 20 from Ten Great ideas About Chance): 


P = 1 * (N - 1)/C * (N - 2)/C * ...  =  Π( 1 - m/C, m = 1 to N-1)


C = number of categories (examples: days in a calendar year, minutes in an hour, number of places, etc...)

N = sample population

P = probability that sample population does not share a category (examples:  number of people that don't share the same birthday, number of people from a city that are not in the same location, etc...)

Π is the product function.


In our example above, C is the number of days in a 365 day calendar and N is the number of people.  The program BDAY makes the product calculation.



DM42/HP 42S/Free42/Plus42 Program:  BDAY


N and C are prompted.  


00 { 58-Byte Prgm }

01▸LBL "BDAY"

02 "CATEGORIES?"

03 PROMPT

04 STO 02

05 1

06 STO 01

07 "N?"

08 PROMPT

09 1

10 -

11 STO 03

12▸LBL 00

13 1

14 RCL 03

15 RCL÷ 02

16 -

17 STO× 01

18 DSE 03

19 GTO 00

20 "PROB= "

21 ARCL 01

22 AVIEW

23 RCL 01

24 .END.



A Quicker Calculation


Gratitude to Thomas Klemm, this next program is listed here by permission.


A shorter way to calculate this probability (only limited to how large a calculator can handle numbers) is:


P = PERM(C,N) / (C^N)  =  C! / ( (C - N)! * C^N )



DM42/HP 42S/Free42/Plus42 Program:  BDAYC  (compact)


Enter C on the Y stack and N on the X stack before running the program.


00 { 9-Byte Prgm }

01 RCL ST Y

02 X<>Y

03 PERM

04 X<>Y

05 LASTX

06 Y↑X

07 ÷

08 END



Examples


1.  Probability that 40 people do not share a birthday (assume a 365 day calendar):


C =  365, N =  40

Probability: 0.10877


Only about 10.877% chance no one in 40 people share a birthday.  



2.  Probability that 3 cards drawn do not share the same suit:


C = 4  (4 suits in a deck of cards), N =  3

Probability:  0.37500


About 37.5% chance no three cards share the same suit.



3.  A bowl has 50 numbered balls.   16 people draw a ball from the bowl and then places the ball back in the bowl.


C = 50, N = 16

Probability:  0.06751


Only about 6.751% of the time all 16 people draw different numbered balls.  



Sources


Diaconis, Persi and Brian Skyrms  Ten Great Ideas About Chance  Princeton University Press:  Princeton, New Jersey.  2018.  ISBN 978-0-691-19639-8


"(42S/DM42/Free42/Plus42) Birthday Probability Function"  The Museum of HP Calculators.   https://www.hpmuseum.org/forum/thread-19535.html.  Retrieved February 11, 2023.  


This blog turns 12 tomorrow, so excited!



Eddie 


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


Review: Casio fx-991CW (and the lack of multi-statements)

Review:  Casio fx-991CW (and the lack of multi-statements)







Quick Facts


Model:  fx-991CW

Company:  Casio

Years:  Internationally: 2022 - present, United States: April 2023 - present

Type:  Scientific

Power:  Solar with 1 LR44 backup battery

Display:  Multiline, 4-color gray display

Original Price:  $21.00 - $22.99 U.S. Dollars, varies on the specific version

Number of Variables:  9

Operating System: Algebraic



Update on the Classwiz


The fx-991CW is an update in Casio's Classwiz series, specifically on the 2015 fx-991EX Classwiz.  


Check out my review on the fx-991EX Classwiz from November 2015 here:

http://edspi31415.blogspot.com/2015/11/casio-fx-991ex-classwiz-review.html


The modes on the Classwiz are:


Calculate:  the main app for mathematical calculations


Statistics:  1 to 2 variable statistics.  Regressions include:

Linear:  y=a+bx

Quadratic: y=a+bx+cx^2

Logarithmic:  y=a+b*ln(x)

Exponential:  y=a*e^(bx)

Power I:  y=a*b^x

Power II: y=a*x^b

Inverse:  y=a+b/x


Distribution:  Calculations involving the binomial, normal, and Poisson.  The Inverse Normal deal with the lower tail (left) probability only.  


Spreadsheet:  Like the fx-991EX and Casio's current graphing calculators, the fx-991CW has a spreadsheet which has a 5 x 45 cell capacity.  The total memory is increased to 2,380 bytes (from 1,700 bytes on the fx-991EX).  Basic spreadsheet features included are:  labeling cells, sum, mean, minimum, maximum, absolute cell references ($), copy, cut, and paste.  


Table:   Generate a table of one function or two functions.   The functions are defined as f(x) and g(x).  With a QR code, you can generate a graph of these functions.


Equation:   Solve linear systems, up to 4 x 4 equations.  Solve polynomials, up to 4th order.  Real coefficients only but complex roots are calculated.   The general equation solver is moved to this mode.   


Inequality:  Solve inequalities up for polynomials of orders 2, 3, and 4.


Complex Number:  Complex number arithmetic with polar/rectangular conversion, integer powers, real/imaginary parts, conjugate


Base N:  Integer arithmetic with Boolean logic.  Instead of keys, the [FORMAT] key cycles through the four modes: Decimal, Hexadecimal, Binary, Octal.   Binary integers are up to 31 bytes with 1 sign bit.  We can not store or recall varaible values in this mode.


Matrix:  Works with four matrices up to 4 rows and 4 columns.  Functions include transpose, inverse, and determinant.


Vector:  Works with 4 vectors with either 2 or 3 elements.  Functions include dot product, norm, and cross product.


Ratio:  Solves common ratio problems.


Math Box:  This is the a new feature to the Classwiz.   For the United States, the Math Box has two simulations:  Dice Rolls and Coin Toss.   Depending on the country, the CW may include additional features.  



Emulator and Classpad.net


Purchasing a fx-991CW came with a emulator license with ClassPad.net.   The license number can be obtained using the Get Started option from the Settings menu.   Use the QR code.  For my calculator, the license for using ClassPad.net is seven years at no cost.  However, using an emulator without first purchasing an eligible calculator will require an additional cost.  


You can find details about Classpad.net here:  https://classpad.net/intl/features/



Keyboard, What is Added, and What is Subtracted





The keyboard of the fx-991CW is quite different from the previous Casio calculators.   The keys are now round with a lot less labels.   Most of functions are now stored in the catalog and tools.  Let's go over some of these keys:


[ house icon ]: [HOME].   This is where we switch the modes of the fx-991CW.   There are no numerical shortcuts, so we have to arrow and scroll to select the mode we want.  


[ three lines ]: [SETTINGS].  The settings key replaces the SETUP key sequence.   

Also note that the sub menus are selected by either pressing [ → ] or [ EXE ].  If there are radio buttons, select the option desired.  


[ curved arrow ]: [EXIT/EDIT].  This key, on the 2nd row, 2nd key from the left, will be used to exit menus and re-edit expressions.   


[ double up arrow ]/[ double down arrow ]:  This key, top right of the calculator, is used to quickly scroll through menus or lists.  Think of this key as the Page Up/Page Down key.


[ < >x] ]/[VARIABLE]:  This is the variable key.



Here is where we will store and edit values that are stored in each of the nine variables.   This key replaces the STORE key.     If we are operate in a mode that does not allow for editing or store values, there will be a lock icon with the selected variable.  


To store a result:

1.  Execute operation or recalling a calculated stat variable.

2.  Press [VARIABLE].

3.  Select variable, press [ OK ].

4.  Select Store, press [ OK ].


To edit a variable's value:

1.  Press [VARIABLE].

2.  Select variable, press [ OK ].

3.  Select Edit, press [ OK ].

4.  Enter the new value, press [ OK ].


To recall a variable in a calculation:

1.  Press [ SHIFT ].

2.  Press any of the following keys to get the variable:

[ 4 ]:  A

[ 5 ]:  B

[ 6 ]:  C

[ 1 ]:  D

[ 2 ]:  E

[ 3 ]:  F

[ 0 ]:  x

[ . ]:  y

[ x10^ ]:  z


There is no ALPHA key as it was in past Casio calculators.  


[ f(x) ]/[FUNCTION]:  



Here is where we can store and use up to two functions: f(x) and g(x).  The great news is that f(x) and g(x) are no longer limited to the Table, they can be used in other modes such as Calculate.   The equations f(x) and g(x) are retained while switching modes but not retained when the calculator either is turned off or the Input/Output setting is changed.  A missed opportunity for the latter.


A plus is that either f(x) or g(x) can be a composite function.  That is f(x) can contain g(x) or g(x) can contain f(x).  


There are two ways to access the x variable:  its own key [ x ] or the key sequence [ SHIFT ] [ 0 ].  


[book]/[CATALOG]:  This is where all the functions and commands can be accessed.  The menu order of the catalog changes depending on the mode used.  Some submenus include:


Function Analysis:  The calculus functions, that used to be on the keyboard, are now stored in the Function Analysis menu:  derivative, integral, summation, logarithm*, log*, ln* (* also on the keyboard)


Probability:   % (divides the number by 100), factorial, permutation, combination, random number, random integer


Numeric:  Absolute Value, Round Off (round the number to the Fix settings internally)


Angle/Coord/Sexa...:  angle units (degrees, radians, grads, degrees minutes seconds*), polar/rectangular conversions (* also on the keyboard)


Sci Constants:  47 scientific Constants


Unit Conversions


[ three circles ]/[ TOOLS ]:  The TOOLS menu changes dynamically based on the mode.   For example, the Calculate mode will have an Undo function.


[ FORMAT ]:  Instead of the [S<=>D] key, we have the [FORMAT] key, which asks how to change the value:  Standard, Decimal, Improper Fraction, Mixed Fraction,  ENG (Engineering) Notation, Sexagesimal (degrees-minutes-seconds).


In Base mode, the [ FORMAT ] key toggles between the four bases (decimal, hexadecimal, binary, octal).


I did three comparison speed tests between the fx-991CW and fx-991EX  here:  https://www.youtube.com/watch?v=cj0Odnv0Mwk


As I understand, the fx-991CW has a faster processor than the previous fx-991EX.



Now let's talk about what is subtracted in this update.  You read this correctly, several features did not make it from the fx-991EX to the fx-991CW:


The  CALC feature where we could type in a formula, press [ CALC ] and have formula evaluation.  I was not able to find the CALC feature on the fx-991CW.


There is no longer the independent memory M, nor the storage arithmetic functions M+ and M-.  I miss this feature the most.  I really wish scientific and graphing calculators in general embrace store arithmetic like Hewlett Packard and Swiss Micros.


There is no longer the ability to use multi-statement expressions, with each expression separated with a colon.  Even when it was available, (1) storing results immediately terminated the expression (forcing the use of Ans and when available, PreAns to make using results in the next part possible), and (2) when replayed, the statement was broken up into separate parts.  


Addendum 


Note (4/12/2023):  I am wrong when I said that storing results in multi-statements on the fx-991EX (not the fx-991CW) is impossible.  We use the equals key ([ALPHA] ( = )), as in this example:


A = 9 : B = 8 * A


Csaba Tizedes uses the multi-statement and CALC feature on the fx-991EX to create an IF-THEN-ELSE structure.  In this video Tizedes uses this structure to solve equations using the Bisection method.  The IF-THEN-ELSE structure tests whether a number is positive or negative.  Please take a look his video:


https://www.youtube.com/watch?v=umxScZL1V6A


Gratitude to Csaba Tizedes, this video is shared with his permission.  



Final Thoughts


Overall, the fx-991CW is pretty solid calculator with a readable screen and a lot of features.  My favorite part of the updated is the ability to use the functions f(x) and g(x) outside of the table function.  I also like the catalog key and the page up/page down key.


I get that Casio is going for a simpler, non-busy keyboard.  However, I prefer a separate ALPHA key, along with a STORE key: it's the most efficient way to store variables.   A consequence of a non-busy keyboard is that a lot of the commands can only be accessed through menus.  The ALPHA key could have freed nine keys for more common shifted keys such as x!, polar/rectangular conversions, etc.   I would have liked to see a couple of customizable keys where we can store commands, which could be the shift of the multiplication and division keys.  The financial calculator FC-200V has two slots to store commands.


The faster processor and the better screen are pluses.  You will still get a lot for the money spent on the fx-991CW. 


Caveat:   However, if you want, need, or require subtracted features described above (CALC feature, independent memory, multi-statement expressions), you are better off buying the former fx-991EX or a fx-115ES Plus 2nd Edition.  


Unfortunately, removing the multi-statement, Casio sapped it's algorithmic power with the fx-991CW, and it needs to come back.  Furthermore, please put integer part, fraction part, and sign functions.   


Eddie


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


Casio fx-9750GIII: Drawing the Unit Circle with an Angle

Casio fx-9750GIII:  Drawing the Unit Circle with an Angle


Introduction


The program TRIGCIRC draws a unit circle on the left side of the screen with any angle entered.  This program is an approximate simulation to the trigonometric circle application that is set to appear on future Casio non-graphing calculators in Europe, such as Belgium version of the fx-92.  Link:  https://tiplanet.org/forum/viewtopic.php?p=271049#p271049  


The program uses the full unit circle only.  



Casio fx-9750GIII Program: TRIGCIRC

(316 bytes)


Code:


Lbl 5

ClrText

Menu "ANGLE","DEG",1,"RAD",2,"GRAD",3

Lbl 1:Deg:Goto 4

Lbl 2:Rad:Goto 4

Lbl 3:Gra:Goto 4

Lbl 4

ClrGraph

ViewWindow -1.5,5,1,-1.5,1.5,1

"ANGLE"?→A

SketchThick Circle 0,0,1

SketchThick F-Line 0,0,cos A,sin A

Text 5,70,"sin θ:"

Text 12,70,sin A

Text 19,70,"cos θ:"

Text 26,70,cos A

If cos A≠0

Then

Text 33,70,"tan θ:"

Text 40,70,tan A

IfEnd

Text 47,70,"θ:"

Text 54,70,A◢

Menu "AGAIN?","YES",5,"NO",6

Lbl 6

"END - 2023 EWS"



Program Notes:


1.  Adding a display command, ◢, after a draw command like Text freezes the draw screen.  Program execution continues by pressing [ EXE ].


2.  The Text command works with pixels rather than Cartesian points.   Line numbers range from 0 to 63, top to down.  Column numbers range from 0 to 127, right to left.


3.  Syntax of Text:  Text line number, column number, text.   Text may have a string or a variable, but not both.


4.  I have a wrap-around label (Lbl 5) to let the user enter multiple angles.


5.  Due to the linear output of the programming mode, results are shown in floating point decimal approximations.  


6.  tan x = sin x / cos x.  If cos x = 0, then tan x is undefined.   This is why the If condition is present.  



Example Screenshots






I hope you find this useful and educational.  Have an excellent day,


Eddie 



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


New OS Update for Casio Classpad II

New OS Update for Casio Classpad II


Per TIPlanet:  Casio has released a new OS version (2.01.7002).   Among the changes includes the new off-screen when the Classpad is turned off with Casio's new logo "Boost Your Curiosity".  

The updates do not include the Python programming language (I don't think).

The calculators included are the fx-CP400 and fx-CP500.


TIPlanet's News Link with Downloads (in French):

https://tiplanet.org/forum/viewtopic.php?p=271577#p271577


Casio's Download Resources Page:

https://edu.casio.com/download_service/en/download/index.html


For those of you who celebrate, Happy Easter!


Eddie 

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


HP 21S: Gompertz Curve

HP 21S:  Gompertz Curve



Introduction


This program fits sequential data to the Gompertz Curve:


y = c * a ^ (b ^ x)


where:


b = ( (S3 - S1) / (S2 - S1) ) ^ 1/m

a = e^( (S2 - S1) / b * (b - 1) / (b^m - 1)^2 )

c = e^( 1 / m * (S1 * S3 - S2^2) / (S1 + S3 - 2 * S2) )


where:


m = number of data points / 3

S1 = Σ ln x_i of the first tier 

S2 = Σ ln x_i of the second tier

S3 = Σ ln x_i of the third tier



HP 21S Program Code: Gompertz Curve


Labels:


A:  initialize the program

B:  enter data

C:  calculate b, a, c


Registers:


R1 = natural log of the sum of the first-third of data points

R2 = natural log of the sum of the second-third of data points

R3 = natural log of the sum of the third-third of data points

R4 = n = number of data points ÷ 3

R5 = a

R6 = b

R7 = c


Program Code:


step #: key code; key


01:  61, 41, A;  LBL A

02:  51, 75; CLRG

03:  61, 26;  RTN


04:  61, 41, b; LBL B

05:  13;  LN

06:  21, 75, 1; STO+ 1

07:  26;  R/S

08:  13;  LN

09:  21, 75, 2; STO+ 2

10:  26; R/S

11:  13; LN

12:  21, 75, 3; STO+ 3

13:  1;  1

14:  21, 75, 4; STO+ 4

15:  22, 4;  RCL 4

16:  61, 26;  RTN


17:  61, 41, C;  LBL C

18:  33;  (

19:  22, 3;  RCL 3

20:  65;  ×

21:  22, 2;  RCL 2

22:  34;  )

23:  45;  ÷

24:  33;  (

25:  22, 2;  RCL 2

26:  65;  -

27:  22, 1; RCL 1

28:  34;  )

29:  74;  =

30:  14;  y^x

31:  22, 4; RCL 4

32:  15;  1/x

33:  74;  =

34:  21, 6;  STO 6

35:  26;  R/S

36:  33;  (

37:  22, 2; RCL 2

38:  65;  -

39:  22, 1; RCL 1

40:  34;  )

41:  55;  ×

42:  33;  (

43:  22, 6;  RCL 6

44:  65;  -

45:  1;  1

46:  34;  )

47:  45;  ÷

48:  22, 6;  RCL 6

49:  45;  ÷

50:  33; (

51:  22, 6;  RCL 6

52:  14;  y^x

53:  22, 4;  RCL 4

54:  65;  -

55:  1;  1

56:  34;  )

57:  51, 11;  x^2

58:  74;  =

59:  12;  e^x

60:  21, 5;  STO 5

61:  26;  R/S

62:  33;  (

63:  22, 1; RCL 1

64:  55;  ×

65:  22, 3; RCL 3

66:  65;  -

67:  22, 2;  RCL 2

68:  51, 11;  x^2

69:  34;  )

70:  45;  ÷

71:  33;  (

72:  22, 4; RCL 4

73:  55;  ×

74:  33;  (

75:  22, 1;  RCL 1

76:  75;  +

77:  22, 3;  RCL 3

78:  65;  -

79:  2;  2

80:  55;  ×

81:  22, 2;  RCL 2

82:  34;  )

83:  34;  )

84:  74;  =

85:  12;  e^x

86:  21, 7;  STO 7

87:  61, 26;  RTN



Example


Fit the following data into a Gompertz curve:

(1, 16)

(2, 18)

(3, 19)

(4, 25)

(5, 28)

(6, 29)

(7, 32)

(8, 36)

(9, 37)


First, order the data points. Second, divide the data into three equal parts.  For this example, we have 9 data points.  From our example:


16, 18, 19, 25, 28, 29, 32, 36, 37


is divided into:


Group I:  16, 18, 19

Group II: 25, 28, 29

Group III: 32, 36, 37


Initialize the program:  XEQ A


Enter the data:

16 XEQ B, 25 R/S, 32 R/S

18 XEQ B, 28 R/S, 36 R/S

19 XEQ B, 29 R/S, 37 R/S


Calculate the parameters:  XEQ C

b:  0.82711002676, R/S

a:  2.33690515E-1, R/S

c:  48.2137954914


The Gompertz Curve is 

y = 48.2137954914  * 2.33690515E-1 ^ (0.82711002676 ^ x)


Predict the 10th point:

Key strokes:  RCL 6, y^x ,10, =, RCL 5, y^x, LAST, ×, RCL 7 

Result:  38.776391586




Source


HP-37E & HP-38E/38C:  Marketing and Forecasting Applications  Hewlett Packard.  May 1979.




Until next time,


Eddie


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


Backlink 9999 Traffic Super

Order Now...!!!!