Error

 Previous Topic Next Topic
 Valentino #1 Posted : 19 November 2020 03:56:19(UTC) Rank: NewbieGroups: Registered Joined: 13/11/2020(UTC)Posts: 3 Hello guys I made a worksheet to calculate the theoretical stages of a binary distillation column using the McCabe method, however, when making the McCabe graph, the program takes a long time to do it, can anyone help me? sometimes it takes almost 27 minutes to solve it I'm new using "SMath Studio" so I don't know if the procedure I'm using is the right one. Well, what I do is use the same method that I use in "Mathcad Prime 6" and mathcad makes that graph in less than a second and SMath in 5 - 27 minutes files:SMath Studio Mc Cabe Valentino 2020.sm (186kb) downloaded 7 time(s).Mathcad Prime 6 McCabe Mathcad Prime 6.pdf (534kb) downloaded 6 time(s).Edited by user 19 November 2020 04:11:41(UTC)  | Reason: Not specified
 Wanna join the discussion?! Login to your SMath Studio Forum forum accountor Register a new forum account.
 Razonar #2 Posted : 19 November 2020 07:22:39(UTC) Rank: Advanced MemberGroups: Registered Joined: 28/08/2014(UTC)Posts: 545Was thanked: 310 time(s) in 195 post(s) 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 12 time(s). Mc Cabe Valentino 2020.pdf (707kb) downloaded 11 time(s).Best regards.Alvaro. 1 user thanked Razonar for this useful post. on 19/11/2020(UTC)
 Razonar #4 Posted : 19 November 2020 22:36:04(UTC) Rank: Advanced MemberGroups: Registered Joined: 28/08/2014(UTC)Posts: 545Was thanked: 310 time(s) in 195 post(s) Hola Valentino.Originally Posted by: Valentino But there is a problem, when "q = 0" the food line or q-Line is drawn in the opposite direction using "Non Linear Solvers"Yes, Broyden it's unstable in your case. As I understand, q = 1 – (TF–Tbp)/(Tdp–Tbp) and given that y = q/(q-1)*x-z/(q-1), so for q = 0 you have an horizontal slope line of saturated vapor feed, for q = 1 a saturated liquid feed with a slope of the feed line is infinity (vertical), a mixture of liquid and vapor for 0 < q < 1, subcooled liquid for q > 1 and superheated vapor for q < 0. So, It could be hard to test for every cases.Originally Posted by: Valentino 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.Great! I attach some few notes, but your works looks complete. Mc Cabe Valentino without NLS.sm (215kb) downloaded 8 time(s).Saludos a México!Alvaro.PD: Maybe you could be interested in use CoolProp in SMath: https://en.smath.com/for...98_CoolProp-Wrapper.aspxEdited by user 19 November 2020 22:41:12(UTC)  | Reason: Adding coolprop link
 Valentino #5 Posted : 22 November 2020 19:47:16(UTC) Rank: NewbieGroups: Registered Joined: 13/11/2020(UTC)Posts: 3 Originally Posted by: Jean Giraud Thanks for the *.PDF from which the system was recovered.If you have interest in Thiele inverse interpolation, please let me know.My Smath repository of applied projects is immense, but many tutorial style.Cheers ... Jean Thiele McCabe.sm (113kb) downloaded 7 time(s).Hi Jean Friend thanks for taking the time and solving the worksheet. however my Smath Studio 0.99 does not allow me to see the solutionI leave my file already corrected, I added a database to it. McCabe Thiele - Valentino para Destilacion.sm (455kb) downloaded 7 time(s).
 Jean Giraud #6 Posted : 22 November 2020 23:50:40(UTC) Rank: Advanced MemberGroups: Registered Joined: 04/07/2015(UTC)Posts: 4,872Was thanked: 801 time(s) in 635 post(s) Originally Posted by: Valentino Friend thanks for taking the time and solving the worksheet. However my Smath Studio 0.99 does not allow me to see the solutionHola Amigo, there are several walls between us.1. SS 6179 does not open latest SS. Grand experts have not doctored "Wrong Format"2. Latest SS freaks the SS 6179 code [length collaboration wrt Hanski project].3. Your snippets are so small, no software can recuperate.Open that short version and make *.PDF of the first red complain.It runs in 9 s [SS 6179, Win.7 1.66 GHz].I you wish, easy to open the collapsed areas, make/attach PDF.That may help you to simulate the codes..Thanks for this superb insight to McCabe-Thiele ... Jean Thiele McCabe Short.sm (105kb) downloaded 5 time(s).