Rank: Member Groups: Registered
Joined: 13/11/2020(UTC) Posts: 28 Was thanked: 7 time(s) in 3 post(s)
|
Originally Posted by: Razonar Hi. A couple of issues. First, SMath needs sometimes an eval() function for speed up calculations, because SMath carry the entire definition for an expression, and not just the numerical value, like in Mathcad. Second, solve works for simple cases, for more complex cases you have the plugin "Nonlinear Solvers". In the attached I substitute solve() by Broyden(), but you can choose another from there, or try to use al_nleqsolve, which is something not less than magic in some cases. Broyden it's a numerical solver, and like any other the guess value it's part of the solution. I take the previous value x(i-1) as guess for x(i), but don't know if it's the better choice. Even the sateges in the modified SMath file are 13 and in Mathcad 12, the pinch point seems the same, more or less, based in the Mathcad plot. Two more notes: usually, solvers needs unnasigned variables. You can ensure that with Clear. Also in SMath you can't call composite functions like in mathcad with the function name. That's means in your case that the actual definition for McCabe.ER(f,g) it's "wrong", and the correct one it's "McCabe.ER(f(1),g(1))" and then you can call it with "ans = McCabe.ER(f(x#),g(x#))". Mc Cabe Valentino 2020.sm (189kb) downloaded 41 time(s). Mc Cabe Valentino 2020.pdf (707kb) downloaded 38 time(s).Best regards. Alvaro. Alvaro Muchas Gracias Friend, thanks, I had no idea about "Non-linear Solvers" I really liked this solution. But there is a problem, when "q = 0" the food line or q-Line is drawn in the opposite direction using "Non Linear Solvers" I found a solution without having the "Non-Linear Solvers" It is very simple. You only have to create a matrix that groups each value that conforms to the function, that is, "X = [X1, X2, X3, ... X11]" = [Y1, Y2, Y3, ... Y11] "in this way, the computer can calculate it in 25 seconds and not in 27 minutes. The only one but is that it still takes 25 seconds, I would like it to do it in 5 seconds. Thank you very much for answering my question files Benzene - Water.pdf (762kb) downloaded 24 time(s). Mc Cabe Valentino without NLS.sm (207kb) downloaded 21 time(s).
|