diff options
author | hardythe1 | 2015-06-03 15:27:17 +0530 |
---|---|---|
committer | hardythe1 | 2015-06-03 15:27:17 +0530 |
commit | df60071cf1d1c18822d34f943ab8f412a8946b69 (patch) | |
tree | ab059cf19bad4a1233a464ccf5d72cf8b3fb323c /sample_notebooks/DanishAnsari/chapter_1.ipynb | |
parent | fba055ce5aa0955e22bac2413c33493b10ae6532 (diff) | |
download | Python-Textbook-Companions-df60071cf1d1c18822d34f943ab8f412a8946b69.tar.gz Python-Textbook-Companions-df60071cf1d1c18822d34f943ab8f412a8946b69.tar.bz2 Python-Textbook-Companions-df60071cf1d1c18822d34f943ab8f412a8946b69.zip |
add books
Diffstat (limited to 'sample_notebooks/DanishAnsari/chapter_1.ipynb')
-rwxr-xr-x | sample_notebooks/DanishAnsari/chapter_1.ipynb | 111 |
1 files changed, 111 insertions, 0 deletions
diff --git a/sample_notebooks/DanishAnsari/chapter_1.ipynb b/sample_notebooks/DanishAnsari/chapter_1.ipynb new file mode 100755 index 00000000..13a30876 --- /dev/null +++ b/sample_notebooks/DanishAnsari/chapter_1.ipynb @@ -0,0 +1,111 @@ +{
+ "metadata": {
+ "name": "chapter 1.ipynb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 1:Vectors"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.1-1,Page no 8"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "#Initialisation of Variables\n",
+ "f1=120 #lb\n",
+ "f2=100 #lb\n",
+ "theta=((60*pi)/180) #radians\n",
+ "#Calculations\n",
+ "R=sqrt(120**2+100**2-(2*120*100*cos(theta))) #Applying Thr rule of Cosines\n",
+ "alpha1=(((arcsin(120*sin(theta)/111))*180)/pi) #Applying the Law of Sines\n",
+ "alpha=alpha1+270 #As the vector lies in the fourth Quadrant by obsrevaton\n",
+ "#Results\n",
+ "print'The Resultant of The force system is equal to',round(R,3),\"lb\" #lb\n",
+ "print'The Resultant is at',round(alpha,3),\"degrees\" #degrees\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Resultant of The force system is equal to 111.355 lb\n",
+ "The Resultant is at 339.43 degrees\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.2-2,Page no 9"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#Initilization of variables\n",
+ "P=100 #lb\n",
+ "Q=120 #lb\n",
+ "theta=((30*pi)/180) #radians\n",
+ "#Calculations\n",
+ "R_x=Q*cos(theta) #lb\n",
+ "R_y=Q*sin(theta)-P #lb\n",
+ "R=sqrt(R_x**2+R_y**2) #lb Triangle law\n",
+ "Theta_1=((arctan(R_y/R_x))*180)/pi #degrees\n",
+ "Theta_R=360+Theta_1 #degrees\n",
+ "#Result\n",
+ "print'The resultant of the force system is',round(R,3),\"lb\"\n",
+ "print'The resultant is at',round(Theta_R,3),\"degrees\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The resultant of the force system is 111.355 lb\n",
+ "The resultant is at 338.948 degrees\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file |