chemistry

How to Correctly Add Perspective to a Gnuplot 3D connected Point Cloud Representing a Molecule?

醉酒当歌 提交于 2019-12-06 04:42:10
I don't know about you people but I love me some Gnuplot. Properly used, that software produces beautiful images, charming in their simplicity and clarity, that I am very fond of. For no particular reason, one day I caught myself thinking how good would it be if I could create pictures of such cartoonish charm and vibrant clarity to go into my papers and personal scientific journal. So went head first into a batshit project to code a gnuplot-based molecule visualizer. So far it is tailor made for my specific type of molecule. Basically covalently bonded atoms that form ligands, which

Parsing a string that represents a chemical reaction and verify if the reaction is possible

守給你的承諾、 提交于 2019-12-01 06:35:16
I have to write a program that takes a user's chemical equation as an input, like 12 CO2 + 6 H2O -> 2 C6H12O6 + 12 O2, and watch if the amount of Atoms is on both sites the same. Is there any way to calculate and parse this easily? For example: 12 CO2 + 6 H2O -> 2 C6H12O6 + 12 O2 12*2+6*2 -> 2*6+2*12+2*6+12*2 In this case there should be the Output "false". This is my code but it's actually is only to try out something: public static void main(String[] args) { Scanner s = new Scanner(System.in); List<String> list = new ArrayList<String>(); String input = ""; while (!(input.equals("end"))) {

Parsing a string that represents a chemical reaction and verify if the reaction is possible

為{幸葍}努か 提交于 2019-12-01 04:03:31
问题 I have to write a program that takes a user's chemical equation as an input, like 12 CO2 + 6 H2O -> 2 C6H12O6 + 12 O2, and watch if the amount of Atoms is on both sites the same. Is there any way to calculate and parse this easily? For example: 12 CO2 + 6 H2O -> 2 C6H12O6 + 12 O2 12*2+6*2 -> 2*6+2*12+2*6+12*2 In this case there should be the Output "false". This is my code but it's actually is only to try out something: public static void main(String[] args) { Scanner s = new Scanner(System

Parsing a chemical formula

独自空忆成欢 提交于 2019-11-27 12:17:18
问题 I'm trying to write a method for an app that takes a chemical formula like "CH3COOH" and returns some sort of collection full of their symbols. CH3COOH would return [C,H,H,H,C,O,O,H] I already have something that is kinda working, but it's very complicated and uses a lot of code with a lot of nested if-else structures and loops. Is there a way I can do this by using some kind of regular expression with String.split or maybe in some other brilliant simple code? 回答1: Assuming it's correctly