GithubHelp home page GithubHelp logo

Comments (9)

andr1976 avatar andr1976 commented on August 18, 2024 1

Ahhh, thanks, that fixed it.

from dwsim.

DanWBR avatar DanWBR commented on August 18, 2024 1

@kookma of course. I've tried a lot of things but this was the only one which worked. Must be an issue with Python.NET that even they aren't aware of. I'll keep trying, I don't like this solution too.

from dwsim.

DanWBR avatar DanWBR commented on August 18, 2024

Fixed in DTL v6.3.7617. You must copy the two IPOPT files to Windows\System32, at least for now. The definitive fix for DWSIM will be in v6.3 Update 4. 44dbfda and e3598d1

from dwsim.

andr1976 avatar andr1976 commented on August 18, 2024

Somehow the total molecular weight is reported both for vapour and liquid1, however for liquid2 ther correct molecular weight is reported (around 18)

For the above composition I get an all liquid1 phase - in DWSIM it is on the other hand an all vapour phase. Changing molefracs to:

carray = Array[String](["Water", "Methane", "Propane", "Isobutane", "N-butane", "N-decane"])
comparray = Array[Double]([0.1, 0.3, 0.1, 0.1, 0.1, 0.3])

Gives expected results.

IPOPT spits out a lot of information from the solver/optmizer:

C:\Users\ANRA\OneDrive - Ramboll\Documents\DWSIM Application Data\PythonDTL>C:\Python27-x64\python.exe -i dtl_test2.py
DTL version: 6.3.7617.40244
()
Calculating Material Stream Phase Equilibria and Properties at T = 367.15 K and P = 2533125.0 Pa

******************************************************************************
This program contains Ipopt, a library for large-scale nonlinear optimization.
 Ipopt is released as open source code under the Eclipse Public License (EPL).
         For more information visit http://projects.coin-or.org/Ipopt
******************************************************************************

NOTE: You are using Ipopt by default with the MUMPS linear solver.
      Other linear solvers might be more efficient (see Ipopt documentation).


This is Ipopt version 3.9.2, running with linear solver mumps.

Number of nonzeros in equality constraint Jacobian...:        0
Number of nonzeros in inequality constraint Jacobian.:        0
Number of nonzeros in Lagrangian Hessian.............:        0

Total number of variables............................:        6
                     variables with only lower bounds:        0
                variables with lower and upper bounds:        6
                     variables with only upper bounds:        0
Total number of equality constraints.................:        0
Total number of inequality constraints...............:        0
        inequality constraints with only lower bounds:        0
   inequality constraints with lower and upper bounds:        0
        inequality constraints with only upper bounds:        0

iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls
   0 -2.9839094e+000 0.00e+000 2.23e+000   0.0 0.00e+000    -  0.00e+000 0.00e+000   0
   1 -2.6735167e+000 0.00e+000 5.92e+000  -0.8 1.49e-001    -  1.00e+000 6.57e-001f  1
   2 -2.8364782e+000 0.00e+000 1.42e+000  -1.0 3.42e-002    -  1.00e+000 1.00e+000f  1
   3 -2.8613308e+000 0.00e+000 1.13e+000  -1.0 1.61e-002    -  1.00e+000 1.00e+000f  1
   4 -2.8672517e+000 0.00e+000 2.96e-001  -1.0 2.38e-002    -  1.00e+000 1.00e+000f  1
   5 -2.8688481e+000 0.00e+000 1.65e-002  -1.7 1.10e-002    -  1.00e+000 1.00e+000f  1
   6 -2.8692698e+000 0.00e+000 3.23e-002  -2.5 7.69e-003    -  1.00e+000 1.00e+000f  1
   7 -2.8692733e+000 0.00e+000 3.02e-002  -2.5 2.07e-003    -  1.00e+000 5.00e-001f  2
   8 -2.8692868e+000 0.00e+000 2.25e-003  -2.5 6.96e-004    -  1.00e+000 1.00e+000f  1
   9 -2.8692869e+000 0.00e+000 3.75e-004  -3.8 5.22e-005    -  1.00e+000 1.00e+000f  1
iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls
  10 -2.8692869e+000 0.00e+000 2.89e-004  -5.0 1.79e-005    -  1.00e+000 1.00e+000f  1
  11 -2.8692869e+000 0.00e+000 1.68e-005  -5.0 8.08e-006    -  1.00e+000 1.00e+000f  1

Number of Iterations....: 11

                                   (scaled)                 (unscaled)
Objective...............: -2.8692868621773120e+000  -2.8692868621773120e+000
Dual infeasibility......:  1.6799709717511146e-005   1.6799709717511146e-005
Constraint violation....:  0.0000000000000000e+000   0.0000000000000000e+000
Complementarity.........:  9.0909102076914863e-006   9.0909102076914863e-006
Overall NLP error.......:  1.6799709717511146e-005   1.6799709717511146e-005


Number of objective function evaluations             = 17
Number of objective gradient evaluations             = 12
Number of equality constraint evaluations            = 0
Number of inequality constraint evaluations          = 0
Number of equality constraint Jacobian evaluations   = 0
Number of inequality constraint Jacobian evaluations = 0
Number of Lagrangian Hessian evaluations             = 0
Total CPU secs in IPOPT (w/o function evaluations)   =      0.062
Total CPU secs in NLP function evaluations           =      0.019

EXIT: Optimal Solution Found.
This is Ipopt version 3.9.2, running with linear solver mumps.

Number of nonzeros in equality constraint Jacobian...:        0
Number of nonzeros in inequality constraint Jacobian.:       12
Number of nonzeros in Lagrangian Hessian.............:        0

Total number of variables............................:       12
                     variables with only lower bounds:        0
                variables with lower and upper bounds:       12
                     variables with only upper bounds:        0
Total number of equality constraints.................:        0
Total number of inequality constraints...............:        6
        inequality constraints with only lower bounds:        0
   inequality constraints with lower and upper bounds:        6
        inequality constraints with only upper bounds:        0

iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls
   0 -2.8209745e+003 0.00e+000 1.59e+001   0.0 0.00e+000    -  0.00e+000 0.00e+000   0
   1 -2.7145260e+003 1.42e-014 6.71e+000   0.8 1.22e+001    -  4.36e-001 1.00e+000f  1
   2 -2.7790849e+003 1.42e-014 1.81e+001   2.0 2.81e+001    -  1.00e+000 1.00e+000f  1
   3 -2.7934466e+003 5.68e-014 1.69e+000   1.3 6.35e+000    -  9.03e-001 1.00e+000f  1
   4 -2.8606516e+003 2.84e-014 4.07e-001   0.6 4.42e+001    -  6.06e-001 1.00e+000f  1
   5 -2.8687549e+003 2.84e-014 1.63e-001  -1.0 1.92e+001    -  7.74e-001 1.00e+000f  1
   6 -2.8691123e+003 2.84e-014 8.25e-002  -5.5 7.11e+000    -  8.85e-001 1.00e+000f  1
   7 -2.8691683e+003 2.84e-014 4.76e-002  -6.5 5.81e+000    -  7.78e-001 2.50e-001f  3
   8 -2.8692545e+003 2.84e-014 1.41e-002  -7.1 1.05e+000    -  9.32e-001 1.00e+000f  1
   9 -2.8692762e+003 2.84e-014 8.17e-003  -3.8 9.29e-001    -  9.86e-001 1.00e+000f  1
iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls
  10 -2.8692815e+003 1.42e-014 9.12e-003  -4.8 2.04e+000    -  1.00e+000 2.50e-001f  3
  11 -2.8692867e+003 2.84e-014 1.68e-003  -6.5 6.94e-001    -  1.00e+000 1.00e+000f  1
  12 -2.8692867e+003 2.84e-014 1.92e-003  -8.4 1.55e-001    -  1.00e+000 5.00e-001f  2
  13 -2.8692869e+003 2.84e-014 2.25e-004 -10.4 4.07e-002    -  1.00e+000 1.00e+000f  1
  14 -2.8692869e+003 1.42e-014 1.18e-004 -11.0 1.42e-002    -  1.00e+000 1.00e+000f  1
  15 -2.8692869e+003 2.84e-014 1.30e-004 -11.0 1.91e-002    -  1.00e+000 1.00e+000f  1
  16 -2.8692869e+003 1.42e-014 1.24e-004 -11.0 5.89e-003    -  1.00e+000 1.00e+000f  1
  17 -2.8692869e+003 5.68e-014 1.73e-005 -11.0 2.76e-003    -  1.00e+000 1.00e+000f  1

Number of Iterations....: 17

                                   (scaled)                 (unscaled)
Objective...............: -2.8692868621693560e+003  -2.8692868621693560e+003
Dual infeasibility......:  1.7278241574293314e-005   1.7278241574293314e-005
Constraint violation....:  0.0000000000000000e+000   0.0000000000000000e+000
Complementarity.........:  9.9999999999999978e-012   9.9999999999999978e-012
Overall NLP error.......:  1.7278241574293314e-005   1.7278241574293314e-005


Number of objective function evaluations             = 27
Number of objective gradient evaluations             = 18
Number of equality constraint evaluations            = 0
Number of inequality constraint evaluations          = 27
Number of equality constraint Jacobian evaluations   = 0
Number of inequality constraint Jacobian evaluations = 18
Number of Lagrangian Hessian evaluations             = 0
Total CPU secs in IPOPT (w/o function evaluations)   =      0.051
Total CPU secs in NLP function evaluations           =      0.009

EXIT: Optimal Solution Found.
Vapor Phase Density: None kg/m3
Vapour molecular weight: 65.332778 kg/kmole
Liquid1 Phase Density: 758.966954943 kg/m3
Liquid1 molecular weight: 65.332778 kg/kmole
Liquid 2 Phase Density: None kg/m3
Liquid2 molecular weight: None kg/kmole
Water Overall Molar Flow: 0.1 mol/s
Methane Overall Molar Flow: 0.3 mol/s
Propane Overall Molar Flow: 0.1 mol/s
Isobutane Overall Molar Flow: 0.1 mol/s
N-butane Overall Molar Flow: 0.1 mol/s
N-decane Overall Molar Flow: 0.3 mol/s
Vapor Phase Molar Flow: None mol/s
Liquid Phase Molar Flow: 1.0 mol/s
Liquid Phase Molar Flow: None mol/s
>>>

from dwsim.

DanWBR avatar DanWBR commented on August 18, 2024

"Vapour" and "Liquid 1" are not recognized by DWSIM, you must use "Vapor" and "Liquid1" as per CAPE-OPEN standards.

from dwsim.

kookma avatar kookma commented on August 18, 2024

Fixed in DTL v6.3.7617. You must copy the two IPOPT files to Windows\System32, at least for now. The definitive fix for DWSIM will be in v6.3 Update 4. 44dbfda and e3598d1

Daniel! I may recommend to keep all those files in DWSIM or related folder. In a company, most of the time you have not access to system32 on your work computer.

from dwsim.

andr1976 avatar andr1976 commented on August 18, 2024

@DanWBR, so this is not happening from VB?

from dwsim.

DanWBR avatar DanWBR commented on August 18, 2024

@andr1976 no because if you run DWSIM from the automation library or from the GUI itself, it does locate IPOPT correctly since it is in the same folder. Only when running through Python.NET it doesn't locate it, even if you explicitly set the current directory or the directory to search for.

from dwsim.

DanWBR avatar DanWBR commented on August 18, 2024

11459b8

from dwsim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.