Comments (4)
Hi Arni,
I can confirm that the behaviour is as you described.
I do remember that the code is supposed to default to fit [0,0] and the first isotherm point if the fit isn't good enough. I'll look into this, likely before week is over as I am currently in the process of refactoring some code for the next version (expect 1.7/2.0 depending on the number of changes).
By the way, you can load the isotherm directly from the ISODB using an inbuilt function (which actually uses requests
under the hood).
import pygaps
iso_name = "10.1021La803074g.isotherm3b"
iso = pygaps.isotherm_from_isodb(iso_name)
should do the same thing.
Best,
Paul
from pygaps.
Hi Arni,
After a bit of digging, I found the reason for this behaviour.
When a pyGAPS "model" (such as Henry, Langmuir, etc) is fitted, an initial guess is generated for the model parameters based on a langmuir constant and saturation approximation. There was an error in how this initial guess was calculated:
langmuir_k = loading[0] / pressure[0] / (saturation_loading - pressure[0])
Instead of
langmuir_k = loading[0] / pressure[0] / (saturation_loading - loading[0])
With most isotherms this was not a problem as the wrong value was "good enough" for a starting guess. On the other hand, when the isotherm had only one point (not including the [0,0]), the initial guess ended up negative or NaN, which led to minimisation problems.
I've made the above fix in the development branch of the code. The code snippet you provided should now work (provided you have the dev installed). If you have some time, could you check whether it fixes the problem on your end? If not, I suggest you wait until v2.0 is released over the weekend.
Best,
Paul
from pygaps.
Hi Paul,
Sorry for the late response, but your newest version did indeed fix the issue I was having.
Thanks for taking the time to actively continue developing PyGAPS!
Best,
Árni
from pygaps.
Hi Árni,
That's great to hear!
And thank you for the feedback.
Please don't hesitate to let me know if you find any other bugs or inconsistencies.
Best,
Paul
from pygaps.
Related Issues (20)
- ask HOT 2
- Error in IAST calculation with certain models HOT 1
- About liquid phase adsorption HOT 3
- loading unit in cm3(STP) HOT 6
- ASK HOT 2
- Documentation: Modelling in pyGAPS HOT 3
- module 'scipy' has no attribute 'stats' HOT 3
- jensen-seaton models fail for isosteric enthalpy with example data
- Problem while using ads to calculate mesopore psd HOT 5
- Some adsorbate names unrecognised by CoolProp HOT 2
- Access isotherm parameters HOT 3
- Add uncertainty to various calculations that can benefit HOT 1
- account for a measurement of p0 at each point
- identify and convert excess/absolute isotherms HOT 4
- Quantachrome ".txt" files cannot be reliably parsed HOT 11
- carefully address isotherm fraction/percent modes
- A issue in pygaps.modelIsotherms HOT 3
- Issue in Dubinin calculations HOT 7
- Modelling problems after converting units HOT 1
- Add convert functionality for isotherm models
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pygaps.