Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from numpy import linspace,array,outer,sqrt,cos,pi | |
from matplotlib import pyplot as plt | |
from seaborn import color_palette | |
n=15 | |
L=array([0.625+0.05/2*j for j in range(n)]) # m | |
omega=sqrt(9.81/L) # 1/s | |
n_range=[10,20,30,40,50,60,70,80,90,100,110,120,130,140,150,160] | |
fig,ax_list=plt.subplots(len(n_range),1,figsize=(15,10),constrained_layout=True) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# first: mkdir user && cd user && cp /path/to/get_gists.py . | |
# python3 get_gists.py user | |
# ref. selimslab/get_gists.py: [email protected]:958e2255a105f9a3f4b421896bce715d.git | |
# ref. change_file_date_to_name_date.py: https://gist.github.com/santiago-salas-v/7f001a8d80534ebf9ec5104d409420bf | |
import sys | |
from os import walk,utime,listdir | |
from os.path import abspath,sep | |
from subprocess import call,getoutput | |
import json | |
from datetime import datetime |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8" ?> | |
<!-- ==========================================================================\ | |
| | |
| To learn how to make your own language parser, please check the following | |
| link: | |
| https://npp-user-manual.org/docs/function-list/ | |
| | |
\=========================================================================== --> | |
<NotepadPlus> | |
<functionList> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> // for cin, cout | |
#include <cmath> // for log, exp, pow | |
#include <stdio.h> // for printf | |
#include "timeit.h" | |
using namespace std; // std::cout ,... | |
float pow1(float base, float exponent){ // method 1 through direct multiplication | |
float result=1; | |
for(int i=1;i<=exponent;i++)result*=base; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from numpy import float,array,arange,ones,mean,linspace,linalg | |
from matplotlib import pyplot as plt | |
# source data: Poling, B. E., Prausnitz, J. M., & O'connell, J. P. (2001). The properties of gases and liquids (Vol. 5). New York: Mcgraw-hill. | |
data_source="""z_i;cas_no;phase;formula;formula_name_structure;ant_name;poling_no;poling_formula;poling_name;poling_molwt [g/mol] ;poling_tfp [K] ;poling_tb [K] ;poling_tc [K] ;poling_pc [bar] ;poling_vc [cm3/mol] ;poling_zc;poling_omega;poling_delhf0 [kJ/mol] ;poling_delgf0 [kJ/mol] ;poling_delhb [kJ/mol] ;poling_delhm [kJ/mol] ;poling_v_liq [cm3/mol] ;poling_t_liq [K] ;poling_dipole [Debye] ;p_ant_a;p_ant_b [K] ;p_ant_c [K] ;p_ant_tmin [K] ;p_ant_tmax [K] ;p_ant_pvpmin [bar] ;p_ant_pvpmax [bar] ;eant_to [K] ;eant_n;eant_e;eant_f;eant_tmin [K] ;eant_tmax [K] ;eant_pvpmin [bar] ;eant_pvpmax [bar] ;wagn_a;wagn_b;wagn_c;wagn_d;wagn_tmin [K] ;wagn_tmax [K] ;wagn_pvpmin [bar] ;wagn_pvpmax [bar] ;range_tmin_to_1000 [K] ;range_1000_to_tmax [K] ;molecular_weight [g/mol] ;hf29 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
from numpy import array, ones, log, exp, concatenate, linspace, mean, sqrt | |
from numpy.linalg import inv | |
eta=array([float(x) for x in '50 100 150 200 250'.split(' ')]) # mV | |
i=array([float(x) for x in '8.8 25.0 58.0 131 298'.split(' ')]) # mA | |
j=i/2 # mA/cm^2 | |
ln_j=log(j) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
a="""Stream 1 2 19 13 20 21 unit | |
molar phaseFraction [Vapor] 0.78573872 1 0.84155574 N/A 1 N/A | |
molar phaseFraction [Liquid] 0.21426128 0 0.15844426 1 0 1 | |
Vapor mole fraction [Methane] 0.0065941603 0.0065941603 0.0076360162 N/A 0.0076360162 N/A | |
Vapor mole fraction [Ethane] 0.00051999558 0.00051999558 0.00051098128 N/A 0.00051098128 N/A | |
Vapor mole fraction [Propane] 0.00069927477 0.00069927477 0.00045905695 N/A 0.00045905695 N/A | |
Vapor mole fraction [N-butane] 0.010953157 0.010953157 0.0032409075 N/A 0.0032409075 N/A | |
Vapor mole fraction [N-pentane] 0.018269691 0.018269691 0.0016300124 N/A 0.0016300124 N/A |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fid = fopen('webplotdigitizer_output.csv'); | |
output = textscan(fid,'%s %s', 'Delimiter', ';'); | |
fclose(fid); | |
x = arrayfun(@(x) str2double(replace(x, ',', '.')), output{1}); | |
y = arrayfun(@(x) str2double(replace(x, ',', '.')), output{2}); | |
plot(x, y); |
NewerOlder