Hi everyone,

I have this new idea to program an equation solver in my calculator but am stuck as to how I should go about.

I have a general plan but don't know how to actually execute it.

I want to base it off of this:



basically i will first input the ksp of a given compound that is always given to you

then the program would let me select either MY, MY_2, MY_3, and M_2Y_3

and based on which one i select i will then use that formula to find x

I would greatly appreciate it if someone could give me ideas as to how I can do this.

Thanks,

L
Sorry, before I try and help with this. I just wanted to say when I saw Ksp, I thought that meant Kerbal Space Program. Rolling Eyes 0x5

Anyways, I would have something like

Code:
Input "ENTER KSP ",A
Menu("WHICH ONE?","MY",1,"MY2",2,"MY3",3,"M2Y3",4,"Quit",0

Lbl 1
√(A)→X
Goto 0

Lbl 2
3√(A4)→X
Goto 0

Lbl 3
4√(A27)→X
Goto 0

Lbl 4
5√(A108)→X
Goto 0

Lbl 0
X

The code wont completely copy over correctly so you may get a few Syntax errors, but I hope this helps!

Of course I hope you are using this with good intentions and not to cheat. Razz
TheLastMillennial wrote:
Sorry, before I try and help with this. I just wanted to say when I saw Ksp, I thought that meant Kerbal Space Program. Rolling Eyes 0x5

Anyways, I would have something like

Code:
Input "ENTER KSP ",A
Menu("WHICH ONE?","MY",1,"MY2",2,"MY3",3,"M2Y3",4,"Quit",0

Lbl 1
√(A)→X
Goto 0

Lbl 2
3√(A4)→X
Goto 0

Lbl 3
4√(A27)→X
Goto 0

Lbl 4
5√(A108)→X
Goto 0

Lbl 0
X

The code wont completely copy over correctly so you may get a few Syntax errors, but I hope this helps!

Of course I hope you are using this with good intentions and not to cheat. Razz

Oh god, Ksp got me all excited and then you drop this solubility product constant stuff on me Razz
As for the code above, it could be optimized down, if you're willing to make do without a menu. WHICH ONE would be a number from 1-4, 1 being MY, 2 being MY2, 3 being MY3, and 4 being M2Y3

Code:
Input "KSP=",A
Input "WHICH ONE? ",B
{1,4,27,108
Bˣ√(A/Ans(B


Here is a more generalized case that allows you to input values for M and Y, as well as Ksp. The code is also pretty elegant imo Razz

Code:
Prompt K,M,Y
solve(M^MY^YX^(M+Y)-A,X,0
And even smaller, assuming you know what A and B mean.


Code:
Prompt A,B
{1,4,27,108
Bˣ√(A/Ans(B
Oh my god...!!! this is absolutely amazing...!!!

I was just double checking my work and this works flawless as a comparison to figure out a set number of compounds of varying ksps in relation towards solubility with one another!

I am so happy and grateful you can share this knowledge and help

Graciously,

L
Ooh much thanks!

I don't want to speak for others, but anytime!

People here are rather good at that...
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement