The Wire Problem

Manipulate[
square=Graphics[{Blue,Thick,Line[{{3.5-x/8,1.5-x/8},{3.5-x/8,1.5+x/8},{3.5+x/8,1.5+x/8},{3.5+x/8,1.5-x/8},{3.5-x/8,1.5-x/8}}]}];
circle=Graphics[{Red,Thick,Circle[{6,1.5},(10-x)/(2Pi)]}];
equilateral1=Graphics[{Green,Thick,Line[{{6-(10-x)/6,0.5},{6+(10-x)/6,0.5},{6,Sqrt[3](10-x)/6+0.5},{6-(10-x)/6,0.5}}]}];
equilateral2=Graphics[{Green,Thick,Line[{{4-x/6,0.5},{4+x/6,0.5},{4,0.5+Sqrt[3]x/6},{4-x/6,0.5}}]}];

TotalArea1[x_]:=x^2/16+Pi*((10-x)/(2Pi))^2;
TotalArea2[x_]:=x^2/16+1/2*(10-x)/3*Sqrt[3](10-x)/6;
TotalArea3[x_]:=1/2*x/3*Sqrt[3]x/6+Pi*((10-x)/(2Pi))^2;

Switch[figs,1,area[x_]:=TotalArea1[x];figure1=square;figure2=circle;fig1="square";fig2="circle";color1=Blue;color2=Red,
2,area[x_]:=TotalArea2[x];figure1=square;figure2=equilateral1;fig1="square";fig2="triangle";color1=Blue;color2=Green,
3,area[x_]:=TotalArea3[x];figure1=equilateral2;figure2=circle;fig1="triangle";fig2="circle";color1=Green;color2=Red];

pointOnTotalAreaCurve=Graphics[{PointSize[Large],Point[{x,area[x]}]}];
TotalAreaPlot=Plot[area[x],{x,0,10},PlotRange->{0,9},AxesLabel->{Style["x",Italic],None},PlotLabel->Style[Row[{"total area = ",area[x]}],18],ImageSize->270];
wire1=Graphics[{color1,Thick,Line[{{0,4},{x,4}}]}];
wire2=Graphics[{color2,Thick,Line[{{x,4},{10,4}}]}];
pointOnWire=Graphics[{PointSize[Large],Point[{x,4}]}];

Text@Pane[

Grid[{{
Column[{Style[Row[{"length of wire to ",fig1,", ",Style["x",Italic]," = ",x}],14],Style[Row[{"length of wire to ",fig2," = ",10-x}],14]," ",
Show[figure1,figure2,wire1,wire2,pointOnWire,Axes->{True,False},AxesOrigin->{0,3.9},PlotRange->{{0,10},{-0.2,4.2}},ImageSize->300]}],Show[TotalAreaPlot,pointOnTotalAreaCurve]}}],ImageSize->{580,200}],

{{figs,1,"figures"},{1->"square and circle",2->"square and triangle",3->"triangle and circle"}},
{{x,5.5},0,10},
TrackedSymbols->True]

CAPTION

A standard optimization problem in first-semester calculus is to maximize and minimize the total area of two geometric figures made from a fixed length of wire cut into two pieces. This Demonstration illustrates that problem using a wire of length 10 and three pairs of geometric figures.

THIS NOTEBOOK IS THE SOURCE CODE FROM

"The Wire Problem" from the Wolfram Demonstrations Project
 http://demonstrations.wolfram.com/TheWireProblem/

Contributed by: Marc Brodie (Wheeling Jesuit University)

A full-function Wolfram Mathematica system (Version 6 or higher) is required to edit this notebook.
GET WOLFRAM MATHEMATICA »

© Wolfram Demonstrations Project & Contributors   |   Terms of Use   |   Make a new version of this Demonstration »