{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Chapter 5: principles of statistical thermodynamics" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 5.1: example_1.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "//Initialization of variables\n", "N1=1\n", "N2=1\n", "N3=3\n", "N4=1\n", "//calculations\n", "N=N1+N2+N3+N4\n", "sig=factorial(N) /(factorial(N1) *factorial(N2)*factorial(N3)*factorial(N4))\n", "//results\n", "printf('No. of ways of arranging = %d ',sig)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 5.2: example_2.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "//Initialization of variables\n", "N=6\n", "g=4\n", "//calculations\n", "sig=factorial(g+N-1) /(factorial(g-1) *factorial(N))\n", "//results\n", "printf('No. of ways of arranging = %d ',sig)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 5.3: example_3.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "//Initialization of variables\n", "N=6\n", "g=8\n", "//calculations\n", "sig=factorial(g) /(factorial(N) *factorial(g-N))\n", "//results\n", "printf('No. of ways = %d ',sig)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 5.4: example_4.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "//Initialization of variables\n", "N0=1\n", "//calculations\n", "N1=3/%e\n", "N2=6/%e^2\n", "N3=10/%e^3\n", "N=N0+N1+N2+N3\n", "ei=[0 1 2 3]\n", "eid=ei+1\n", "f0=N0/N\n", "f1=N1/N\n", "f2=N2/N\n", "f3=N3/N\n", "fi=[f0 f1 f2 f3]\n", "//results\n", "printf('fractional population of level 0 = %.3f',f0)\n", "printf(' \n fractional population of level 1 = %.3f',f1)\n", "printf(' \n fractional population of level 2 = %.3f',f2)\n", "printf(' \n fractional population of level 3 = %.3f',f3)\n", "xtitle('fractional populations vs Energy levels','Energy levels ei','fractional population Ni/N')\n", "bar(ei,fi,0.1)" ] } ], "metadata": { "kernelspec": { "display_name": "Scilab", "language": "scilab", "name": "scilab" }, "language_info": { "file_extension": ".sce", "help_links": [ { "text": "MetaKernel Magics", "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" } ], "mimetype": "text/x-octave", "name": "scilab", "version": "0.7.1" } }, "nbformat": 4, "nbformat_minor": 0 }