I'm tired of trying to code this..
I keep on putting the wrong things.. multiply by wrong thing, or divide the wrong thing.. etc.

So much easier with real life numbers -__-

So what I'm trying to do, is create a solver for the type of problems on the link below.
Examples are: Problem 1, 2, and 3.
http://www.chemteam.info/Mole/CombustionAnalysis.html

The difference with the ones already out there, is that I want to show the work.

Adding on, my work looks like CRAP because I kept getting things wrong and adding more "->" and more "->" to see if I could get something to work. Additionally, it can be reduced a lot.
Anyways, here's the code so far:


Code:
Lbl 9
ClrHome
ClrDraw
Input "g OF SAMPLE GIVEN ",G
Input "g CO2 GIVEN ",C
Input "g H2O GIVEN ",H
Input "g MASS OF CARBON",M
Input "g MASS OXYGEN",O
Input "g MASS OF HYDROGEN",U
(O)(2)+(M)->P
C(M/P)->Z
H*2->E
U*2->T
H+O->F
U*2->R
U+O*2->Q
F*((U*2)/(Q)->K
ClrHome
ClrDraw
Text(0,0,"CARBON. O*",2,"=",P
Text(6,0,"",C,"(",M,"/",P,"=",Z
Text(12,0,"HYDRGN. H*",2,"=",E
Text(24,0,"",H,"*(",R,")/(",H,"+ O",2,"=",K
Pause
ClrHome
ClrDraw
Text


Furthermore, here are some things that can be replaced:
mass of H->1.01
mass of O->16
mass of C->12.01
I'm up for doing this. I'll see what I can do.
I'll give you credits in my app.

I'm making a REALLY BIG Chemistry app.
I will release it here, and ticalc.
and put a link for people to come here
Also, I'd be more than happy to write a TI-82 and TI-85/TI-86 port when this is done, if possible.
cvsoft wrote:
Also, I'd be more than happy to write a TI-82 and TI-85/TI-86 port when this is done, if possible.


Sure.

But for now, it's for the Ti83+/84+

::EDIT::
Here's the REAL way to do it.
http://www.kentchemistry.com/aplinks/chapters/3stoich/Empirical.htm
http://www.youtube.com/watch?v=DDFQtZk2Vc4
Got it finished for TI-83/+ and TI-86, will post my code in this post soon along with every port imaginable without Nspiration.
cvsoft wrote:
Got it finished for TI-83/+ and TI-86, will post my code in this post soon along with every port imaginable without Nspiration.


Awesome! thanks.

Can't wait to see what it looks like Smile
xologist wrote:
I'll give you credits in my app.

I'm making a REALLY BIG Chemistry app.
I will release it here, and ticalc.
and put a link for people to come here


Just please don't sell it on eBay; that's silly. Smile Some people do that...
CalebHansberry wrote:
xologist wrote:
I'll give you credits in my app.

I'm making a REALLY BIG Chemistry app.
I will release it here, and ticalc.
and put a link for people to come here


Just please don't sell it on eBay; that's silly. Smile Some people do that...


Never thought of that..
Anyways, let me know when you finish it! Smile
Fixed and optimized.

Code:
 
ClrHome
ClrDraw
Input "g OF SAMPLE GIVEN ",G
Input "g CO2 GIVEN ",C
Input "g H2O GIVEN ",H
Input "g MASS OF CARBON",M
Input "g MASS OXYGEN",O
Input "g MASS OF HYDROGEN",U
2O+M->P
CM/Ans->Z
2H->E
2U->T
H+O->F
U+2O->Q
FT/Q->K
ClrHome
ClrDraw
Text(24,0,H,"*(",T,")/(",H,"+ O",2,"=",Ans
Text(0,0,"CARBON. O*",2,"=",P
Text(6,0,"",C,"(",M,"/",P,"=",Z
Text(12,0,"HYDRGN. H*",2,"=",E
Pause 
ClrHome
ClrDraw
Here's a version I wrote, doesn't really show work but is easy to understand and fix.

TI-73

Code:

:ClrScreen
:SetMenu("GRAMS OF","SAMPLE",S,"CO2",D,"H2O",I
:12.011D/44.0098→C
:2.0158I/18.0152→H
:S-C-H→O
:ClrScreen
:Disp "G C:","G H:","G O:"
:Output(1,5,C
:Output(2,5,H
:Output(3,5,O
:C/12.011→C
:H/1.0079→H
:O/15.9994→O
:min({C,H,O})→S
:C/S→C
:H/S→H
:O/S→O
:Pause
:ClrScreen
:Disp "EMPIRICAL FORM.","C:","H:","O:"
:Output(2,4,round(C,2
:Output(3,4,round(H,2
:Output(4,4,round(O,2
:Pause
:ClrScreen
:Output(8,1,""


TI-81

Code:

:ClrHome
:Disp "G SAMPLE?"
:Input S
:Disp "G CO2?"
:Input D
:Disp "G H2O?"
:Input I
:12.011D/44.0098→C
:2.0158I/18.0152→H
:S-C-H→O
:Disp "g C"
:Disp C
:Disp "g H"
:Disp H
:Disp "g O"
:Disp O
:C/12.011→C
:H/1.0079→H
:O/15.9994→O
:C→M
:If M<H
:H→M
:If M<O
:O→M
:C/M→C
:H/M→H
:O/M→O
:Pause
:ClrHome
:Disp "EMPIRICAL FORM."
:Disp "C"
:Disp C
:Disp "H"
:Disp H
:Disp "O"
:Disp O
:Pause
:ClrHome


TI-82/83/+/84+/SE

Code:

:ClrHome
:Input "G SAMPLE: ",S
:Input "G CO2: ",D
:Input "G H2O: ",I
:12.011D/44.0098→C
:2.0158I/18.0152→H
:S-C-H→O
:ClrHome
:Disp "G C:","G H:","G O:"
:Output(1,5,C
:Output(2,5,H
:Output(3,5,O
:C/12.011→C
:H/1.0079→H
:O/15.9994→O
:min({C,H,O})→S
:C/S→C
:H/S→H
:O/S→O
:Pause
:ClrHome
:Disp "EMPIRICAL FORM.","C:","H:","O:"
:Output(2,4,round(C,2
:Output(3,4,round(H,2
:Output(4,4,round(O,2
:Pause
:ClrHome
:Output(8,1,""


TI-85/86

Code:

:ClLCD
:Input "grams sample: ",S
:Input "grams CO2: ",D
:Input "grams H2O: ",I
:12.011D/44.0098→C
:2.0158I/18.0152→H
:S-C-H→O
:ClLCD
:Disp "g C:","g H:","g O:"
:Outpt(1,5,C
:Outpt(2,5,H
:Outpt(3,5,O
:C/12.011→C
:H/1.0079→H
:O/15.9994→O
:min({C,H,O})→S
:C/S→C
:H/S→H
:O/S→O
:Pause
:ClLCD
:Disp "  Empirical formula","C:","H:","O:"
:Outpt(2,4,round(C,2
:Outpt(3,4,round(H,2
:Outpt(4,4,round(O,2
:Pause
:ClLCD
:Outpt(8,1,""


I'll port to 68k later.
Wow, haven't logged-in in a bit.

Thanks guys.

I will place it in my program + give you credits, + publicly release the whole program afterwards.
  
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