Solute calculator
This is a basic Python program to calculate how much solute is needed to make a particular concentration of a chemical for a given solution.
Enter mass of chemical, volume and concentration required. Program will calculate required solute needed.
#Chemical solute calculator
print("Chemical solute calculator")
print(" ")
print("This program will ask you for some basic data and will then calculate how much solute is needed for a given volume and concentration")
print(" ")
print("1 mol solution is formula weight in 1 liter of water")
print("")
print(" ")
print("Mass is the molecular mass of the chemical solution you're making e.,g Copper Sulfate is 249g")
print(" ")
print("Volume the total solution volume in litres, 100ml is written as 0.100")
print(" ")
print("Concentration required in Mols")
print(" ")
mass = input ("Mass in g: ")
#print("Solute requred")
volume = input("Volume in l: ")
print((volume) + " l")
conc = input ("Required Concentration in M: ")
solute = float(mass) * float(volume) * float(conc)
print("Solute required: ")
print(str(solute) + " g")
print(" ")
print("Note: This program is a guide, and you should double check calculations")
There is a better online solution to this here
Program 2
This is a related ruby program to calculate different molar masses
# molar weight calculator
puts "molecular weight calculator"
puts
print "Enter Weight: "
weight = gets
print ("Weight :");
print (weight)
puts
print ("0.5 Mol: ")
print weight.to_f / 2
puts
print ("2 Mol: ")
print weight.to_i * 2
puts
print ("4 Mol: ")
print weight.to_i * 4
puts
puts
print ("End")
Enter a molecular weight, and it will calculate ½, 2 and 4 moles accordingly. It is not perfect, just works.
Tags
#Science,#Chemistry,#Calculator,#Mole,#Solution,#Solute
Mastodon | Peertube | Join Mastodon |
AI statement : Consent is NOT granted to use the content of this blog for the purposes of AI training or similar activity. Consent CANNOT be assumed, it has to be granted.