Skip to content

Commit bbaa12a

Browse files
committed
Updating 11-18
1 parent 1ded82c commit bbaa12a

8 files changed

Lines changed: 4483 additions & 881 deletions

File tree

code/soln/chap11soln.ipynb

Lines changed: 6 additions & 703 deletions
Large diffs are not rendered by default.

code/soln/chap12soln.ipynb

Lines changed: 661 additions & 34 deletions
Large diffs are not rendered by default.

code/soln/chap13soln.ipynb

Lines changed: 66 additions & 53 deletions
Large diffs are not rendered by default.

code/soln/chap14soln.ipynb

Lines changed: 65 additions & 66 deletions
Large diffs are not rendered by default.

code/soln/chap15soln.ipynb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"source": [
77
"# Modeling and Simulation in Python\n",
88
"\n",
9-
"Chapter 14\n",
9+
"Chapter 15\n",
1010
"\n",
1111
"Copyright 2017 Allen Downey\n",
1212
"\n",
@@ -648,6 +648,8 @@
648648
"cell_type": "markdown",
649649
"metadata": {},
650650
"source": [
651+
"## Exercises\n",
652+
"\n",
651653
"**Exercise:** Simulate the temperature of 50 mL of milk with a starting temperature of 5 degC, in a vessel with the same insulation, for 15 minutes, and plot the results.\n",
652654
"\n",
653655
"By trial and error, find a values for `r` that makes the final temperature close to 20 C."
@@ -727,5 +729,5 @@
727729
}
728730
},
729731
"nbformat": 4,
730-
"nbformat_minor": 1
732+
"nbformat_minor": 2
731733
}

code/soln/chap16soln.ipynb

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"source": [
77
"# Modeling and Simulation in Python\n",
88
"\n",
9-
"Chapter 15\n",
9+
"Chapter 16\n",
1010
"\n",
1111
"Copyright 2017 Allen Downey\n",
1212
"\n",
@@ -921,27 +921,6 @@
921921
"savefig('figs/chap07-fig02.pdf')"
922922
]
923923
},
924-
{
925-
"cell_type": "markdown",
926-
"metadata": {},
927-
"source": [
928-
"**Exercise:** Suppose the coffee shop won't let me take milk in a separate container, but I keep a bottle of milk in the refrigerator at my office. In that case is it better to add the milk at the coffee shop, or wait until I get to the office?\n",
929-
"\n",
930-
"Hint: Think about the simplest way to represent the behavior of a refrigerator in this model. The change you make to test this variation of the problem should be very small!"
931-
]
932-
},
933-
{
934-
"cell_type": "code",
935-
"execution_count": 37,
936-
"metadata": {},
937-
"outputs": [],
938-
"source": [
939-
"# Solution\n",
940-
"\n",
941-
"## A refrigerator keeps the milk at a constant temperature,\n",
942-
"## so it is like a container with r = 0."
943-
]
944-
},
945924
{
946925
"cell_type": "markdown",
947926
"metadata": {},
@@ -1069,6 +1048,29 @@
10691048
"source": [
10701049
"coffee.T_final - coffee2.T_final"
10711050
]
1051+
},
1052+
{
1053+
"cell_type": "markdown",
1054+
"metadata": {},
1055+
"source": [
1056+
"## Exercises\n",
1057+
"\n",
1058+
"**Exercise:** Suppose the coffee shop won't let me take milk in a separate container, but I keep a bottle of milk in the refrigerator at my office. In that case is it better to add the milk at the coffee shop, or wait until I get to the office?\n",
1059+
"\n",
1060+
"Hint: Think about the simplest way to represent the behavior of a refrigerator in this model. The change you make to test this variation of the problem should be very small!"
1061+
]
1062+
},
1063+
{
1064+
"cell_type": "code",
1065+
"execution_count": 37,
1066+
"metadata": {},
1067+
"outputs": [],
1068+
"source": [
1069+
"# Solution\n",
1070+
"\n",
1071+
"## A refrigerator keeps the milk at a constant temperature,\n",
1072+
"## so it is like a container with r = 0."
1073+
]
10721074
}
10731075
],
10741076
"metadata": {
@@ -1091,5 +1093,5 @@
10911093
}
10921094
},
10931095
"nbformat": 4,
1094-
"nbformat_minor": 1
1096+
"nbformat_minor": 2
10951097
}

code/soln/chap17soln.ipynb

Lines changed: 1432 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)