Geogebra Plus Linear Programming

We’ll Create a Geogebra program to help us with our linear programming — #PySeries#Episode 02

J3
Jungletronics
5 min readAug 30, 2020

--

First, we’ve got this problem that comes from the math to your course guide from the Pingree school.

It is the tape’s verse CDs example:

Let’s see the solution using Geogebra than in the end I will present the Python solution.

1# Define Your Variables:

2# Translate your constraints:

3# Type your objective Function:

4# Open a Geogebra New Activity session, Hit Geogebra, Create an Applet and get a name to your applet (mine is GeoPlusLinearProg):

Fig 1. Opening and Creating New Activity in Geogebra App.

You can expand the applet according to your screen resolution:

Fig 2. Expanding the Applet view!

Just fine!

5# On Geogebra, on the left, type the inequality as well as equality like this:

The regions in the graph are presented, now configure them according to your taste, clicking on each inequality and changing the style and color properties. Here are my settings.

Fig 3. Entering all the constraints and equations.

6#Now, click Point > Intercept and create 4 points, in the region of interest:

Fig 4. Separating the solution region.

7# On Geogebra, open a Spreadsheet and type (hamburger icon>View>Spreedsheet located at top-right):

Fig 5. Delimiting each intercept points of the solution.

Now, in the spreadsheet type this (drag the little rectangle down):

Fig 6. We found the region of the solution; Any of the combinations are valid; the lowest cost is 9.33 Tape and 3 CDs (A3)=$110.67.

Any of the vertices of the trapeze serve as an answer. I choose the second option(9 Tapes and 3 CDs).

Let’s see what python decides …

8# Python Solution:

Fig 7. Using Visual Studio code App; please see this post about it: Python 4 Engineers — Exercises! linked bellow…

And that’s all for now!

I hope you were impressed with the Geogebra app like I am!

Bye for now!

See you in the next episode of Python Series!

https://docs.google.com/document/d/1DkycafWLUZeprvnTQcSgaasyniTWTeDe4cEzEnN6hes/edit?usp=sharing

References & Credits

Fig 8. Here is the inspiration for this lesson! Thanks to Wicked Math 👌

Posts Related:

00Episode#PySeries — Python — Jupiter Notebook Quick Start with VSCode — How to Set your Win10 Environment to use Jupiter Notebook

01Episode#PySeries — Python — Python 4 Engineers — Exercises! An overview of the Opportunities Offered by Python in Engineering!

02Episode#PySeries — Python — Geogebra Plus Linear Programming- We’ll Create a Geogebra program to help us with our linear programming (this one)

03Episode#PySeries — Python — Python 4 Engineers — More Exercises! — Another Round to Make Sure that Python is Really Amazing!

04Episode#PySeries — Python — Linear Regressions — The Basics — How to Understand Linear Regression Once and For All!

05Episode#PySeries — Python — NumPy Init & Python Review — A Crash Python Review & Initialization at NumPy lib.

06Episode#PySeries — Python — NumPy Arrays & Jupyter Notebook — Arithmetic Operations, Indexing & Slicing, and Conditional Selection w/ np arrays.

07Episode#PySeries — Python — Pandas — Intro & Series — What it is? How to use it?

08Episode#PySeries — Python — Pandas DataFrames — The primary Pandas data structure! It is a dict-like container for Series objects

09Episode#PySeries — Python — Python 4 Engineers — Even More Exercises! — More Practicing Coding Questions in Python!

10Episode#PySeries — Python — Pandas — Hierarchical Index & Cross-section — Open your Colab notebook and here are the follow-up exercises!

11Episode#PySeries — Python — Pandas — Missing Data — Let’s Continue the Python Exercises — Filling & Dropping Missing Data

12Episode#PySeries — Python — Pandas — Group By — Grouping large amounts of data and compute operations on these groups

13Episode#PySeries — Python — Pandas — Merging, Joining & Concatenations — Facilities For Easily Combining Together Series or DataFrame

14Episode#PySeries — Python — Pandas — Pandas Dataframe Examples: Column Operations

15Episode#PySeries — Python — Python 4 Engineers — Keeping It In The Short-Term Memory — Test Yourself! Coding in Python, Again!

16Episode#PySeries — NumPy — NumPy Review, Again;) — Python Review Free Exercises

17Episode#PySeriesGenerators in Python — Python Review Free Hints

18Episode#PySeries — Pandas Review…Again;) — Python Review Free Exercise

19Episode#PySeriesMatlibPlot & Seaborn Python Libs — Reviewing theses Plotting & Statistics Packs

20Episode#PySeriesSeaborn Python Review — Reviewing theses Plotting & Statistics Packs

--

--

J3
Jungletronics

Hi, Guys o/ I am J3! I am just a hobby-dev, playing around with Python, Django, Ruby, Rails, Lego, Arduino, Raspy, PIC, AI… Welcome! Join us!