Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[lp_intro]Update lp #531

Merged
merged 3 commits into from
Jul 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions lectures/lp_intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ $$

The following graph illustrates the firm's constraints and iso-revenue lines.

Iso-revenue lines show all the combinations of materials and labor that produce the same revenue.

```{code-cell} ipython3
---
tags: [hide-input]
Expand Down Expand Up @@ -335,7 +337,7 @@ OR-Tools tells us that the best investment strategy is:

3. At the beginning of the third year, the bank balance should be $ \$75,072.245 $.

4. At the end of the third year, the mutual fund will get payouts from the annuity and corporate bond and repay its loan from the bank. At the end it will own $ \$141018.24 $, so that it's total net rate of return over the three periods is $ 41.02\%$.
4. At the end of the third year, the mutual fund will get payouts from the annuity and corporate bond and repay its loan from the bank. At the end it will own $ \$141,018.24 $, so that it's total net rate of return over the three periods is $ 41.02\%$.



Expand Down Expand Up @@ -542,14 +544,14 @@ c_ex2 = np.array([1.30*3, 0, 0, 1.06, 1.30])
A_ex2 = np.array([[1, 1, 0, 0, 0],
[1, -rate, 1, 0, 1],
[1, 0, -rate, 1, 0]])
b_ex2 = np.array([100000, 0, 0])
b_ex2 = np.array([100_000, 0, 0])

# Bounds on decision variables
bounds_ex2 = [( 0, None),
(-20000, None),
(-20000, None),
(-20000, None),
( 0, 50000)]
(-20_000, None),
(-20_000, None),
(-20_000, None),
( 0, 50_000)]
```

Let's solve the problem and check the status using `success` attribute.
Expand Down Expand Up @@ -581,7 +583,7 @@ SciPy tells us that the best investment strategy is:

3. At the beginning of the third year, the mutual fund should borrow $ \$20,000$ from the bank and invest in the annuity.

4. At the end of the third year, the mutual fund will get payouts from the annuity and corporate bond and repay its loan from the bank. At the end it will own $ \$141018.24 $, so that it's total net rate of return over the three periods is $ 41.02\% $.
4. At the end of the third year, the mutual fund will get payouts from the annuity and corporate bond and repay its loan from the bank. At the end it will own $ \$141,018.24 $, so that it's total net rate of return over the three periods is $ 41.02\% $.



Expand Down