Download Kyle Demo 1

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

General equilibrium theory wikipedia , lookup

Economic equilibrium wikipedia , lookup

Supply and demand wikipedia , lookup

Transcript
wxMaxima by Example: Supply and Demand
INTRODUCTION
We are going to introduce some of the possibilities that wxMaxima offers by going, stepby-step, through Project 1 on the class website, which was originally written for the (now
unavailable) software Mupad. After this introduction, you should be able to:
 Define functions
 Graph functions
 Solve for equilibrium from 2 equations
In Project 1 we will accomplish these goals by analyzing some supply and demand
curves.
IMPORTANT!
When we are visually plotting supply and demand functions, it is important to remember
that economists graph them backwards; the independent/dependent variables are
switched. Supply and demand functions describe the quantity based on the price, which
would be graphed normally with price on the x-axis and quantity on the y-axis.
Economists, however, prefer to switch those around, with price on the y-axis, for the
simple reason that it is easier to visualize quantity changing as price goes up and down.
So, in the spirit of being economists, we will be graphing supply and demand functions
backwards, with price being a function of quantity. It is important to recognize this.
STEP 1: Defining Functions
We will begin by looking at the initial supply and demand functions in Project 1. These
two equations are given as:
Demand: p = -0.5q + 9
Supply: p = 1.5q – 3
In wxMaxima we are going to assign these functions to D1 and S1. To do this, we enter
the following at the prompt:
D1(q):=-0.5*q+9;
It is important to remember the multiplication sign (*) or there will be an error.
If you have done this correctly, wxMaxima should repeat the function back, as in the
figure below.
Now we are going to input the first supply curve. Enter the following at the prompt:
S1(q):=1.5*q-3;
If you entered it correctly, it should again repeat the function back, seen below.
Now we have defined the supply and demand functions, and can simply refer to them as
D1 and S1. On to graphing!
STEP 2: Plotting Functions
The next step in Project 1 is to plot these two functions. This is quite easy in wxMaxima,
and allows us to visualize their relationships. To graph the functions in wxMaxima, we
first go to the top toolbar and choose:
Plotting -> Plot 2d…
This will bring up the following dialog box:
In the “Expression(s):” box, we enter our
two functions, D1 and S1, separated by a
comma.
The next two options let us define
how far the x and y axis are drawn. In this
case, they will be drawn from zero to
twelve, however you can draw them
however you like.
The “Ticks:” option allows us to
choose how many tick marks are drawn.
Ten is fine for this example.
It is not necessary to utilize the next options, however if you would ever like to output the
graph to a file, you can do so by setting the “Plot to file:” option.
If you have done this correctly, you should see a graph as in the figure below:
If your screen looks like this, then congratulations, you have just learned to graph
equations in wxMaxima. If your screen does not look like this, then go through the first
two steps again.
Now we will see how to solve for our supply/demand equilibrium.
STEP 3: Solving For Equilibrium
It is a very simple process to solve for the equilibrium quantity given these two functions,
D1 and S1. The “solve” command can easily find it. Enter the following at the prompt:
solve(D1(q)=S1(q), q);
This tells wxMaxima to solve for the point where D1(q) and S1(q) are equal, given q. If
you entered it correctly, you should see something like this:
The important part here is [ q = 6 ]. This means that the value for quantity (q) where D1
and S1 are equal is 6.
We now double check the value by inputting it into both of the functions, as below:
(If your numbers behind the % sign are different, that’s okay; they just indicate the order
in which the commands were entered.)
We can now see that the same input on both functions returns the same value, so they
truly are equal when quantity equals six. The fact that the price is equal to the quantity,
(inputting a quantity of six gives us a price of six), is purely coincidental.
STEP 5: On Your Own!
The next step is to continue Project 1 on your own, using the same steps as above. For the
further supply and demand functions, just define them as D2, D3, S2, S3, etc. In order to
graph all of the functions, just remember to separate the functions with a comma in the
“Plot 2d” dialog box. The steps are simple once you get the hang of it, just keep it up.
For further resources on the use of wxMaxima, please take a look at Dr. Jerrell’s Maxima
Handbook, available on the ECO 385 at:
http://www.cba.nau.edu/facstaff/jerrell%2Dm/Classes/eco_385.htm
Good luck!