McCabe - Thiele Binary Distillation - McCabe code takes a long time to calculate - Сообщения

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 (185 КиБ) скачан 94 раз(а).
Mathcad Prime 6
McCabe Mathcad Prime 6.pdf (533 КиБ) скачан 91 раз(а).
[albumimg]1618[/albumimg]
[albumimg]1619[/albumimg]
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 (188 КиБ) скачан 74 раз(а).
Mc Cabe Valentino 2020.pdf (706 КиБ) скачан 73 раз(а).
Best regards.
Alvaro.
WroteHi. 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 (188 КиБ) скачан 74 раз(а).
Mc Cabe Valentino 2020.pdf (706 КиБ) скачан 73 раз(а).
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

[albumimg]1620[/albumimg]
[albumimg]1621[/albumimg]
files
Benzene - Water.pdf (761 КиБ) скачан 51 раз(а).
Mc Cabe Valentino without NLS.sm (206 КиБ) скачан 49 раз(а).
Wrote
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.
Wrote
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 (214 КиБ) скачан 57 раз(а).
Saludos a México!
Alvaro.
PD: Maybe you could be interested in use CoolProp in SMath: https://en.smath.com/forum/yaf_postst7398_CoolProp-Wrapper.aspx
WroteThanks 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 (112 КиБ) скачан 42 раз(а).
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 solution
[albumimg]1622[/albumimg][albumimg]1623[/albumimg]
I leave my file already corrected, I added a database to it.
[albumimg]1624[/albumimg]
McCabe Thiele - Valentino para Destilacion.sm (454 КиБ) скачан 63 раз(а).
WroteFriend thanks for taking the time and solving the worksheet.
However my Smath Studio 0.99 does not allow me to see the solution
Hola 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 (104 КиБ) скачан 51 раз(а).
Read first Thiele-McCabe Short. BTW, Thorval Thiele is in my bag for years.
But, couldn't find anything about McCabe, except guess he was from Scotland.
Then visit Thiele minimalist classroom. If you have interest getting more
wrt your project for instance Cf(x) in reduced J_Frac, please let me know.
Thanks again for this most useful/educative project.
Thiele is for advanced Engineering stuff. I got it from F.B. Hildebrand,
made it work in pocket calculator(s) around 1990, then Excel, then Mathcad.
Carlos contribution is recent in Smath. More generally, I use my original.
Cheers, take care ... Jean
Thiele_3 Automatic [on error Carlos].sm (86 КиБ) скачан 56 раз(а).
Thiele McCabe Short.sm (109 КиБ) скачан 53 раз(а).
Added in collapsed the topic about casual glitches.
Still attempting to compact the code of the Tray System.
Your last comment/suggestion ? ... Jean
Thiele McCabe Short.sm (163 КиБ) скачан 52 раз(а).
WroteStill attempting to compact the code of the Tray System.
Added this missing link tray-stage system Companion.
Superb classroom Engineering demo project ... ended as given.
Thanks Valentino ... Jean
Thiele McCabe Short Companion.sm (123 КиБ) скачан 68 раз(а).
The Companion is not installed where it should be, exercise for the user.
It could be compacted, that would complicate for Smath not too familiar.
WroteWroteStill attempting to compact the code of the Tray System.
Added this missing link tray-stage system Companion.
Superb classroom Engineering demo project ... ended as given.
Thanks Valentino ... Jean
Thiele McCabe Short Companion.sm (123 КиБ) скачан 68 раз(а).
The Companion is not installed where it should be, exercise for the user.
It could be compacted, that would complicate for Smath not too familiar.
Friend, thank you very much, even though my Smath Studio cannot fully resolve the document you share.
[albumimg]1627[/albumimg]
However create an executable with a database (700 compounds). I hope it is useful for someone in the community. Do you know where you could put it in this community?
[albumimg]1626[/albumimg]
SMATH STUDIO 0.99
McCabe Thiele - 700 Compuestos.sm (561 КиБ) скачан 88 раз(а).
.EXE (ZIP)
McCabe Thiele - 700 Compuestos.7z (1 МиБ) скачан 80 раз(а).
Wrote...
However create an executable with a database (700 compounds). I hope it is useful for someone in the community. Do you know where you could put it in this community?
[albumimg]1626[/albumimg]
SMATH STUDIO 0.99
McCabe Thiele - 700 Compuestos.sm (561 КиБ) скачан 88 раз(а).
.EXE (ZIP)
McCabe Thiele - 700 Compuestos.7z (1 МиБ) скачан 80 раз(а).
Hola Valentino. Excelente trabajo. De momento no hay foros divididos por ingeniería, pero pienso que el mejor lugar es el foro correspondiente a "Samples". Quizás alguien más pueda recomendar algun otro lugar mejor para tu trabajo.
Hi Valentino. Excellent work. At the moment there are no forums divided by engineering, but I think the best place is the forum corresponding to "Samples". maybe someone else can recommend a better place for your work. Maybe someone else can recommend a better place for your work.
Best regards.
Alvaro.
Expose the all document, make *.PDF, for the all community quick visit.
I'm still waiting your *.PDF of my document that you declared red.
From distillation columns to distillation columns, Heavy Water ends
in a 2 m high column ~ 2 " diameter Dupont Patent secret.
WroteWhat is that joke *.EXE zip ?
Expose the all document, make *.PDF, for the all community quick visit.
I'm still waiting your *.PDF of my document that you declared red.
From distillation columns to distillation columns, Heavy Water ends
in a 2 m high column ~ 2 " diameter Dupont Patent secret.
hello friend I hope you are very well

Regarding the .EXE, this page does not allow me to upload this type of files, so I uploaded it as ZIP or 7Z, the Smath Studio allows saving it as executable and it is the one I uploaded on this page.
Document not fully resolved PDF
Thiele McCabe Short-1.pdf (418 КиБ) скачан 58 раз(а).
McCabe 700 Document PDF Compounds, resolution in 3 seconds
McCabe Thiele - 700 Compuestos Erick Valentino.pdf (620 КиБ) скачан 65 раз(а).
Antoine's Constants Document PDF
CA.pdf (2 МиБ) скачан 50 раз(а).
WroteDocument not fully resolved PDF
Slanted maths are just horror
Please run this version stripped of some notes from my small laptop.
Why it does not plot in your system ? If red plot, what does it says ?
Make sure you close PC, open PC and only Smath and this document.
Wait and read from You ... Jean
Thiele McCabe Companion MERITAS.sm (76 КиБ) скачан 38 раз(а).
I have no idea why a definition on your build is represented as numeric equal on latest builds.
It was giving red dots on build 7632 but now everything is fine.
Everything is calculated and plotted, no more red dots.
Regards
WroteJean, for Cfr(K;X;x) function, had to change equal sign "=" to ":=" on your previous document.
I have no idea why a definition on your build is represented as numeric equal on latest builds.
It was giving red dots on build 7632 but now everything is fine.
Everything is calculated and plotted, no more red dots.
Thanks Collab for the Smath Community. What a crucifying bug !!!
As put in evidence, latest SS does not recast
Probably, very many documents that use the "recast" technique will turn red
on revisit after latest SS update ... not only mines.
I don't want to believe the "recast" code has been voluntarily removed.
For users, a bug is a bug that the concerned file or else.
Thanks overlord for pointing the failure. Take care ... Jean.
Best Regards
Carlos
Thiele McCabe Companion MERITAS_V7632.sm (77 КиБ) скачан 65 раз(а).
-
Новые сообщения
-
Нет новых сообщений