Hi all,
I'm modelling the liquid-liquid binary phase diagram for water-butanol. The temperature is input as a loop. The problem I faced is that all the result (x - component composition) for every temperature is exactly the same even though I clear the result (option clear=[variable]) before starting the new temperature calculation. When I excluded the loop from the model and manually change the temperature the result is what I expected.
I attached the loop file (binary05) and no loop file (binary373) where the temperature was input at 373 K.
Any suggestion for the problem?
Looping problem
Looping problem
- Attachments
-
- binary373.gms
- (6.5 KiB) Downloaded 177 times
-
- binary05.gms
- (6.55 KiB) Downloaded 175 times
Re: Looping problem
Hi
Your change in T is reflected in WW, however, you do not initialize it again in the loop, so you should add this line in the loop
Cheers
Renger
Enjoy modeling even more: The lazy eoconomist
Your change in T is reflected in WW, however, you do not initialize it again in the loop, so you should add this line in the loop
Code: Select all
loop(ttt,
...
T=Tnew(ttt);
WW(mk,k) = exp(-((ap(mk,k)/T)+bp(mk,k)+(cp(mk,k)*T)));
....
)
Renger
Enjoy modeling even more: The lazy eoconomist
____________________________________
Enjoy modeling even more: Read my blog on modeling at The lazy economist
Enjoy modeling even more: Read my blog on modeling at The lazy economist