Skip to content

Instantly share code, notes, and snippets.

View longemen3000's full-sized avatar

Andrés Riedemann longemen3000

  • Chile
View GitHub Profile
@longemen3000
longemen3000 / doi2bib.jl
Created December 18, 2022 00:57
doi to bibtex, Julia Version
#tested on Julia 1.8.3
using Downloads #stdlib, other versions use HTTP
const DOI2BIB_CACHE = Dict{String,String}()
function doi2bib(doi::String)
if haskey(DOI2BIB_CACHE,doi)
return DOI2BIB_CACHE[doi] #caching requests
end
@longemen3000
longemen3000 / news.md
Created August 19, 2022 15:25
Clapeyron 0.3.8 news

New features

  • bubble_pressure, bubble_temperature, dew_pressure, and dew_temperature can now support custom methods. (subtyping BubblePointMethod or DewPointMethod). the default methods are now named ChemPotBubblePressure, ChemPotBubbleTemperature,ChemPotDewPressure,ChemPotDewTemperature. you can provide some or all necessary initial conditions to those new methods:

    res = bubble_pressure(model,T,x,ChemPotBubblePressure(;y0;p0;vol0))
    
  • New bubble/dew methods based on isofugacity conditions: FugtBubblePressure, FugBubbleTemperature,FugDewPressure,FugtDewTemperature.

  • All bubble methods now support leaving some components out of the bubble phase,via the nonvolatiles keyword, supported by all available bubble solvers. similarly, all dew methods support the noncondensables keyword to leave some components out of the dew phase.

using BenchmarkTools, Random
Random.seed!(123)
BenchmarkTools.DEFAULT_PARAMETERS.time_tolerance = 1.0e-11 # may or may not matter
BenchmarkTools.DEFAULT_PARAMETERS.evals = 1 # important
#==
alternative implementation of square root.
#aproximation of the square root using the float representation as a trick
used in providing an initial value for calculations of square roots.