phetsims / build-a-molecule

"Build a Molecule" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
8 stars 7 forks source link

Unsure if bonding should be possible #198

Closed KatieWoe closed 4 years ago

KatieWoe commented 4 years ago

For https://github.com/phetsims/QA/issues/506. There are instances where you are able to bond a hydrogen to something, but other atoms that you would expect to be able to make the same bond (such as fluorine and chlorine) may not be able to. This does not seem to have anything to do with the order of adding atoms, so I don't think it is connected to https://github.com/phetsims/build-a-molecule/issues/148. It also does not seem to be a size issue, since rearranging atoms elsewhere in the molecule will let two large atoms sit next to each other. It also seems to be the case in the Java version. Molecular construction was never my strong suit, so I could very easily be missing something. Feel free to close if that is the case. Examples collected on 3rd scene in 3rd screen, when adding fluorine and chlorine to 4 carbons. cantaddchlorine forinstance am

KatieWoe commented 4 years ago

Clarification, I've seen this in a large number of instances, the above is just one example.

arouinfar commented 4 years ago

@Denz1994 I think this is another permutation of #148.

There seems to be some order-dependence for how atoms are added to the molecule. My initial thought was that the repulsion might be related to the atomic radii, but that doesn't seem to be the case, since I can build structures like this: image

Looking at OtherMoleculesData.js, I see hundreds of molecules containing multiple chlorine and fluorine atoms, so I don't think we're necessarily building unnamed structures. Even if they are unnamed, I would think they should be legal so long as we don't break basic bond order rules (C can bond to 4 things max, H can only bond to 1 thing, etc.)

@Denz1994 can you investigate?

Denz1994 commented 4 years ago

TLDR: We don't have a molecule in our data set that uses C4Cl3F4 as a sub-component, so it is considered an invalid molecule.

If this was order-dependent as described in #148, then there should be a build order that will produce the initial molecule posted by @KatieWoe (with Chlorine in place of the Hydrogen). I've tried numerous amounts of permutations and can't build that molecule attempted in the original post. So for that reason, I'll agree with @KatieWoe that this isn't order-dependent.

The fact that this can't be built in the java version, tells me that this has something to do with the actual data of the attempted molecule.

The molecule that @KatieWoe was attempting to complete was C4Cl3F4. For starters, PubChem doesn't have an entry for that molecule, but let's assume we were attempting to build C4H3Cl3F4. This would be the next possible molecule with 3 Chlorines and the 3 Hydrogens filled out on the remaining leftmost Carbons.

Despite C4H3Cl3F4 being a valid entry on PubChem, we don't have C4H3Cl3F4 as an entry in otherMoleculeData.js. If you search in this file for fluorobutane (the CF3 sub-molecule on the right of our attempted molecule) or Trichloro (the 3 Chlorines in our attempted molecule) all our search results don't have the quantity or elements needed for C4H3Cl3F4. One of our filters in the legacy version must have dropped C4H3Cl3F4 from the data set, for reasons I'm not sure of.

Edit: Bonding the hydrogen works in the original post because it creates C4H1Cl2F4, which is a sub-molecule of 2,4-dichloro-1,1,1,2-tetrafluoro-butane|C4H4Cl2F4 found in OtherMoleculesData.js.

Denz1994 commented 4 years ago

Okay, more digging with a minor revision...

We do have C4H3Cl3F4 entries in our data:

However, it isn't just the molecule elements we are building, it is the position we are bonding the atoms. So in the original post, the atoms are just built in the incorrect arrangement.

I'm not too familiar with the comma separation in IUPAC nomenclature. I'm aware it indicates the position or arrangement of parts of the molecule, but I'm not sure if @KatieWoe was building a valid molecule based on the 3 entries above. If that is the case @arouinfar, I don't think there is anything to do for this issue and we can close.

Denz1994 commented 4 years ago

A bit more, more digging...

We can build all of the 3 entries related to C4H3Cl3F4 if we follow the IUPAC nomenclature.

image

image

image

Thanks, khan academy for refreshing me on organic chemistry :)

Denz1994 commented 4 years ago

In summary, the arrangements of the atoms were incorrect @KatieWoe. I'll leave to @arouinfar to close this one.

arouinfar commented 4 years ago

Thanks for digging into this @Denz1994. I am fine with closing, but I would like a bit more clarification for the Teacher Tips.

I didn't realize that molecules had to be named in the database for their connections to be legal. Does that only occur for the kits on the Playground?

For example, I can build this, despite it not being a real molecule: image

Can you provide some clarification about why the above is legal, but the structures @KatieWoe built in https://github.com/phetsims/build-a-molecule/issues/198#issue-637922708 were not?

Denz1994 commented 4 years ago

Sure. Your example is legal because it can be used to build hydroperoxy(methy)ldiazene, which is an entry in our data set. image

The molecule @KatieWoe was trying to build is illegal because it doesn't build into any entry molecule in our data set. image To fix this @KatieWoe would take the left-most Florine in her example and bond it to the left-most Carbon and take the rightmost Chlorine and bond it to the left-most Carbon. Then the Chlorine she was attempting to bond would work just fine because now she is building towards this molecule: image

This occurs on all screens as well.

Denz1994 commented 4 years ago

Back to @arouinfar to close.

arouinfar commented 4 years ago

Thanks for that explanation @Denz1994! That makes sense to me. I've tagged this issue for the Teacher Tips, so we can go ahead and close it.