|
1404 | 1404 | "\n",
|
1405 | 1405 | "2. To determine the sign of the velocity change, consider the moons' positions. For example, if `G` stands for Ganymede and `C` for Callisto:\n",
|
1406 | 1406 | "\n",
|
1407 |
| - " * If `Gx = 5` (the `x` position of Ganymede) and `Cx = 3`, then Ganymede's `x` velocity changes by `+1` (because `Gx > Cx`), and Callisto's `x` velocity must change by `-1` (because `Cx < Gx`).\n", |
| 1407 | + " * If `Gx = 3` (the `x` position of Ganymede) and `Cx = 5`, then Ganymede's `x` velocity changes by `+1` (because `5 > 3`), and Callisto's `x` velocity must change by `-1` (because `3 < 5`).\n", |
1408 | 1408 | " * If the positions on a given axis **are the same**, then the velocity on that axis doesn't change at all.\n",
|
1409 | 1409 | " \n",
|
1410 | 1410 | "3. Once the gravity has been calculated and the velocity updated, we should also update the position: simply **add the velocity** of each moon to its current position. For example, if Europa's position is `x=1, y=2, z=3` and its velocity `x=-2, y=0, z=3`, then the new position would be `x=-1, y=2, z=6`."
|
|
1434 | 1434 | "After simulating **10 time steps**, the system's configurations is\n",
|
1435 | 1435 | "\n",
|
1436 | 1436 | "```\n",
|
1437 |
| - "Ganymede: x= 2, y= 1, z=-3, vx=-3, vy=-2, vz=1\n", |
1438 |
| - "Io: x= 1, y=-8, z= 0, vx=-1, vy= 1, vz=3\n", |
| 1437 | + "Ganymede: x= 2, y= 1, z=-3, vx=-3, vy=-2, vz= 1\n", |
| 1438 | + "Io: x= 1, y=-8, z= 0, vx=-1, vy= 1, vz= 3\n", |
1439 | 1439 | "Europa: x= 3, y=-6, z= 1, vx= 3, vy= 2, vz=-3\n",
|
1440 | 1440 | "Callisto: x= 2, y= 0, z= 4, vx= 1, vy=-1, vz=-1\n",
|
1441 | 1441 | "```\n",
|
|
1452 | 1452 | "Sum of total energy: `36 + 45 + 80 + 18 = 179`"
|
1453 | 1453 | ]
|
1454 | 1454 | },
|
1455 |
| - { |
1456 |
| - "cell_type": "markdown", |
1457 |
| - "id": "024c6e45-4204-4930-9e1c-47a7a472236c", |
1458 |
| - "metadata": {}, |
1459 |
| - "source": [ |
1460 |
| - "<div class=\"alert alert-block alert-warning\">\n", |
1461 |
| - "<h4><b>Question</b></h4>\n", |
1462 |
| - " What is the <b>total energy of the system</b> after simulating the moons for <b>1000 time steps</b>?\n", |
1463 |
| - "</div>" |
1464 |
| - ] |
1465 |
| - }, |
1466 | 1455 | {
|
1467 | 1456 | "cell_type": "markdown",
|
1468 | 1457 | "id": "ccb911c1-625a-45e9-b21d-7057bcc2672e",
|
|
1485 | 1474 | "source": [
|
1486 | 1475 | "class Universe:\n",
|
1487 | 1476 | " \"\"\"A class for a universe\"\"\"\n",
|
1488 |
| - " # Write here your implementation here of the Universe class \n" |
| 1477 | + " # Write here your implementation here of the Universe class " |
1489 | 1478 | ]
|
1490 | 1479 | },
|
1491 | 1480 | {
|
|
1504 | 1493 | "</div>"
|
1505 | 1494 | ]
|
1506 | 1495 | },
|
| 1496 | + { |
| 1497 | + "cell_type": "markdown", |
| 1498 | + "id": "17a227ba-6c7a-4df1-b635-1c6f95ef8bc6", |
| 1499 | + "metadata": {}, |
| 1500 | + "source": [ |
| 1501 | + "<div class=\"alert ale
10000
rt-block alert-warning\">\n", |
| 1502 | + "<h4><b>Question</b></h4>\n", |
| 1503 | + " What is the <b>average</b> of the total energy of the system after simulating the universe for <b>1000 time steps</b>?\n", |
| 1504 | + "</div>" |
| 1505 | + ] |
| 1506 | + }, |
1507 | 1507 | {
|
1508 | 1508 | "cell_type": "code",
|
1509 | 1509 | "execution_count": null,
|
|
1519 | 1519 | " # Write your solution here\n",
|
1520 | 1520 | " pass"
|
1521 | 1521 | ]
|
| 1522 | + }, |
| 1523 | + { |
| 1524 | + "cell_type": "code", |
| 1525 | + "execution_count": null, |
| 1526 | + "id": "21e23134-7fc3-42ce-8024-9f9583abfc9f", |
| 1527 | + "metadata": {}, |
| 1528 | + "outputs": [], |
| 1529 | + "source": [] |
1522 | 1530 | }
|
1523 | 1531 | ],
|
1524 | 1532 | "metadata": {
|
|
0 commit comments