NetLogo Osmosis Simulator

by Johannes Kottonau, PhD, Kantonsschule Frauenfeld, Switzerland

Note: Due to persistent Java security problems, the applet has been removed from this page.

How to run it

Step 1: Download the NetLogo modeling environment, it is completely free. The destination directory can be anywhere, on your hard disk, your portable disk, on a server, even on a CD-ROM etc. NetLogo ist completely stand-alone, no administrator rights are required.

Step 2: Download the file NetLogo_Osmosis_Simulator.nlogo. (Use the right mouse button and select "Save Target as". Be sure that the file ends with the .nlogo extension.

Step 3: Install NetLogo. When completed, open the installation directory. Start NetLogo executing the file "NetLogo 5.0.5.exe".

Step 4: On the menu bar, select "File" and then "Openů". Navigate to the downloaded file NetLogo_Osmosis_Simulator.nlogo and open it with a double click. Follow the steps 1 and 2 below (in the section "How to use it").


created with NetLogo, based on Wilensky, U. (2005): NetLogo GasLab Circular Particles model. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL.

What is Osmosis?

Osmosis is most commonly defined as the movement of water across a semipermeable membrane in response to a solute concentration gradient.

How to use it

Step 1: Press SETUP and compose the initial solutions

The square black area opens the view to some three-dimensional space separated by a semipermeable membrane (red dashed line). The two subspaces can be interpreted as two adjacent cells (with an extremely enlarged view of their cell plasmas). The modelled plasmas consist of water molecules (blue) and molecules of the solute (brown). Their osmolarities can be preset by the sliders (the standard values are 6.0 osmol for the left cell and 2.0 osmol for the right cell). To keep the simulated processes as conspicuous as possible, the osmolarities are chosen rather high.

Given the osmolarity and 1 liter of solution, which mass of glucose will solve in which mass of water?

At simulation setup, the characteristics of the initial solutions are calculated corresponding to the slider values. The osmolarities directly translate into the mass of glucose that will be contained in 1 liter of each solution (given the mol weight of glucose of 180 grams / mol). Then, an algorithm calculates the amount of water that would have to be added to the glucose to get exactly one liter of solution. This algorithm incorporates empirically data as they are available in density tables (published e.g., in the CRC Handbook of Chemistry and Physics).

How many water molecules will surround 1 solute molecule?

Next, starting from the mass of glucose and the mass of water contained in 1 liter of each solution, the respective number of glucose and water molecules is calculated (in moles per liter of each solution). Finally the calculation results in the (solute : solvent) molecule ratio of each solution.

Implementing the (solute : solvent) molecule ratio

This ratio is now graphically implemented by displaying the solutions into the black space. Initially, each subvolume is filled by 5 times the preset osmolarity values (i.e. 30 particles if the osmolarity to display is 6.0). The number of 5 is adjusted to the current computational power of most PCs. A larger factor would result into the simulation of more particles (also more collisions!). This would slow down the simulation speed and lower the conspicuousness of the simulated dynamics. The only thing important in the initial setup is that the ratio of the displayed solute particles meets the ratio of preset osmolarities. The real size of the subvolumes (e.g. in cubic nanometers) does not matter. In a last step, depending on the calculated ratio of glucose molecules : water molecules in each cell, water molecules are added on each side. This procedure results into the displays of two glucose solutions with the preset osmolarities. The spatial effect of different osmolarities is now immediately visible. In an educational setting, this is probably the most valuable contribution of this simulation model.

Step 2: Press GO and let the particles move

As long as the simulation is running, water molecules will randomly move within the total volume defined by the two cells. Some water molecules will cross the membrane coming from the left cell, and some water molecules will cross the membrane coming from the right cell. However, since the initial water concentration in the left cell is lower than in the right cell (given the standard settings), more water molecules per time unit will move from the right to the left cell (than from the left cell to the right cell). In sum, there is a net movement of water molecules from the right to the left cell (equivalent to simple water diffusion). Note that the solute particles are not allowed to diffuse between the cells (zero permeability): they are restricted from resolving their own concentration gradient as well as the water concentration gradient. However, since they produce the initial difference in water concentration, they can be seen as the underlying cause of the net water transport.

As soon as the number of water molecules in the left cell will start to increase (and to decrease in the right cell), the total kinetic energy will increase in the left cell and decrease in the right cell. Given that the cell volumes are identical at simulation start, any deviation of the number of water molecules from the conditions at simulation start will result in some sort of pressure difference. This difference is not explicitly calculated here, but instead some relative measure of the pressure difference is estimated by means of the water concentration difference. That is, from a technical/implementational view, the water concentration difference will make the membrane move. In the long run, after hundreds of calculation steps, the left cell will swell* and the right cell will shrink.

In the end, water concentrations will be balanced and osmosis vanishes. The concentrations of all particles in both cells will have reached the state of dynamic equilibrium and the membrane will forever vacillate around its expected value.

*) Swelling by osmosis is one of the basic processes in biology. For example, you can imagine the left cell as a stoma cell on the underside of a plant leaf and the right cell as one of its neighbouring cell delivering the required water (simply replace the glucose particles by potassium ions).

How to cite

Kottonau, J. (2011). An Interactive Computer Model for Improved Student Understanding of Random Particle Motion and Osmosis. Journal of Chemical Education, 88(6), 772-775.