Skip to content

Commit 6fc943c

Browse files
committed
Improving drag_force
1 parent 416e360 commit 6fc943c

6 files changed

Lines changed: 16 additions & 16 deletions

File tree

notebooks/chap22.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -537,8 +537,8 @@
537537
" \"\"\"\n",
538538
" rho, C_d, area = system.rho, system.C_d, system.area\n",
539539
" \n",
540-
" mag = -rho * V.mag**2 * C_d * area / 2\n",
541-
" direction = V.hat()\n",
540+
" mag = rho * V.mag**2 * C_d * area / 2\n",
541+
" direction = -V.hat()\n",
542542
" f_drag = direction * mag\n",
543543
" return f_drag"
544544
]

notebooks/chap23.ipynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,18 +110,18 @@
110110
"metadata": {},
111111
"outputs": [],
112112
"source": [
113-
"def drag_force(v, system):\n",
114-
" \"\"\"Computes drag force in the opposite direction of `v`.\n",
113+
"def drag_force(V, system):\n",
114+
" \"\"\"Computes drag force in the opposite direction of `V`.\n",
115115
" \n",
116-
" v: velocity Vector\n",
116+
" V: velocity Vector\n",
117117
" system: System object with rho, C_d, area\n",
118118
" \n",
119119
" returns: Vector drag force\n",
120120
" \"\"\"\n",
121121
" rho, C_d, area = system.rho, system.C_d, system.area\n",
122122
" \n",
123-
" mag = -rho * v.mag**2 * C_d * area / 2\n",
124-
" direction = v.hat()\n",
123+
" mag = rho * V.mag**2 * C_d * area / 2\n",
124+
" direction = -V.hat()\n",
125125
" f_drag = direction * mag\n",
126126
" return f_drag"
127127
]

notebooks/spiderman.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@
236236
"def drag_force(V⃗, system):\n",
237237
" \"\"\"Compute drag force.\n",
238238
" \n",
239-
" V: velocity Vector\n",
239+
" V⃗: velocity Vector\n",
240240
" system: `System` object\n",
241241
" \n",
242242
" returns: force Vector\n",

soln/chap22soln.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,8 +1156,8 @@
11561156
" \"\"\"\n",
11571157
" rho, C_d, area = system.rho, system.C_d, system.area\n",
11581158
" \n",
1159-
" mag = -rho * V.mag**2 * C_d * area / 2\n",
1160-
" direction = V.hat()\n",
1159+
" mag = rho * V.mag**2 * C_d * area / 2\n",
1160+
" direction = -V.hat()\n",
11611161
" f_drag = direction * mag\n",
11621162
" return f_drag"
11631163
]

soln/chap23soln.ipynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -220,18 +220,18 @@
220220
"metadata": {},
221221
"outputs": [],
222222
"source": [
223-
"def drag_force(v, system):\n",
224-
" \"\"\"Computes drag force in the opposite direction of `v`.\n",
223+
"def drag_force(V, system):\n",
224+
" \"\"\"Computes drag force in the opposite direction of `V`.\n",
225225
" \n",
226-
" v: velocity Vector\n",
226+
" V: velocity Vector\n",
227227
" system: System object with rho, C_d, area\n",
228228
" \n",
229229
" returns: Vector drag force\n",
230230
" \"\"\"\n",
231231
" rho, C_d, area = system.rho, system.C_d, system.area\n",
232232
" \n",
233-
" mag = -rho * v.mag**2 * C_d * area / 2\n",
234-
" direction = v.hat()\n",
233+
" mag = rho * V.mag**2 * C_d * area / 2\n",
234+
" direction = -V.hat()\n",
235235
" f_drag = direction * mag\n",
236236
" return f_drag"
237237
]

soln/spiderman_soln.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@
545545
"def drag_force(V⃗, system):\n",
546546
" \"\"\"Compute drag force.\n",
547547
" \n",
548-
" V: velocity Vector\n",
548+
" V⃗: velocity Vector\n",
549549
" system: `System` object\n",
550550
" \n",
551551
" returns: force Vector\n",

0 commit comments

Comments
 (0)