Molecular Bonding Language

Page 3 of 4 Previous  1, 2, 3, 4  Next

Go down

Re: Molecular Bonding Language

Post by Jared Magneson on Sat May 26, 2018 1:22 am

Jesus, this is some amazing and very rapid progress! Pretty incredible stuff here, Nevyn. I'm digging in a bit and it's a lot of fun, as well as looking really cool. And a very interesting way to visualize molecular structures!

Jared Magneson

Posts : 444
Join date : 2016-10-11

View user profile

Back to top Go down

Re: Molecular Bonding Language

Post by Nevyn on Sat May 26, 2018 4:37 am

Thanks guys. When I'm on a roll, it just feels like the app falls together. New features just seem to fit right in. By creating a language, parser and renderer, it has allowed me to separate different aspects cleanly. Before this, I had always thought in terms of a builder. Allowing the user to add pieces and place them but that would take a lot of work, both for me to create the app and for the user to do anything with it. A language is extremely easy to use and change and play with.

If you go over old posts here, you'll see that Cr6 has been wanting something like this for years but I just wasn't seeing it. It didn't resonate with me until the recent posts on super-conductors and I'm so glad it finally did. I guess this was just the right time for it to come together. I had some pieces and just needed to plug them into a new engine.

I've been keeping AtomicViewer up-to-date with the changes I make for MBL and have even spent some time going over some nuclear models again, which is long overdue. Seriously, they need a lot of work. Feel free to criticize any of them. If you are building molecules and find an atom isn't working for you, then it may mean that the atom is incorrect. Especially with the large atoms. A good way to test the nuclear model of an atom is to see how it works in known molecules. MBL makes that so much easier!

How awesome does that carbon nano-tube look above? Go and create one now! Play with it. Spin it around. Move through it. And take pictures. I wanna see em. Bring out your inner-photographer and capture the beauty of these wonderful structures.
avatar
Nevyn
Admin

Posts : 1399
Join date : 2014-09-11

View user profile http://www.nevyns-lab.com

Back to top Go down

Re: Molecular Bonding Language

Post by Jared Magneson on Sat May 26, 2018 2:43 pm

It actually works really smoothly on my simple A8 (quad-core) TV-PC, with just a GTX-750Ti for the graphics. It's about a $50 graphics chip now, the only one I have small enough for this home theater case, but I'm gonna try it on my 'Dozer with a GTX-980 when I get some time, and push it much harder!

I just don't know enough about molecular structures to come up with anything too cool or realistic, so I'm just lobbing atoms out there to see how they look. Smile

Here's my stab at some Germanium-Silicon nonsense, just based on your carbon nanotube description:


MBL: tube 6 n:(C{Ge,C,Si}C)6

And in Line form:

Jared Magneson

Posts : 444
Join date : 2016-10-11

View user profile

Back to top Go down

Re: Molecular Bonding Language

Post by LongtimeAirman on Sat May 26, 2018 4:58 pm

.

Nevyn. Congratulations, this is great. Honest to gosh, I got playground flashbacks. Like I was playing on the large metal climbing structure at the playground when I was six.

Back to the present, I make word doc copies of all new posts before I read them. When I highlighted, copied and switched to the browser in order to paste the MBL tag - tube 6 n:(C{C,C}C)10 , I bombed Word and my system. I realized the tag was a link that wouldn’t allow the word doc to reload properly. No problem, the second time I replaced each C with Si to create an image as you requested. I selected the “middle” choice for image sizes; the downloaded image is 3.4M - too large to share - so I screen dumped it at reduced magnification to a more manageable 850K png file.

I didn’t look at MBL too critically. For example, Language Specification needs examples and images. I’ll stop there. I don’t feel qualified to make a critical review just yet; that is, if you want one. 

How about you Cr6? You’ve got a good handle on it. Care to make any critical remarks or suggestions?
.

LongtimeAirman
Admin

Posts : 1080
Join date : 2014-08-10

View user profile

Back to top Go down

Re: Molecular Bonding Language

Post by Nevyn on Sat May 26, 2018 6:00 pm

That's cool, Airman, just create stuff that looks good. No need to worry about being correct at this point. There's plenty of time for us to work on actual molecules.

Your imagery of playground equipment has given me a new idea for a Chain Command called 'mirror' that will take a defined chain and create a mirrored version next to it. You made me think about Monkey Bars (do you call them that in the states?) where you swing from bar to bar (no, not from pub to pub, that's the adult version  Very Happy ).

I use 720 for my screenshots. The others are too large but great if you want to study them as you can zoom in really far without losing quality. Even the 720 images are a bit too big (pixel wise) for a forum post which seem to prefer images about 800 pixels wide (the 720 refers to the Y axis, not the X). I might add a 480 res.

Reviews and criticism are always welcome. Images are indeed coming for the specification.
avatar
Nevyn
Admin

Posts : 1399
Join date : 2014-09-11

View user profile http://www.nevyns-lab.com

Back to top Go down

Re: Molecular Bonding Language

Post by Jared Magneson on Sat May 26, 2018 6:23 pm

I think it's great that you included a render-to-file option! The 1080 size is fine resolution-wise, it's just an uncompressed .png so it's a much bigger file than it could be. I just convert to .jpg locally and upload them to Imgur or whatever anyway, all my tools are Shell extensions in Windows so it's pretty seamless, but most people won't have them tools handy. Damnit, I'm starting to write with a Southern "accent" even though I've never had one! Too much Twilight Zone lately.

I don't know how easy it would be for you to outpout straight to .jpg, but if that's an option most people might prefer it. Or compressed .png. I get why you chose the one you did though; it's a much cleaner file, with less artifacting.

Jared Magneson

Posts : 444
Join date : 2016-10-11

View user profile

Back to top Go down

Re: Molecular Bonding Language

Post by LongtimeAirman on Sat May 26, 2018 7:08 pm

.
I usually use screen dumps; however I very much appreciate having the rendering download options - much better quality, bigger than my screen. I usually go with png's because this site doesn't allow me to post large jpg files.

I enjoyed the Outer Limits episode.

Excuse the blast from the past. They don't exactly fit well with your beautiful molecule images. Both are taken from When Playgrounds Were Deadly https://flashbak.com/when-playgrounds-were-deadly-35924/

We had something similar to 6 of these moon climbers side by side, forming a half cylinder, that’s what we called “the monkey bars”.

We also had what’s pictured below, pretty much a standard playground appliance in NYC. If I recall correctly, the surface the was some sort of tar.
.

LongtimeAirman
Admin

Posts : 1080
Join date : 2014-08-10

View user profile

Back to top Go down

Re: Molecular Bonding Language

Post by Nevyn on Sat May 26, 2018 9:43 pm

I have added the ability to choose between PNG and JPEG. If you use JPEG then you can also set the quality which will make the files a lot smaller/larger. The default is a good trade-off even though it looks like it is too far to the right. You can also set the name of the file, the extension is set based on the selected format.



Note: That is not actually the default value in the above image. That is full quality and the default is 2 steps down from that.
avatar
Nevyn
Admin

Posts : 1399
Join date : 2014-09-11

View user profile http://www.nevyns-lab.com

Back to top Go down

Re: Molecular Bonding Language

Post by Cr6 on Sun May 27, 2018 1:21 am

Nice and so very cool Nevyn!  It is really fun to use! Razz

The only thing I could ask for at this point would be an ability (radio button) to show an exploded version of the MBL language when a Chem notation was typed in... something like:
CdNbBa9Cu10O20 --> Cd-Nb-(Ba)9-(Cu)10-(O)20  or all exploded into a long "....-O-O" type line of single atoms?  Not entirely necessary but it might allow more direct editing in the MBL language?



It looks AWESOME and like LTAM has suggested previously....  Arrow  I'm on the Playground!

Cr6
Admin

Posts : 1099
Join date : 2014-08-09

View user profile http://milesmathis.forumotion.com

Back to top Go down

Re: Molecular Bonding Language

Post by Nevyn on Sun May 27, 2018 2:27 am

Yeah, I've been wondering if you needed that kind of conversion or not. I allowed chem notation in the language and then thought that you might have wanted the converted expression rather than being able to get it into the MBL parser and renderer.

I'll come up with something.
avatar
Nevyn
Admin

Posts : 1399
Join date : 2014-09-11

View user profile http://www.nevyns-lab.com

Back to top Go down

Re: Molecular Bonding Language

Post by Jared Magneson on Sun May 27, 2018 2:43 am

You sure work fast! Just saw the new output options in practice, and was on my way here to chime in again.

I was reading this article on Solar energy breakthroughs:
https://www.sciencedaily.com/releases/2018/05/180524141611.htm

And they mentioned:
Now, such efforts have taken a surprising turn, with the discovery of a new photocatalytic material called a pyrochlore[2] oxyfluoride (Pb2Ti2O5.4F1.2).

So I thought I'd try that structure out in MBL. I'm just guessing at how it would fit together here, but it sure is cool to visualize it so rapidly:



MBL:
Pb-Ti[O,O,O,O]Ti-F-Pb

I'm sure my assembly is WAY off, but it looks cool and is definitely an amazing study tool!

Jared Magneson

Posts : 444
Join date : 2016-10-11

View user profile

Back to top Go down

Re: Molecular Bonding Language

Post by Nevyn on Sun May 27, 2018 5:31 am

Language Update

Nuclear Sheets


I have added a new Chain Command that will create a sheet from a basic chain without using a multiplication group. This is more convenient when trying to find something that works but the multiplication version is better for converting to and from a tube. The definitions remain the same and only the chain command changes between line and tube but a sheet requires restructuring the expression.

sheet breadth height direction:chain

MBL: sheet:C{C,C}C
URL: https://www.nevyns-lab.com/mathis/app/mbl/mbl.html?mbl=sheet:C{C,C}C&align=X&atom=nucleus

MBL: sheet 5:C{C,C}C
MBL: sheet 5 8:C{C,C}C
MBL: sheet 5 8 e:C{C,C}C
avatar
Nevyn
Admin

Posts : 1399
Join date : 2014-09-11

View user profile http://www.nevyns-lab.com

Back to top Go down

Re: Molecular Bonding Language

Post by Nevyn on Sat Jun 02, 2018 9:42 pm

UI Update

Labels


You can now specify a label to be rendered onto the image when you use the capture functionality. There is a button to copy the MBL into the label field and some positioning controls. The text is rendered at a consistent size even when using different resolutions. However, it will not change the size of the text even if it won't fit on the image. It will be drawn as a single line and will not split.



avatar
Nevyn
Admin

Posts : 1399
Join date : 2014-09-11

View user profile http://www.nevyns-lab.com

Back to top Go down

Re: Molecular Bonding Language

Post by Nevyn on Sat Jun 02, 2018 10:23 pm

Chemical Formula Conversion


I have added a new button to convert a chemical formula to an MBL expression. It will only convert it if it does not contain any MBL delimiters, except for ( and ) which apply to both formats.
avatar
Nevyn
Admin

Posts : 1399
Join date : 2014-09-11

View user profile http://www.nevyns-lab.com

Back to top Go down

Re: Molecular Bonding Language

Post by Cr6 on Mon Jun 04, 2018 12:59 am

Nice!!! Thanks a bunch Nevyn...this makes it a whole lot easier to play with!

Cr6
Admin

Posts : 1099
Join date : 2014-08-09

View user profile http://milesmathis.forumotion.com

Back to top Go down

Re: Molecular Bonding Language

Post by Nevyn on Sun Jun 10, 2018 7:53 pm

Language Update

Chain Arrays


I have introduced a new concept into MBL to support declaring an array of chains. It is just a list of individual chains that can then be interpreted into something else by a Chain Command. To define a chain array, you use the '<' and '>' characters to surround a comma separated list of chains.

Example: <C,O-O,Fe[H,H]>

That would create an array with 3 items: C, O-O and Fe[H,H]. It would also generate an error if you tried to use it like that directly. We need a Chain Command that understands how to use an array.

Fans


You can use 3 new Chain Commands that require a Chain Array as input. Two of them are needed, the other not so much but it was easy once I had the others working.

Fan In


The fanIn command can be used to make all items in the list, except the last one, arrange themselves into a fan focused onto the last item in the array.

MBL: fanIn:<Cl,Cl,Na-Cl>
URL: https://www.nevyns-lab.com/mathis/app/mbl/mbl.html?mbl=fanIn:%3CCl,Cl,Na-Cl%3E&align=X&atom=nucleus



You can have as many items as you want, but they will get squashed up together. They are all evenly spaced apart with an angle equal to 180 divided by the number of items in the fan plus 1. That stops the outside chains from being placed vertically and will always have some angle away from the last chain.

Fan Out


Conversely, you can have the chains fan out from the first item in the array by using the fanOut command.

MBL: fanOut:<Na-Cl,!Cl,!Cl>
URL: https://www.nevyns-lab.com/mathis/app/mbl/mbl.html?mbl=fanOut:%3CNa-Cl,!Cl,!Cl%3E&align=X&atom=nucleus



You can even mix the 2 together like this:

MBL: fanIn:<Cl,Cl,fanOut:<Na-Cl,!Cl,!Cl>>
URL: https://www.nevyns-lab.com/mathis/app/mbl/mbl.html?mbl=fanIn:%3CCl,Cl,fanOut:%3CNa-Cl,!Cl,!Cl%3E%3E&align=X&atom=nucleus



Fan


While not useful for molecules, you can create pretty pictures using the fan command. This will just take all items in the array and arrange them in a circle.

MBL: fan:<(C{H,H}C,)4,C{H,H}C>
URL: https://www.nevyns-lab.com/mathis/app/mbl/mbl.html?mbl=fan:%3C(C{H,H}C,)4,C{H,H}C%3E&align=X&atom=nucleus



Uses for Fans


I needed to include these commands to support some of the structures that Miles has shown, such as NaCl3. It also means that we can model molecules like CH4 (Methane), but to do that you will need to break the Carbon atom up a bit so that the Hydrogens go into the south pole correctly. In order to do that, I will need to supply some broken atoms. For example, we need a Carbon atom that does not have its south Proton, as that will need to be specified as an extra H atom. I don't like having to break the atoms up like that, as it stops other possible functionality like extracting the chemical formula from the chain. However, if you just want it to look right, then it will be fine.

You can create some funky molecules like this:

MBL: fanIn:<fanIn:<O,O,Mg>,fanIn:<O,O,Mg>,fanOut:<Ba[fanOut:<Mg,O,O>,fanOut:<Mg,O,O>,fanOut:<Mg,O,O>,fanOut:<Mg,O,O>],fanOut:<Mg,O,O>,fanOut:<Mg,O,O>>>
URL: https://www.nevyns-lab.com/mathis/app/mbl/mbl.html?mbl=fanIn:%3CfanIn:%3CO,O,Mg%3E,fanIn:%3CO,O,Mg%3E,fanOut:%3CBa[fanOut:%3CMg,O,O%3E,fanOut:%3CMg,O,O%3E,fanOut:%3CMg,O,O%3E,fanOut:%3CMg,O,O%3E],fanOut:%3CMg,O,O%3E,fanOut:%3CMg,O,O%3E%3E%3E&align=X&atom=nucleus



Last edited by Nevyn on Sat Jun 16, 2018 7:40 pm; edited 2 times in total (Reason for editing : Chaned CH3 to CH4)
avatar
Nevyn
Admin

Posts : 1399
Join date : 2014-09-11

View user profile http://www.nevyns-lab.com

Back to top Go down

Re: Molecular Bonding Language

Post by Nevyn on Sun Jun 10, 2018 7:57 pm

Actually, the fan command is useful. I have used it to model Nitro-Glycerin years ago, which I modeled as 3 long arms attached at the center, as-in a Y configuration.
avatar
Nevyn
Admin

Posts : 1399
Join date : 2014-09-11

View user profile http://www.nevyns-lab.com

Back to top Go down

Re: Molecular Bonding Language

Post by Nevyn on Sun Jun 10, 2018 8:12 pm

Forgot to mention that the fan* commands support some parameters.

fan* direction angle:chain array

where:
direction is north, south, east or west, or just the first letter, and dictates which way the atoms are placed and which direction they curve around. The default is east.

angle is the number of degrees to rotate around the chain axis, which effectively rotates the fan around its connection point to the focal chain. It is actually rotating the entire chain, not just the fan. Not sure if I will change that or not at this stage. Let me know if you think I should just rotate the fan and not the focal chain as well.

Example: fanIn n 45:<C,C,C,O>


Last edited by Nevyn on Sun Jun 10, 2018 8:15 pm; edited 1 time in total
avatar
Nevyn
Admin

Posts : 1399
Join date : 2014-09-11

View user profile http://www.nevyns-lab.com

Back to top Go down

Re: Molecular Bonding Language

Post by Nevyn on Sun Jun 10, 2018 8:14 pm

One annoying thing about using '<' and '>' is that you have to turn off HTML code in your posts on this forum to get them to show up correctly.
avatar
Nevyn
Admin

Posts : 1399
Join date : 2014-09-11

View user profile http://www.nevyns-lab.com

Back to top Go down

Re: Molecular Bonding Language

Post by Nevyn on Sun Jun 10, 2018 8:33 pm

One problem with these new commands is that they can't be used to directly fan out from a carousel position. You need some other chain to sit between the root atom and the fan. I will need to introduce another fan command that is like fan, but limits it to a half circle. In other words, it would just fan out all items in the Chain Array and not use one of them to focus on.

I can't think of a good name for it at the moment. Maybe fanAll or fanFrom or something like that. Maybe I should change the existing fan to be called radial and then re-use fan to just fan out all items in the array.

I'll think of something, but suggestions are always welcome.
avatar
Nevyn
Admin

Posts : 1399
Join date : 2014-09-11

View user profile http://www.nevyns-lab.com

Back to top Go down

Re: Molecular Bonding Language

Post by Nevyn on Mon Jun 11, 2018 7:02 pm

I just had a look at the Methane paper and MBL still can't model that one. I'll have to introduce a new operator, like the flip operator, but it turns the atom onto its side. More to the point, it needs to stop the existing functionality of turning an atom if it only contains a core proton stack and nothing else. This was needed because all atoms a oriented along the north/south axis, but if the atom only has a core, then it is oriented along the X or Z axis, not the Y, so the MBL Visualizer would turn them to be along the N/S axis. For Methane, we need the H atoms to be E/W, not oriented along the N/S axis.



I really don't like this ability of atoms to re-arrange their protons. Very hard to work with in the code. I don't see any rhyme or reason to it. You have to know too much about the molecule to figure out how it might be configured. I want to work from the other direction. I want the underlying principles to guide the configuration. Neodymium is another example that changes in molecules but some protons go up and some go down. What kind of charge field could do that? It just feels like the modeler is deciding that they want more charge channeling somewhere, so they just take protons from somewhere else and put them there. Quite literally the end justifying the means. I know that we have to work that way to figure these things out, but once we do, we should strive to make it work from the other direction. /rant
avatar
Nevyn
Admin

Posts : 1399
Join date : 2014-09-11

View user profile http://www.nevyns-lab.com

Back to top Go down

Re: Molecular Bonding Language

Post by Jared Magneson on Wed Jun 13, 2018 1:20 am

I was thinking along the same lines the other day while trying to use MBL to model C21H30O2, known widely as THC. It was just for fun, but I realized it would take a lot more work on my end to "describe" it in MBL, since I've only just dabbled in it so far. So the molecule came out basically a long, obscene string instead of the shape it's described to us as traditionally.

But that's not your fault - it's mine. I didn't take the time to learn MBL better to make it work. I'll try again soon.

Jared Magneson

Posts : 444
Join date : 2016-10-11

View user profile

Back to top Go down

Re: Molecular Bonding Language

Post by Cr6 on Thu Jun 14, 2018 1:04 am

Jared Magneson wrote:I was thinking along the same lines the other day while trying to use MBL to model C21H30O2, known widely as THC. It was just for fun, but I realized it would take a lot more work on my end to "describe" it in MBL, since I've only just dabbled in it so far. So the molecule came out basically a long, obscene string instead of the shape it's described to us as traditionally.

But that's not your fault - it's mine. I didn't take the time to learn MBL better to make it work. I'll try again soon.

I was thinking of somehow rendering the MBL in a matix style dataset just so machine learning could be applied. How to render each molecule in a table or JSON string while keeping fidelity to particular properties?
How to create a data warehouse/data set layout according to the C.F.? JSON helps a lot but kind hides using structures for other mapping (MBL to traditional Chem Notation-Electron bonding). Ultimately, it would be cool to set the Electron bonding notation and have a ML routine map it back to Mathis with high probability.

Cr6
Admin

Posts : 1099
Join date : 2014-08-09

View user profile http://milesmathis.forumotion.com

Back to top Go down

Re: Molecular Bonding Language

Post by Nevyn on Thu Jun 14, 2018 10:05 pm

What do you mean by a matrix style dataset? Random green characters flowing down the screen? Probably not, but if you mean to extract the transform matrices for each proton, neutron and possibly electron, then that is feasible. They could be grouped into atoms, sub-grouped into stacks, etc. I don't know what you would need to get it to work with a machine learning system. But I could easily generate some JSON like this:

Code:

"molecule": {
  "atoms": [
    {
      "symbol": "He"
      "stacks": [
        { "type": "Proton", "position": [X,Y,Z], "rotation": [X,Y,Z] }
        { "type": "Neutron", "position": [X,Y,Z], "rotation": [X,Y,Z] }
        { "type": "Neutron", "position": [X,Y,Z], "rotation": [X,Y,Z] }
        { "type": "Proton", "position": [X,Y,Z], "rotation": [X,Y,Z] }
        ,
        ...
      ]
    }
    ,
    ...
  ]
  ,
  ....
}

That really only gives you the positions of things. I imagine that you would have to implement some rules in the learning system for it to make sense but I have no working knowledge of them, so I can't say too much.
avatar
Nevyn
Admin

Posts : 1399
Join date : 2014-09-11

View user profile http://www.nevyns-lab.com

Back to top Go down

Re: Molecular Bonding Language

Post by Cr6 on Fri Jun 15, 2018 1:43 am

Nevyn wrote:What do you mean by a matrix style dataset? Random green characters flowing down the screen? Probably not, but if you mean to extract the transform matrices for each proton, neutron and possibly electron, then that is feasible. (YES!) What a Face They could be grouped into atoms, sub-grouped into stacks, etc. I don't know what you would need to get it to work with a machine learning system. But I could easily generate some JSON like this:

...snip of code block

That really only gives you the positions of things. I imagine that you would have to implement some rules in the learning system for it to make sense but I have no working knowledge of them, so I can't say too much.

Sorry Nevyn, lately I've been looking at DNA strands and numbered positions for them. I guess, I'm looking for almost an extremely wide table representation of this to use for querying.  I'm going to have to look at maybe converting JSON to SQL to try and parse elements into a queryable form.  Lazily trying to get things arranged for running R/Python ML algorithms on them.  I could possibly scrape an atomic arrangement from Wikipedia for certain molecules and try to rebuild them in the MLB engine.  https://upload.wikimedia.org/wikipedia/commons/thumb/3/34/Dichloroacetic-acid-2D-skeletal.png/165px-Dichloroacetic-acid-2D-skeletal.png (an anti-cancer nearly free drug that I'm trying to figure out why this works so well using Miles' C.F.  --- researchers really don't know the action of it in vivo and have admitted to seeing the positive effects but not knowing why it is so effective...). These are just rambling thoughts on this approach.

Cr6
Admin

Posts : 1099
Join date : 2014-08-09

View user profile http://milesmathis.forumotion.com

Back to top Go down

Re: Molecular Bonding Language

Post by Sponsored content


Sponsored content


Back to top Go down

Page 3 of 4 Previous  1, 2, 3, 4  Next

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum