Python Code Runner
Initial Settings:
import math import numpy as np from numpy import exp, log, log10, sin, cos, tan, arcsin, arccos, arctan, arctan2 import sys from io import StringIO buffer = StringIO() sys.stdout = buffer # SI unit definition by CGPM on Nov 18-20, 2014 h = 6.62607015e-34 # Js h_bar = 1.05457203e-34 # Js hbar = h_bar e = 1.602176634e-19 # C kB = 1.380649e-23 # JK-1 NA = 6.02214076e23 # mol-1 c = 2.99792458e8 # m/s pi = 3.14159265358979323846 pi2 = pi + pi torad = 0.01745329251944 # rad/deg todeg = 57.29577951472 # deg/rad basee = 2.71828183 me = 9.1093897e-31 # kg mp = 1.6726231e-27 # kg mn = 1.67495e-27 # kg u0 = 4.0 * 3.14*1e-7; # Ns^2C^-2 e0 = 8.854418782e-12; # C^2/N/m^2 e2_4pie0 = 2.30711e-28 # Nm
2
"; a0 = 5.29177e-11 # m"; R = 8.31451 # J/K/mol"; F = 96485.3 # C/mol"; g = 9.81 # m/s2"; G = 6.67259e-11 #Nm2/kg2 DayToSecond = 60 * 60 * 24 #s SecondToDay = 1.0 / DayToSecond AstronomicalUnit = 1.49597870e11 #m AU = AstronomicalUnit HartreeToeV = 27.2116 # eV"; HTV = HartreeToeV; RyToeV = HartreeToeV / 2.0 KToeV = kB / e eVToK = e / kB JToeV = 1.0 / e eVToJ = e Debye = 3.33564e-30 # Cm, for dipole (D) T0_absolute = 273.15
Python Code:
Eg = 1.0 T = 300 p = exp(-Eg * e / kB / T) print(f"exp(-Eg/kB/T)={p}")
Run Eval
Run Exec
'Run Eval' shows the return value if the python code is a single math expression.
'Run Exec' executes the python code.
Result:
It may take some time to load Python libraries, which could cause an error during the initial run.