On 19/02/20 4:52 AM, alberto wrote:
Hi,
I solve it with external file as follows
import preos
# pass name, Tc, Pc, omega
methane = preos.Molecule("methane", -82.59 + 273.15, 45.99, 0.011)
methane.print_params()
thanks to everyone
It is difficult to learn a new programming language, even for
Il giorno martedì 18 febbraio 2020 11:01:11 UTC+1, David ha scritto:
> On Tue, 18 Feb 2020 at 20:45, alberto wrote:
> > Il giorno martedì 18 febbraio 2020 09:34:51 UTC+1, DL Neil ha scritto:
>
> > > > my code preos in one file preos.py
> > > > my commands are
> > > >
> > > > alberto@HENDRIX ~/PRE
On 2/18/20 2:41 AM, alberto wrote:
> Il giorno martedì 18 febbraio 2020 09:34:51 UTC+1, DL Neil ha scritto:
>> The first instruction (immediately above) imports the module preos.py.
>> That works (no error message!).
>>
>> The second instruction refers to a Python class called Molecule. That
>> f
On Tue, 18 Feb 2020 at 20:45, alberto wrote:
> Il giorno martedì 18 febbraio 2020 09:34:51 UTC+1, DL Neil ha scritto:
> > > my code preos in one file preos.py
> > > my commands are
> > >
> > > alberto@HENDRIX ~/PREOS $ python3.5
> > > Python 3.5.2 (default, Oct 8 2019, 13:06:37)
> > > [GCC 5.4.0
Il giorno martedì 18 febbraio 2020 09:34:51 UTC+1, DL Neil ha scritto:
> ...
>
> >> import preos
> >> # pass name, Tc, Pc, omega
> >> methane = preos.Molecule("methane", -82.59 + 273.15, 45.99, 0.011)
> >> methane.print_params()
>
> ...
>
> > my code preos in one file preos.py
> > my commands ar
...
import preos
# pass name, Tc, Pc, omega
methane = preos.Molecule("methane", -82.59 + 273.15, 45.99, 0.011)
methane.print_params()
...
my code preos in one file preos.py
my commands are
alberto@HENDRIX ~/PREOS $ python3.5
Python 3.5.2 (default, Oct 8 2019, 13:06:37)
[GCC 5.4.0 20160609]
Il giorno lunedì 17 febbraio 2020 17:48:07 UTC+1, alberto ha scritto:
> Hi,
> I would use this script to evaluate fugacity coefficient with PENG-ROBINSON
> equation, but I don't understand the correct mode to insert data
>
> import numpy as np
> import matplotlib.pyplot as plt
> from scipy.optim
Please help us to help you!
1 is all of this code in a single file or spread across (at least) two
modules? What are their names? What is the directory structure?
2 copy-paste the actual error message received.
It works for me!
1 not knowing your circumstances, I put all the code in one file
2
Hi,
I would use this script to evaluate fugacity coefficient with PENG-ROBINSON
equation, but I don't understand the correct mode to insert data
import numpy as np
import matplotlib.pyplot as plt
from scipy.optimize import newton
R = 8.314e-5 # universal gas constant, m3-bar/K-mol
class Molecu