@@ -1043,7 +1043,7 @@ We'll compute it two ways and get the same answer.
|
1043 | 1043 | In addition to being a useful check on the accuracy of our coding, computing things in these two ways helps us think about the structure of the problem. |
1044 | 1044 | |
1045 | 1045 | ```{code-cell} python3 |
1046 | | -v_leader_forward = np.sum(βs * π_leader) |
| 1046 | +v_leader_forward = βs @ π_leader |
1047 | 1047 | v_leader_direct = -yt[:, 0].T @ P @ yt[:, 0] |
1048 | 1048 | |
1049 | 1049 | # Display values |
@@ -1380,8 +1380,8 @@ u2 = (- F2 @ z).flatten()
|
1380 | 1380 | π_1 = p * q1 - γ * (u1) ** 2 |
1381 | 1381 | π_2 = p * q2 - γ * (u2) ** 2 |
1382 | 1382 | |
1383 | | -v1_forward = np.sum(βs * π_1) |
1384 | | -v2_forward = np.sum(βs * π_2) |
| 1383 | +v1_forward = βs @ π_1 |
| 1384 | +v2_forward = βs @ π_2 |
1385 | 1385 | |
1386 | 1386 | v1_direct = (- z[:, 0].T @ P1 @ z[:, 0]) |
1387 | 1387 | v2_direct = (- z[:, 0].T @ P2 @ z[:, 0]) |
|