{ "metadata": { "name": "" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Chapter 19 - Magnetic resonance" ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example I2 - Pg 467" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#calculate the spin-spin coupling constants\n", "#Initialization of variables\n", "import math\n", "A=5.1 #Hz\n", "B=-1.4 #Hz\n", "C=3.2 #Hz\n", "an1=120*math.pi/180. #radians\n", "an2=180*math.pi/180. #radians\n", "#calculations\n", "j1=A+B*math.cos(an1) + C*math.cos(2*an1)\n", "j2=A+B*math.cos(an2) + C*math.cos(2*an2)\n", "#results\n", "print '%s %d %s' %(\"Spin-spin coupling constant =\",j1,\"Hz\")\n", "print '%s %.1f %s' %(\"\\n Spin-spin coupling constant =\",j2,\"Hz\")\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Spin-spin coupling constant = 4 Hz\n", "\n", " Spin-spin coupling constant = 9.7 Hz\n" ] } ], "prompt_number": 1 } ], "metadata": {} } ] }