{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Chapter 22: Electric Charge" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 22.1: Sample_Problem_1.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "exec('electrostatics.sci', -1)\n", "exec('degree_rad.sci', -1)\n", "\n", "//Given that\n", "q1 = 1.60*10^-19 //in C\n", "q2 = 3.20*10^-19 //in C\n", "R = 0.0200 //in meter\n", "\n", "//Sample Problem 22-1a\n", "printf('**Sample Problem 22-1a**\n')\n", "F12 = coulomb(q1, q2, R)\n", "printf('The coulombic force between the charged particle is %eN\n', F12)\n", "\n", "//Sample Problem 22-1b\n", "printf('\n**Sample Problem 22-1b**\n')\n", "q3 = -3.20*10^-19 //in C\n", "R13 = 3/4*R\n", "F1 = coulomb(q1, q3, R13) + F12\n", "printf('The net force on particle 1 is equal to %eN\n', abs(F1))\n", "\n", "//Sample Problem 22-1c\n", "printf('\n**Sample Problem 22-1c**\n')\n", "q4 = -3.20*10^-19 //in C\n", "R14 = 3/4*R\n", "theta = dtor(60)\n", "F14 = coulomb(q1, q4, R14)\n", "F1net = [F12+F14*cos(theta), F14*sin(theta)]\n", "printf('The net force on particle 1 is equal to %eN', norm(F1net))" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 22.2: Sample_Problem_2.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "exec('electrostatics.sci', -1)\n", "\n", "//Given that\n", "q = 1 //(say)\n", "q1 = 8*q\n", "q2 = -2*q\n", "L = 1 //(say)\n", "x = L\n", "\n", "//Sample Problem 22-2\n", "printf('**Sample Problem 22-2**\n')\n", "//let the distance of proton from q1 is y\n", "//We know that y>L\n", "y = poly(0, 'y')\n", "F1 = coulomb(q1, e, y)\n", "F2 = coulomb(q2, e, y-L)\n", "p = F1 + F2\n", "r = roots(denom(inv(p)))\n", "printf('the proton should be placed at a distance %1.1fL from q1', r(2))" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 22.3: Sample_Problem_3.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "exec('electrostatics.sci', -1)\n", "\n", "//Given that\n", "Q = 1 //(say)\n", "q1 = Q\n", "q2 = 0\n", "a = 1 //(say)\n", "\n", "//Sample Problem 22-3a\n", "printf('**Sample Problem 22-3a**\n')\n", "q1 = (q1 + q2)/2\n", "q2 = q1\n", "F = coulomb(q1, q2, a)\n", "printf('The net force between the two sphere is %eQ^2/a^2\n', F)\n", "\n", "\n", "//Sample Problem 22-3b\n", "printf('\n**Sample Problem 22-3b**\n')\n", "q1 = 0\n", "F = coulomb(q1, q2, a)\n", "printf('The net force between the two sphere is %fN', F)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 22.4: Sample_Problem_4.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "exec('electrostatics.sci', -1)\n", "exec('gravitation.sci', -1)\n", "\n", "//Given that\n", "r = 4*10^-15 //in meter\n", "n = 26\n", "mp = 1.67*10^-27 //in kg\n", "\n", "//Sample Problem 22-4a\n", "printf('**Sample Problem 22-4a**\n')\n", "Fpp = coulomb(e, e, r)\n", "printf('The force of repulsion is %eN\n', Fpp)\n", "\n", "//Sample Problem 22-4b\n", "printf('\n**Sample Problem 22-4b**\n')\n", "Fg = GForce(mp, mp, r)\n", "printf('The magnitude of gravitational force between two proton is %eN', Fg)" ] } ], "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 }