42 votes
Accepted

Gillespie Stochastic Simulation Algorithm

Yes you can. Below is a fairly general, Mathematica-compiled, fast and robust version. Examples 1. Michaelis-Menten kinetics Michaelis-Menten kinetics for enzyme-directed substrate conversion. The ...
István Zachar's user avatar
38 votes
Accepted

Plot 3D model of DNA in Mathematica

The easiest way to do this is if you have a PDB file, then it's as easy as using Import. Here are a few examples from the RCSB's Protein Data Bank. To get the URLs,...
Jason B.'s user avatar
  • 68.4k
29 votes

Plot 3D model of DNA in Mathematica

This was supposed to be a comment to Jason's answer, but it got a bit long. But wouldn't it be cool if you could just input a DNA sequence and have a plot? ... take that little snippet and paste it ...
J. M.'s missing motivation's user avatar
29 votes
Accepted

visualizing a normal mode vibration of a molecule in mathematica

Using a few undocumented functions that have been discussed here on the stack exchange before, ...
Jason B.'s user avatar
  • 68.4k
20 votes

Pulsed NMR animation

Here is a simple modification of the original code in the question that seems to do what's desired: ...
Jens's user avatar
  • 97.3k
18 votes

Pulsed NMR animation

Below is an animation that tips a proton precessing in the presence of a static B0 magnetic field from the z direction into the x-y plane with a 90 degree ...
Jack LaVigne's user avatar
  • 14.5k
18 votes
Accepted

Minimum energy path of a potential energy surface

Smooth Equations Let $\varphi \colon \mathbb{R}^d \to \mathbb{R}$ denote a potential function (e.g., from OP's data file). We attempt to solve the system $$ \left\{ \begin{aligned} \gamma(0) &...
Henrik Schumacher's user avatar
17 votes

What's the principle behind the new MoleculeRecognize function?

Using ResourceFunction["PrintDefinitions"][MoleculeRecognize], one can determine that the source implementation is MolVec. The specific source code is: ...
Carl Lange's user avatar
  • 13.1k
16 votes

Faking MoleculePlot for compounds where it isn't available

Edit Introduction of the Molecule symbol in v12 has broken the package used in this answer. It can be fixed by converting the ...
bobthechemist's user avatar
16 votes
Accepted

Chemical data of Lactic acid

I've struggled with How Mathematica expects the end-user to interact with knowledge databases for quite some time. While this solution is likely not universal, it has been reasonably successful for ...
bobthechemist's user avatar
15 votes
Accepted

Radial distribution function

I will show a simple and fast approach to computing the pair correlation function (radial distribution function) for a 2D system of point particles.: ...
RunnyKine's user avatar
  • 33.1k
15 votes

Plot 3D model of DNA in Mathematica

Here is a function that can wrap a double helix around any (sufficiently smooth) parameterized curve. Among other things, the function below computes a Bishop frame along the curve; twisting it leads ...
Henrik Schumacher's user avatar
15 votes

ChemistryData — where is specific gravity?

Specific gravity is not on the property list of curated chemical properties, so you can't get it directly. However, here is a function that will compute it. ...
m_goldberg's user avatar
  • 108k
15 votes
Accepted

Why does `Molecule` return a molecule for an incorrect SMILES string?

This is a bug, the most basic manifestation of which is ...
Jason B.'s user avatar
  • 68.4k
14 votes

Minimum energy path of a potential energy surface

Interesting problem. Decided to treat it as a graph problem, rather than fitting an InterpolatingFunction to it and getting descent directions from there. If I knew ...
MikeY's user avatar
  • 7,153
14 votes

Computing the surface area and volume of molecules

I can offer a solution by discretization to ElementMesh with external meshing software Gmsh. Currently it produces better quality mesh on curved surfaces that built-...
Pinti's user avatar
  • 6,503
14 votes

What's the principle behind the new MoleculeRecognize function?

I am one of the authors of Molvec. It was designed in a classical approach using various image processing heuristics to guess the structure. While it's on my todo list, we still haven't published a ...
dkatzel's user avatar
  • 241
14 votes

Mass Transport Model

OK. Let me extend my comments to an answer. First of all, I'd like to point out why OP's attempt doesn't work: "NDSolveValue should return a list with three ...
xzczd's user avatar
  • 66.2k
13 votes
Accepted

Plot polygonal surface

(grabbing a lot of code from this answer) This is just to get you started, adding in colors to the final GraphicsComplex should be pretty easy. ...
Jason B.'s user avatar
  • 68.4k
13 votes

How to apply different equations to different parts of a geometry in PDE?

Denote the disk by $\varOmega$ and its boundary by $\varGamma = \partial \varOmega$. I'd prefer to denote the function residing on the boundary by $u \colon \varGamma \to \mathbb{R}$; the function on ...
Henrik Schumacher's user avatar
13 votes

Computing the surface area and volume of molecules

The paper Fast Calculation of van der Waals Volume as a Sum of Atomic and Bond Contributions and Its Application to Drug Compounds, pointed out by theorist gives an approximate formula for the ...
Jason B.'s user avatar
  • 68.4k
13 votes

MoleculePlot3D - how to replace spheres?

How to replace the spheres in the plot with other 3d figures, say "N" with a Cylinder, "O" with a Cuboid, and "H" with a sphere. This answer takes points from the ...
Anton Antonov's user avatar
12 votes
Accepted

Connectivity in a molecule and permutations

Getting the graph from the XYZ file You have only a set of coordinates and atom types in an XYZ file. When you import it in Mathematica you can import 3 elements: the 3D plot, the coordinates, and ...
Jason B.'s user avatar
  • 68.4k
12 votes
Accepted

Maxwell construction problem with FindRoot

Good job on describing your problem. Copying your definitions from your question ...
Jack LaVigne's user avatar
  • 14.5k
12 votes
Accepted

Molecule fingerprint functions v13

edit: For direct access to the underlying fingerprint functions behind FeatureExtraction for molecules, see the Molecule Fingerprints paclet in the new paclet ...
Jason B.'s user avatar
  • 68.4k
11 votes
Accepted

SpaceFillingMolecularPlot using CAS number of a compound

added 4/26/2020 Molecule[] + MoleculePlot3D[] can now do this directly in version 12.1: ...
J. M.'s missing motivation's user avatar
11 votes
Accepted

Proteins, ProteinData, WolframAlpha

Here's a workaround that directly queries the PDB search API and returns the first num search results as a Dataset[]. The ...
J. M.'s missing motivation's user avatar
11 votes
Accepted

ChemicalData returns the correct result for "Sulfuric" but an empty list for "Sulfuric Acid". Why?

Consider using a dedicated search pattern making function. Here is an example. ...
Anton Antonov's user avatar
11 votes

DFT for Helium atom

Here's what I mentioned in the comments. Life is better with NDEigensystem and NDSolve: ...
b3m2a1's user avatar
  • 46.9k
11 votes
Accepted

How to apply different equations to different parts of a geometry in PDE?

Since I have the code to solve the original problem described in the article GDI-Mediated Cell Polarization in Yeast Provides Precise Spatial and Temporal Control of Cdc42 Signaling, I will give here ...
Alex Trounev's user avatar
  • 44.7k

Only top scored, non community-wiki answers of a minimum length are eligible