Firstly I apologise if this is the wrong forum, and would ask for forgiveness in advance.
My issue is as follows: I wish to make several calculations using the spreadsheet, or possibly make a program to help out with the process.
So what I would like to do is make multiple guesses and have the calculator make a few calculations based on my guesses.
The equations I wish to use are Antoine's equation and Raoult's law (chemistry).
The Antoine equation is: ln(Piº)=Ai-((Bi)/(Ci+T(K)))The Antoine constants for two components are A, B, C for cell number 1 & to for respective component.
I wish to guess the given temperature until Raoults law is true:
xi*Piº=y_i*P, where P is known, either x_i/y_i is known and Sum(x_i)=Sum(y_i)=1.
To solve Piº for each component I will normally use solve(ln(Piº)=Ai-((Bi)/(Ci+T(K))),Piº) for a guessed T, for both components, check if the sum=1 and if not, iterate with a new guess. This process can be tedious and I'd like to shorten it.
Code:
Lets says y_i is given and x_i sought (and the relevant temperature is also sougt)
The solution is as follows: Guess T ► Find Piº ► solve Xi ► Check if Sum(Xi)=1 ► [No?] ►Guess another T
►[Yes?] Great, we have found relevant T
Now how would I go about doing this on the CX CAS using spreadsheets to do the calculations for me?
What I have tried so far (mind you the X1 and X2 columns are not full calcs, just calcs for Piº, but they give errors)
Thank you in advance,
My issue is as follows: I wish to make several calculations using the spreadsheet, or possibly make a program to help out with the process.
So what I would like to do is make multiple guesses and have the calculator make a few calculations based on my guesses.
The equations I wish to use are Antoine's equation and Raoult's law (chemistry).
The Antoine equation is: ln(Piº)=Ai-((Bi)/(Ci+T(K)))The Antoine constants for two components are A, B, C for cell number 1 & to for respective component.
I wish to guess the given temperature until Raoults law is true:
xi*Piº=y_i*P, where P is known, either x_i/y_i is known and Sum(x_i)=Sum(y_i)=1.
To solve Piº for each component I will normally use solve(ln(Piº)=Ai-((Bi)/(Ci+T(K))),Piº) for a guessed T, for both components, check if the sum=1 and if not, iterate with a new guess. This process can be tedious and I'd like to shorten it.
Code:
A, B, C are antoine constants, tk is temperature in kelvin
Lets says y_i is given and x_i sought (and the relevant temperature is also sougt)
The solution is as follows: Guess T ► Find Piº ► solve Xi ► Check if Sum(Xi)=1 ► [No?] ►Guess another T
►[Yes?] Great, we have found relevant T
Now how would I go about doing this on the CX CAS using spreadsheets to do the calculations for me?
What I have tried so far (mind you the X1 and X2 columns are not full calcs, just calcs for Piº, but they give errors)
Thank you in advance,