TK Solver
TK Solver
(OP)
All,
being recently introduced to tk solver, i really need a better book than what was provided by uts.
anyone have any recommended suggestions for books, forums, or technical articles?
the immediate need is how to multiply two tables or list of values, similar to computing moleweight for a hydrocarbon gas (i.e. mole fraction(i) x moleweight(i)).
I want to convert some excel workbooks to using tk.
-pmover
being recently introduced to tk solver, i really need a better book than what was provided by uts.
anyone have any recommended suggestions for books, forums, or technical articles?
the immediate need is how to multiply two tables or list of values, similar to computing moleweight for a hydrocarbon gas (i.e. mole fraction(i) x moleweight(i)).
I want to convert some excel workbooks to using tk.
-pmover






RE: TK Solver
2. You can write a procedure function to loop through a set of assignment statements which reference arrays.
The best solution depends upon whether you are looking to solve a problem once or are looking to build a more versatile application. Let me know and I can give you an example.
What TK book are you trying to use? The TK Solver User's Guide which comes with TK4 includes details on both of the solutions suggested above.
RE: TK Solver
objective: in process of converting 2 spreadsheets to tk solver as iterations and significant calcs are required. what i'm trying to determine is moleweight of a gas mixture. mw of mixture is the sum of mixture components mole fraction multiplied by mixture component molecular weight (i.e. MW mixture = sum of x(i) * MW(i), where i=1 to 15 gas mixture components).
there are two input lists, one named moleweight, which contains the mole weights of hydrocarbon gases and the other named molefractions, which contains the percent mixture mole fraction.
Rule Sheet has:
MW=moleweight[4]*molefraction[4], which works just fine, but only the 4th component. this calc needs to be accomplished for each mixture component.
What is needed is a table that contains the resultant value of each component moleweight, and then displayed on variable sheet the total mixture moleweight.
i thought i had your email address, but must have misplaced it. will be glad to send tk file, but thought this posting would suffice for now.
by the way, i noticed the tk forum - good job! i was familiar with tk as a former employer uses it extensively, but that was 5 years ago and ...
-pmover
RE: TK Solver
I remembered an example you might be interested in from IIT's TK Tutorial. This little procedure is used in a model for computing dew point or bubble point of a mixture.
Q = 0
k = 2*(type='b) - 1 ; type is input as 'b or 'd
for j = 1 to length('a)
'vp[j] = 10^('a[j]-'b[j]/('c[j]+T))
Q = Q + 'mfin[j]*'vp[j]^k
next i
P = Q^k
for j = 1 to length('a)
'mfout[j] = 'mfin[j]*('vp[j]/P)^k
next i
Here is some sample data they used, with the columns representing component, mfin, and a, b, c coefficients from Antoine's equation.
benzene .40 6.90565 1211.033 220.79
styrene .35 6.92409 1420.000 206
toluene .25 6.95334 1343.943 219.377
If you'd like to send me your model for more suggestions, send it to todd@uts.com. I'll be happy to take a look.
RE: TK Solver
http://www.engs-comp.com/mathserv/index.html
For example, type in any word processor:
A = {1,3,6,8,4}
B = {5,6,2,3,9}
C = mattranspose(B)
D = matmult(A,C)
print using "####"; D
(this command returns a 5x5 matrix)
5 6 2 3 9
15 18 6 9 27
30 36 12 18 54
40 48 16 24 72
20 24 8 12 36
E = matmult(C,A)
print E
(this command returns a scalar) 95.0000
To solve nonlinear equations online, see:
http://www.engs-comp.com/solvnonlinearequ/index.html
engcomp@ozemail.com.au
http://www.engs-comp.com/