How to get the program
You now have to run it as stated earlier, on the Virtual Server.
If you would rather, you can use it to run your homework in the computer lab on the second floor of the CVLB building, if they still have it there. They may also have had to remove it, and use the virtual server.
On CE Department computers, you can run EES as follows:
- Click on Course Programs, or something like that, then click on EES
- To save your program after running it, click “file, save” (top left of the screen)
- It will suggest: ees on civilstudent1 or something goofy like that.
- That won’t work, since you don’t have permission to write on that drive.
- Hit the drop-down menu and save it on your personal Y: Drive, or save it to your Drive A: (a floppy disk.)
After running EES, you have to save the results to your drive or thumb drive.
- Note carefully where the files are to be loaded on your hard drive. Once setup is complete you will find that he has probably put the main EES.exe program in c:/EES32.
After you get the file and get the program running, you will see the following screen (note that these are older screens, but the idea is the same):
You then type your equations to be solved in here. For example, assume that we make wooden boxes, without lids, and that the size of the boxes are “b” wide by “b” tall by “length” long. Assume that the surface areas, volumes, costs to make, and incomes derived from manufacturing the boxes would be given below. Also assume that out first study is for b = 1.67, and a box length = 0.58.
You can then solve for the areas, volumes, profits, etc. by clicking on the “Calculate button”, then “Solve”:
With the result:
Thus your profit for a 1.67 foot by 1.67 foot by 0.58 foot long box will be $3.42/box.
Now, let’s say that you want to solve for the profits from a variety of box sizes, ranging from b = 0.1 foot to 4 feet. You do this by setting up a table. However, if you want b to range from 0.1 to 4 in the table, you must remove “b” from the front solution page you have been previously working on. That is to say, you cannot give him b = 1.67 on the front page, and b = 0.1 to 4 on the table page. He won’t know which one is correct. Thus, note that I have removed b = 1.67 from the front page, and am starting to build a “New Parametric Table”:
Clicking on New Parametric Table gives me:
Now I select which Variables I want output in the table. First, I have no choice but to “Add” variable “b”, since that is the thing I wish to vary. Also, the table won’t do me much good unless I add the answers for profit. And, just for grins I will also add the volume and surface area. Note that all the other variables will still be used in obtaining the solutions; they just won’t be printed out, or saved, in the table for future use (like plotting). First I highlight the things I want to be able to see, then click the Add button. I also have decided to run 10 values, or runs.
The default is 10 runs. If you want more or less, change the No. of Runs. Now hit OK to form the table.
At this time you can either type in the values of “b” that you want run, or you can have him fill them in by clicking the drop down menu arrow above the variable name (see mouse arrow above.) Clicking this gives you the following:
Click OK. This fills in the “b” values you wish to run, as shown below. Then click on Calculate, and “Solve Table”.
This allows you to run selected values in the table, should you not want to solve them all.
Hit OK. Update values means that he will use run 6’s final answers as a starting point to find answers for run 7.
There are your answers. Now let’s plot the table results. Hit Plot, New Plot Window, X-Y Plot.
The resulting box lets you enter what you want to plot.
Note I have highlighted “b” to be plotted on the x axis, and “profit” on the y axis. You can change much of the way the plot shows, including a nice “spline fit.” Hit OK.
Pretty nice! Now let’s say the boss wants to know at what box sizes we would make $2/box profit. We just go back to our original model and delete the b = 1.67, and add profit = 2.
Note that when we now hit the calculate button, we must hit “solve”, and not “solve table” since we aren’t solving a set of values from the table page, but merely a single value on the front page. Note also that the result, b = 1.125 feet, is but one of the two obvious “b’s” which would give us $2/box (see previous plot.) So what must of happened, EES started looking for a $2 profit with b around 0.1 feet, and stopped when he found the first answer. To see what values are currently being used in the solutions, click on Options, then Variable Info:
Hummm. Actually it looks like he started with a guess of b = 1. But I guess that didn’t matter. He found the first answer at b = 1.125 feet anyway. Now, let’s see if we can make him find the next answer. I tried changing his first guess for b from 1.125 to 1.126, and that was too close to the previous answer. He just gave me b = 1.125 again. So I changed the first guess to 1.5. Same result. Changed it to 2, same result. I changed it to 3, same result. Well, this is going nowhere. Maybe its the “Lower” guess of “-infinity” that’s messing me up. Change the lower guess permitted to 1.126 and try again. Nope. Same answer. How about trying Lower Limit = 1.5, and Guess = 1.5. Nope. That won’t even run, for some inexplicable reason. Finally, try b = 0.1:
With the result:
And there’s the other answer. Why? I have no idea. But since I get paid by the hour, I am not too worried about having to fiddle around with it sometimes to make him cough up an answer.
Now let’s say the boss wants to find the most profit he can make, depending on the box dimension “b”, holding the length of the box to 0.58 feet. Just for grins, I started all over, copying my model to the clipboard, closing EES, re-opening the program to make sure he lost all vestiges of our previous argument about finding that other b = 2.251 foot value. I’m not sure what values he was “guessing” at that stage, and I would just like to start all over. After starting over, this is what he says:
All right. Let’s click on Cancel (to get rid of the Variable Information), then Calculate, Min/Max:
Now we will click on “Maximize” and tell him we want to maximize “profit” using “b” as the independent variable, and click OK.
Note how I highlighted “profit” and “b.” When you hit OK, he asks you if you want to set “bounds” or “limits” on the variables used in his attempt to Maximize the profit. What the heck. I don’t know what he’s doing anyway – but I’ll hit “yes” just to see what he’s going to use:
Hummm. That -infinity doesn’t look too good, but what the heck. Try it anyway:
Great. Thanks a lot. Now hit “OK” to get out of the overflow error screen, then hit “abort” – I say
then hit “abort” – well you *^(**&^% **&%* ^(&*((* &^*((*(*^%^%%!!!!!!!
Well, click on the screen OUTSIDE of the abort box to clear the box message. Idiots. I wonder who writes this stuff. Do they just never use it themselves?
So, let’s try again. Go back and click on Calculate, then Min/Max, then “Bounds” then double click on the “-infinity” and change it to 0.0. Perhaps he was so busy trying -100,000,000 ft for b that he got confused.
Now click OK.
Well dang your nasty alligator hide! You good for nothing worthless … Still didn’t run.
And everyone who comes to my office wonders how all the paint got burned off of my monitor. Let’s try changing the Upper limit to 10. Maybe it’s the Upper limit of infinity that’s got him messed up:
Yep. That was it. So now we know that for a 0.58 foot long box, it will have to be 1.818 ft wide and high, to maximize the profit. Now what if the boss asks us what the maximum profit possible is, regardless of the length of the box? First, remove “length” from the front page, since it is no longer going to be 0.58 feet. Then click on Calculate, Min/Max, add “length” to the list of independent variables (see how he says “Select 2”? which now lets him play with both b and length in finding the most profit.) Click OK, then “yes” to set upper and lower bounds for the variables.
Change those -infinity and +infinity values to 0.0 and 100.0 or something reasonable:
Then click OK.
ALL RIGHT! That’s really neat! So if we make boxes 1.33 x 1.33 x 1.773 feet, we make the most money possible. Nifty!
USE OF IF…THEN…ELSE STATEMENTS IN EES:
{ How to use IF … THEN … ELSE statements in EES:
In EES, IF … THEN … ELSE is a procedure, not a function.
You must put the procedure FIRST, before any equations.
IF … THEN … ELSE procedures MUST be placed at the first of the model and then CALLED, after they have been defined.
Use a colon to separate the input variables that you want to INPUT INTO the procedure, from the output variables (answers) that are OUTPUT FROM the procedure. The following example of a procedure determines how many joints are needed to connect several 100 foot lengths of pipe. Note that the “then” and the “else” statements must be located as shown – I have no idea why. Note that the two input variables Lpipe = length of pipe input to the procedure and Lsegment = the length of a segment of pipe are separated by a comma, then a semi-colon, then Njoints = the number of joints required. NumberOfJoints is the “name” of the procedure, which can later be “called”.}
PROCEDURE NumberOfJoints(Lpipe, Lsegment : Njoints)
IF ( Lpipe/Lsegment-trunc(Lpipe / Lsegment ) = 0 ) then
Njoints = trunc(Lpipe / Lsegment)+1
else Njoints = trunc(Lpipe / Lsegment)+2
END
Lpipe1 = 499 {Total length of pipe H1 needed}
Lpipe2 = 500 {Total length of pipe H2 needed}
Lpipe3 = 501 {Total length of pipe H2 needed}
Lsegment = 100 {Length of pipe available for purchase}
CALL NumberOfJoints (Lpipe1,Lsegment : Njoints1) {This sends Lpipe1 and Lsegment TO the procedure and retrieves the answer Njoints1}
CALL NumberOfJoints (Lpipe2,Lsegment : Njoints2) {Same idea}
CALL NumberOfJoints (Lpipe3,Lsegment : Njoints3) {Same idea}
{ Resulting answers are Njoints = 6 joints for Lpipe1, Njoints = 6 joints for Lpipe2, and Njoints = 7 joints for Lpipe3. }