Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline Valentino  
#1 Posted : 19 November 2020 03:56:19(UTC)
Valentino


Rank: Member

Groups: Registered
Joined: 13/11/2020(UTC)
Posts: 28
Man
Mexico

Was thanked: 7 time(s) in 3 post(s)
Hello guys Victory


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 Thank you Help smilie



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 Dance Search


files:

SMath Studio
Mc Cabe Valentino 2020.sm (186kb) downloaded 51 time(s).

Mathcad Prime 6
McCabe Mathcad Prime 6.pdf (534kb) downloaded 44 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 account. New Registrations are disabled.

Offline Razonar  
#2 Posted : 19 November 2020 07:22:39(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 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 39 time(s).
Mc Cabe Valentino 2020.pdf (707kb) downloaded 36 time(s).

Best regards.
Alvaro.
thanks 1 user thanked Razonar for this useful post.
on 19/11/2020(UTC)
Offline Valentino  
#3 Posted : 19 November 2020 13:54:55(UTC)
Valentino


Rank: Member

Groups: Registered
Joined: 13/11/2020(UTC)
Posts: 28
Man
Mexico

Was thanked: 7 time(s) in 3 post(s)
Originally Posted by: Razonar Go to Quoted Post
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 39 time(s).
Mc Cabe Valentino 2020.pdf (707kb) downloaded 36 time(s).

Best regards.
Alvaro.




Alvaro Muchas Gracias Biggrin

Friend, thanks, I had no idea about "Non-linear Solvers" I really liked this solution. OK Oh my



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 Clap





files

Benzene - Water.pdf (762kb) downloaded 23 time(s).
Mc Cabe Valentino without NLS.sm (207kb) downloaded 20 time(s).
Offline Razonar  
#4 Posted : 19 November 2020 22:36:04(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
Hola Valentino.

Originally Posted by: Valentino Go to Quoted Post


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 Go to Quoted Post

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 25 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.aspx

Edited by user 19 November 2020 22:41:12(UTC)  | Reason: Adding coolprop link

Offline Valentino  
#5 Posted : 22 November 2020 19:47:16(UTC)
Valentino


Rank: Member

Groups: Registered
Joined: 13/11/2020(UTC)
Posts: 28
Man
Mexico

Was thanked: 7 time(s) in 3 post(s)
Originally Posted by: Jean Giraud Go to Quoted Post
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 16 time(s).



Hi Jean Thank you
Friend thanks for taking the time and solving the worksheet. however my Smath Studio 0.99 does not allow me to see the solution



I leave my file already corrected, I added a database to it.



McCabe Thiele - Valentino para Destilacion.sm (455kb) downloaded 25 time(s).
Offline Jean Giraud  
#6 Posted : 22 November 2020 23:50:40(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: Valentino Go to Quoted Post
Friend 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 (105kb) downloaded 15 time(s).
Offline Jean Giraud  
#7 Posted : 23 November 2020 16:24:11(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Hola Valentino,
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 (87kb) downloaded 22 time(s).
Thiele McCabe Short.sm (110kb) downloaded 21 time(s).
Offline Jean Giraud  
#8 Posted : 25 November 2020 17:07:37(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
... this document is complete wrt your demo project.
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 (164kb) downloaded 20 time(s).
Offline Jean Giraud  
#9 Posted : 25 November 2020 20:36:04(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: Jean Giraud Go to Quoted Post
Still 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 (124kb) downloaded 30 time(s).

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.
Offline Valentino  
#10 Posted : 05 December 2020 07:31:04(UTC)
Valentino


Rank: Member

Groups: Registered
Joined: 13/11/2020(UTC)
Posts: 28
Man
Mexico

Was thanked: 7 time(s) in 3 post(s)
Originally Posted by: Jean Giraud Go to Quoted Post
Originally Posted by: Jean Giraud Go to Quoted Post
Still 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 (124kb) downloaded 30 time(s).

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.



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?



SMATH STUDIO 0.99
McCabe Thiele - 700 Compuestos.sm (562kb) downloaded 46 time(s).

.EXE (ZIP)
McCabe Thiele - 700 Compuestos.7z (1,455kb) downloaded 42 time(s).
thanks 1 user thanked Valentino for this useful post.
on 08/12/2020(UTC)
Offline Razonar  
#11 Posted : 08 December 2020 01:55:09(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
Originally Posted by: Valentino Go to Quoted Post
...
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?



SMATH STUDIO 0.99
McCabe Thiele - 700 Compuestos.sm (562kb) downloaded 46 time(s).

.EXE (ZIP)
McCabe Thiele - 700 Compuestos.7z (1,455kb) downloaded 42 time(s).


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.
Offline Jean Giraud  
#12 Posted : 08 December 2020 03:24:22(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
What 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.
Offline Valentino  
#13 Posted : 08 December 2020 05:21:38(UTC)
Valentino


Rank: Member

Groups: Registered
Joined: 13/11/2020(UTC)
Posts: 28
Man
Mexico

Was thanked: 7 time(s) in 3 post(s)
Originally Posted by: Jean Giraud Go to Quoted Post
What 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 Good

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 (419kb) downloaded 23 time(s).

McCabe 700 Document PDF Compounds, resolution in 3 seconds
McCabe Thiele - 700 Compuestos Erick Valentino.pdf (621kb) downloaded 25 time(s).


Antoine's Constants Document PDF
CA.pdf (2,391kb) downloaded 19 time(s).
Offline Jean Giraud  
#14 Posted : 08 December 2020 16:52:36(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: Valentino Go to Quoted Post
Document 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

McCabe4Bug.PNG

Thiele McCabe Companion MERITAS.sm (77kb) downloaded 13 time(s).
Offline overlord  
#15 Posted : 08 December 2020 18:38:14(UTC)
overlord


Rank: Advanced Member

Groups: Registered
Joined: 23/07/2013(UTC)
Posts: 1,125
Turkey

Was thanked: 506 time(s) in 337 post(s)
Jean, 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.

Regards

2020-12-08_15-15.png

2020-12-08_15-14.png

Edited by user 08 December 2020 18:39:51(UTC)  | Reason: Not specified

Offline Jean Giraud  
#16 Posted : 08 December 2020 20:54:03(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: overlord Go to Quoted Post
Jean, 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 !!!

Offline Jean Giraud  
#17 Posted : 09 December 2020 16:47:40(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
... here is the answer.
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.

Thiele Latest SS Bug.PNG
Offline CBG  
#18 Posted : 10 December 2020 22:07:56(UTC)
CBG


Rank: Advanced Member

Groups: Registered
Joined: 14/10/2015(UTC)
Posts: 308

Was thanked: 77 time(s) in 58 post(s)
Changing the subscript zero to 1 in Jean's file resolves the inconsistency, for some unknown reason SS 6139 accepts the value zero in the "for" function.

Best Regards

Carlos

Thiele_7632.png

Thiele McCabe Companion MERITAS_V7632.sm (78kb) downloaded 30 time(s).
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.