LearningGuide

# For command calling sequence information refer to the

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ght(2..5, 2), Weight(0..1, 20), Weight(−5.. − 2, 0), Weight(−2.. − 1, 5), Weight(1..2, 5), Weight(−1..0, 18)] &gt; statplots[histogram](data_list); 20 15 10 5 –6 –4 –2 0 2 4 6 4.2 The Maple Packages • 101 The simplex Linear Optimization Package The simplex package contains commands for linear optimization, using the simplex algorithm. Linear optimization involves ﬁnding optimal solutions to equations under constraints. An example of a classic optimization problem is the pizza delivery problem. You have four pizzas to deliver, to four diﬀerent places, spread throughout the city. You want to deliver all four using as little gas as possible. You also must get to all four locations in under twenty minutes, so that the pizzas stay hot. If you can create mathematical equations representing the routes to the four places and the distances, you can ﬁnd the optimal solution. That is, you can determine what route you should take to get to all four places in as little time and using as little gas as possible. The constraints on this particular system are that you have to deliver all four pizzas within twenty minutes of leaving the restaurant. Here is a very small system as an example. &gt; with(simplex); Warning, the name basis has been redefined Warning, the protected names maximize and minimize have been redefined and unprotected [basis , convexhull , cterm , deﬁne _zero , display , dual , feasible , maximize , minimize , pivot , pivoteqn , pivotvar , ratio , setup , standardize ] To maximize the expression w, enter &gt;w := -x+y+2*z; w := −x + y + 2 z subject to the constraints c1, c2, and c3. &gt; c1 := 3*x+4*y-3*z &lt;= 23; c1 := 3 x + 4 y − 3 z ≤ 23 &gt; c2 := 5*x-4*y-3*z &lt;= 10; c2 := 5 x − 4 y − 3 z ≤ 10 102 • Chapter 4: Maple Organization &gt; c3 := 7*x +4*y+11*z &lt;= 30; c3 := 7 x + 4 y + 11 z ≤ 30 &gt; maximize(w, {c1,c2,c3}); In this case, no answer means that Maple cannot ﬁnd a solution. You can use the feasible command to determine if the set of constraints is valid. &gt; feasible({c1,c2,c3}); true Try again and place an additional restriction on the solution. &gt; maximize(w, {c1,c2,c3}, NONNEGATIVE); 49 1 {z = , y = , x = 0} 2 8 4.3 Conclusion This chapter introduced the organization of Maple and the Maple library. Additionally, examples from ﬁve packages were provided. This information serves as context for references and concepts in the following chapters. 5 Plotting Maple can produce several forms of graphs. Maple accepts explicit, implicit, and parametric forms, and recognizes many coordinate systems. In This Chapter • Graphing in two dimensions • Graphing in three dimensions • Animation • Annotating plots • Composite plots • Special plots • Manipulating graphical objects • Code for color plates • Interactive plot builder Plotting Commands in Main Maple Library The command-line plotting feature of Maple contains plotting functions in the main library and in packages. The plot and plot3d commands reside in the main Maple library. The...
View Full Document

## This note was uploaded on 08/27/2012 for the course MATH 1100 taught by Professor Nil during the Spring '12 term at National University of Singapore.

Ask a homework question - tutors are online