This file contains 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
def format_compound(formula): | |
f_formula = "" | |
for part in formula.split("."): | |
for i in range(0, len(part)): | |
if i + 1 < len(part): | |
if part[i].isalpha() and (part[i + 1].isupper() or part[i + 1] in ["(", "[", ")", "]"]): | |
f_formula += part[i] + "1" | |
elif part[i] in [")", "]"] and part[i + 1].isalpha(): | |
f_formula += part[i] + "1" | |
else: |
This file contains 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 sympy import * | |
init_printing(use_unicode=True) | |
import math | |
import re | |
# H3PO4 + (NH4)2MoO4 + HNO3 + H2O-> (NH4)3PO4.12MoO3 + NH4NO3 | |
def subscript(s): # Function to convert number to subscript. 8320 is the ascii of subscript 0 | |
i = 0 | |
while i < len(s): |
This file contains 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 <Servo.h> | |
//---------------------------------------------------speed declaration----------------------------------------------------------- | |
int P, D, I; | |
float error, previousError; | |
int lsp, rsp; | |
int lfspeed = 160;//<<<<<<<<<<<<<<<<<---------Change speed here<<<<<<<<<<<<<<<<<<<<<<< | |
int minspeed = 0 ; | |
int maxspeed = 255; |
This file contains 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 <Servo.h> | |
//---------------------------------------------------speed declaration----------------------------------------------------------- | |
int P, D, I; | |
float error, previousError; | |
int lsp, rsp; | |
int lfspeed = 160;//<<<<<<<<<<<<<<<<<---------Change speed here<<<<<<<<<<<<<<<<<<<<<<< | |
int minspeed = 0 ; | |
int maxspeed = 255; |