Hi everyone,

I thought of another idea for calculating entropy and began to attempt programming on my calculator but I keep getting an argument error.

Here is what I have done so far


Code:
:Input "Ssystem: ", A
:Input "H^0: ",B
:Input "TEMP: ",C
:A+((-1000*B)/C)->X
Disp "Suniverse= "
Output(X)


I'm basing everything I learned from the formula

delta S universe = delta S system + delta S surroundings

delta S surroundings = - delta H rxn / temperature

delta universe = delta S rxn - (delta H rxn / temperature)

If possible I want to make an additional option where after I get my results it would let me whether the reaction is spontaneous or non spontaneous

so if delta S universe comes out to be a negative value then its will tell me next to the answer non spontaneous, but if the answer is positive then it is spontaneous.

Thanks you

L
lydte wrote:
Hi everyone,

I thought of another idea for calculating entropy and began to attempt programming on my calculator but I keep getting an argument error.

Here is what I have done so far


Code:
:Input "Ssystem: ", A
:Input "H^0: ",B
:Input "TEMP: ",C
:A+((-1000*B)/C)->X
Disp "Suniverse= "
Output(X)


I'm basing everything I learned from the formula

delta S universe = delta S system + delta S surroundings

delta S surroundings = - delta H rxn / temperature

delta universe = delta S rxn - (delta H rxn / temperature)

If possible I want to make an additional option where after I get my results it would let me whether the reaction is spontaneous or non spontaneous

so if delta S universe comes out to be a negative value then its will tell me next to the answer non spontaneous, but if the answer is positive then it is spontaneous.

Thanks you

L

Okay, so the argument error is probably due to the space you have after the comma on the first line. Unlike other basic languages, ti-basic cares about spaces. Also, more importantly, the output command does not work like that. For your output command, you need to specify the coordinates on screen. I'd recommend not using it for this program because it is not really needed.

Code:
Input "Ssystem: ",A
Input "H^0: ",B
Input "TEMP: ",C
A+((~1000*B)/C)->X
Disp "Suniverse= ",X

The tilde (~) is used to denote the negative sign, rather than the subtraction symbol.
It is very easy to add the little check to see if the reaction is spontaneous. Of course, the user could just look at the sign of the answer, but let's throw it in since you asked Razz

Code:
Input "Ssystem: ",A
Input "H^0: ",B
Input "TEMP: ",C
A+~1000B/C->X
Disp "Suniverse= ",X
"Spontaneous
If abs(X)>X
"Non-"+Ans
Ans

What this does it check if the absolute value of delta S universe is greater than delta S universe, if it is, then we know it is negative, and therefore add the suffix "Non-" to the word Spontaneous.
Also, the last line of a program is displayed, so we just need to put Ans.
mr womp womp wrote:
lydte wrote:
Hi everyone,

I thought of another idea for calculating entropy and began to attempt programming on my calculator but I keep getting an argument error.

Here is what I have done so far


Code:
:Input "Ssystem: ", A
:Input "H^0: ",B
:Input "TEMP: ",C
:A+((-1000*B)/C)->X
Disp "Suniverse= "
Output(X)


I'm basing everything I learned from the formula

delta S universe = delta S system + delta S surroundings

delta S surroundings = - delta H rxn / temperature

delta universe = delta S rxn - (delta H rxn / temperature)

If possible I want to make an additional option where after I get my results it would let me whether the reaction is spontaneous or non spontaneous

so if delta S universe comes out to be a negative value then its will tell me next to the answer non spontaneous, but if the answer is positive then it is spontaneous.

Thanks you

L

Okay, so the argument error is probably due to the space you have after the comma on the first line. Unlike other basic languages, ti-basic cares about spaces. Also, more importantly, the output command does not work like that. For your output command, you need to specify the coordinates on screen. I'd recommend not using it for this program because it is not really needed.

Code:
Input "Ssystem: ",A
Input "H^0: ",B
Input "TEMP: ",C
A+((~1000*B)/C)->X
Disp "Suniverse= ",X

The tilde (~) is used to denote the negative sign, rather than the subtraction symbol.
It is very easy to add the little check to see if the reaction is spontaneous. Of course, the user could just look at the sign of the answer, but let's throw it in since you asked Razz

Code:
Input "Ssystem: ",A
Input "H^0: ",B
Input "TEMP: ",C
A+~1000B/C->X
Disp "Suniverse= ",X
"Spontaneous
If abs(X)>X
"Non-"+Ans
Ans

What this does it check if the absolute value of delta S universe is greater than delta S universe, if it is, then we know it is negative, and therefore add the suffix "Non-" to the word Spontaneous.
Also, the last line of a program is displayed, so we just need to put Ans.


A minor optimization on line 7:

Code:
If X<abs(X


You can omit that closing parenthesis.

Also:

Code:
A+~1000B/C->X

could be

A-1000B/C->X
Hi everyone,

Thank you for your help. I got it to work!

My only question which is a more arbitrary question is ...

Why is it that when ever I get the result of an answer .. say my final answer after running the program was 476 kJ

When I try to use the cursor and move up, the answer disappears so I can't select the answer
Is there any way to program my answer so I can select the result I get after running my program?

Or is that a built in feature that can't be done when running programs on Ti ?

Thanks

L
You are displaying, so no.
Unfortunately, there is no easy way to do that. However, you can still use X (which holds the value of delta S universe) after the program has terminated, if you want to recall that value...
mr womp womp wrote:
Unfortunately, there is no easy way to do that. However, you can still use X (which holds the value of delta S universe) after the program has terminated, if you want to recall that value...


Oh that's sick!

I didn't know that!! - that's absolutely amazing

Thank you!
  
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