Thursday, August 03, 2006

(Over)doing it with Symbolic Algebra and TK Solver

Consider the following equation as might be found in a TK Solver math model...







If we know values of r and k, TK's Direct Solver can easily compute x. What if we know x and r and need to compute k? We have several options. We can use TK's Iterative Solver. We can also use the TK Optimizer. If our goal is to create a model that is easy to use and maintain, it would be best if we could simplify the equation so it solves directly for k. No problem... we can (perhaps using a symbolic algebra software package) derive the equivalent equation.





Let's use the same approach to solve for r given x and k. Again, we can algebraically rearrange things...



We now have equations that solve for each of the three variables in the original equation. If we enter all three on the TK Solver rule sheet, TK can directly solve the equation with the isolated unknown. Let’s try them out with the following inputs… r = 2 and k = 1 .

The first equation solves directly for x = 0.

The second equation is found consistent, saying that 1 = ln(2)/ln(2).

The third equation fails, with TK reporting a division by zero error message when TK divides 1 by (1-1).

One way to avoid this error is to use a conditional rule (if k<>1 then...), but the simplest approach of all is to use a single equation where each of the variables appears just once.



TK’s Direct Solver can solve this equation given any two of the three variables, even for the troublesome input of k = 1. The only condition that will cause an error is when k = 0, but that is the case for all the other equations as well.

Be on the lookout for opportunities like this to make life easy for TK's Direct Solver. It will make your models easier to use. And be aware that symbolic algebra software can help you to simplify your TK models -- but you still need to THINK or you might just overdo it.

amazing 

counters
Dell Computer Deals