Skip to content

Commit 15bf4c7

Browse files
committed
Rectifying the comments on the samuelson lectures
1 parent 4c78e09 commit 15bf4c7

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

lectures/samuelson.md

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -516,9 +516,9 @@ therefore damped oscillations')
516516
therefore get smooth convergence to a steady state')
517517
```
518518

519-
```{code-cell} ipython3
520-
### Test the categorize_solution function
519+
To test the categorize_solution function,
521520

521+
```{code-cell} ipython3
522522
categorize_solution(1.3, -.4)
523523
```
524524

@@ -618,10 +618,6 @@ $$
618618
pairs that would generate those roots
619619

620620
```{code-cell} ipython3
621-
### code to reverse-engineer a cycle
622-
### y_t = r^t (c_1 cos(ϕ t) + c2 sin(ϕ t))
623-
###
624-
625621
def f(r, ϕ):
626622
"""
627623
Takes modulus r and angle ϕ of complex number r exp(j ϕ)
@@ -638,16 +634,16 @@ def f(r, ϕ):
638634
b = -ρ2 # Reverse-engineer a and b that validate these
639635
a = ρ1 - b
640636
return ρ1, ρ2, a, b
637+
```
641638

642-
## Now let's use the function in an example
643-
## Here are the example parameters
639+
Now let's use the function in an example. Here are the example parameters:
644640

641+
```{code-cell} ipython3
645642
r = .95
646643
period = 10 # Length of cycle in units of time
647644
ϕ = 2 * math.pi/period
648645
649646
## Apply the function
650-
651647
ρ1, ρ2, a, b = f(r, ϕ)
652648
653649
print(f"a, b = {a}, {b}")
@@ -743,8 +739,7 @@ r = 1 # Generates undamped, nonexplosive cycles
743739
period = 10 # Length of cycle in units of time
744740
ϕ = 2 * math.pi/period
745741
746-
## Apply the reverse-engineering function f
747-
742+
# Apply the reverse-engineering function f
748743
ρ1, ρ2, a, b = f(r, ϕ)
749744
750745
# Drop the imaginary part so that it is a valid input into y_nonstochastic

0 commit comments

Comments
 (0)