Cell[CellGroupData[{Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"crank", "[", "\[Mu]_", "]"}], ":=", RowBox[{"With", "[", RowBox[{ RowBox[{"{", RowBox[{"\[Theta]", "=", RowBox[{"\[Pi]", " ", "\[Mu]"}]}], "}"}], ",", " ", RowBox[{"{", " ", RowBox[{ RowBox[{"GrayLevel", "[", ".3", "]"}], ",", RowBox[{"Specularity", "[", RowBox[{"Red", ",", "10"}], "]"}], ",", " ", RowBox[{"Cylinder", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "0", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "1", ",", "0"}], "}"}]}], "}"}], ",", "1.5"}], "]"}], ",", RowBox[{"(*", " ", "Crankwheel", " ", "*)"}], " ", RowBox[{"Cylinder", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", RowBox[{"-", ".1"}], ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "3", ",", "0"}], "}"}]}], "}"}], ",", ".3"}], "]"}], ",", RowBox[{"(*", " ", "Crankshaft", " ", "*)"}], " ", RowBox[{"Cylinder", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"Cos", "[", RowBox[{"\[Theta]", "+", "\[Pi]"}], "]"}], ",", RowBox[{"-", ".2"}], ",", RowBox[{"Sin", "[", RowBox[{"\[Theta]", "+", "\[Pi]"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"Cos", "[", RowBox[{"\[Theta]", "+", "\[Pi]"}], "]"}], ",", "1.2", ",", RowBox[{"Sin", "[", RowBox[{"\[Theta]", "+", "\[Pi]"}], "]"}]}], "}"}]}], "}"}], ",", ".3"}], "]"}], ",", RowBox[{"(*", " ", RowBox[{"Opposite", " ", "of", " ", "hub", " ", "pin"}], " ", "*)"}], " ", RowBox[{"GrayLevel", "[", ".2", "]"}], ",", RowBox[{"Specularity", "[", RowBox[{"LightBlue", ",", "10"}], "]"}], ",", " ", RowBox[{"Cylinder", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"Cos", "[", "\[Theta]", "]"}], ",", RowBox[{"-", "1.5"}], ",", RowBox[{"Sin", "[", "\[Theta]", "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"Cos", "[", "\[Theta]", "]"}], ",", "1.2", ",", RowBox[{"Sin", "[", "\[Theta]", "]"}]}], "}"}]}], "}"}], ",", ".3"}], "]"}]}], " ", RowBox[{"(*", " ", RowBox[{"Hub", " ", "pin"}], " ", "*)"}], " ", "}"}]}], "]"}]}], ";"}], " ", RowBox[{ RowBox[{ RowBox[{ RowBox[{"mz", "[", "\[Theta]_", "]"}], ":=", RowBox[{ RowBox[{"(", SqrtBox[ RowBox[{"25", "-", SuperscriptBox[ RowBox[{"Cos", "[", "\[Theta]", "]"}], "2"]}]], ")"}], "+", RowBox[{"Sin", "[", "\[Theta]", "]"}]}]}], ";"}], RowBox[{"(*", " ", RowBox[{"Master", " ", "rod", " ", "z", " ", "coordinates"}], " ", "*)"}]}], " ", RowBox[{ RowBox[{ RowBox[{ RowBox[{"md", "[", "\[Theta]_", "]"}], ":=", RowBox[{"ArcSin", "[", FractionBox[ RowBox[{"Cos", "[", "\[Theta]", "]"}], "5."], "]"}]}], ";"}], " ", RowBox[{"(*", " ", RowBox[{"Master", " ", "rod", " ", "angle"}], " ", "*)"}]}], " ", RowBox[{ RowBox[{ RowBox[{ RowBox[{"hub", "[", "\[Mu]_", "]"}], ":=", RowBox[{"With", "[", RowBox[{ RowBox[{"{", RowBox[{"\[Theta]", "=", RowBox[{"\[Pi]", " ", "\[Mu]"}]}], "}"}], ",", " ", RowBox[{"{", " ", RowBox[{ RowBox[{"GrayLevel", "[", ".2", "]"}], ",", RowBox[{"Specularity", "[", RowBox[{"LightBlue", ",", "10"}], "]"}], ",", " ", RowBox[{"Cylinder", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"Cos", "[", "\[Theta]", "]"}], ",", RowBox[{"-", ".6"}], ",", RowBox[{"Sin", "[", "\[Theta]", "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"Cos", "[", "\[Theta]", "]"}], ",", RowBox[{"-", ".4"}], ",", RowBox[{"Sin", "[", "\[Theta]", "]"}]}], "}"}]}], "}"}], ",", "1.4"}], "]"}], ",", " ", RowBox[{"Cylinder", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"Cos", "[", "\[Theta]", "]"}], ",", RowBox[{"-", "1.4"}], ",", RowBox[{"Sin", "[", "\[Theta]", "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"Cos", "[", "\[Theta]", "]"}], ",", RowBox[{"-", "1.2"}], ",", RowBox[{"Sin", "[", "\[Theta]", "]"}]}], "}"}]}], "}"}], ",", "1.4"}], "]"}]}], " ", "}"}]}], "]"}]}], ";"}], RowBox[{"(*", " ", "Hub", " ", "*)"}]}], " ", RowBox[{ RowBox[{ RowBox[{ RowBox[{"rc", "[", RowBox[{"\[Theta]_", ",", "k_", ",", "n_"}], "]"}], ":=", RowBox[{ RowBox[{"RotationTransform", "[", RowBox[{ RowBox[{ FractionBox["\[Pi]", "2"], "+", RowBox[{"md", "[", "\[Theta]", "]"}], "+", FractionBox[ RowBox[{"2", " ", "\[Pi]", " ", RowBox[{"(", RowBox[{"k", "-", "1"}], ")"}]}], "n"]}], ",", RowBox[{"{", RowBox[{"0", ",", RowBox[{"-", "1"}], ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"Cos", "[", "\[Theta]", "]"}], ",", "0", ",", RowBox[{"Sin", "[", "\[Theta]", "]"}]}], "}"}]}], "]"}], "[", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"Cos", "[", "\[Theta]", "]"}], "+", "1"}], ",", "0", ",", RowBox[{"Sin", "[", "\[Theta]", "]"}]}], "}"}], "]"}]}], ";"}], RowBox[{"(*", " ", RowBox[{"Rod", " ", "connector", " ", "center"}], " ", "*)"}]}], " ", RowBox[{ RowBox[{ RowBox[{ RowBox[{"acf", "[", RowBox[{"\[Theta]_", ",", "k_", ",", "n_"}], "]"}], ":=", RowBox[{"With", "[", RowBox[{ RowBox[{"{", RowBox[{"\[Rho]", "=", RowBox[{ FractionBox[ RowBox[{"2", " ", "\[Pi]", " ", RowBox[{"(", RowBox[{"k", "-", "1"}], ")"}]}], "n"], "+", FractionBox["\[Pi]", "2"]}]}], "}"}], ",", " ", RowBox[{"Quiet", "@", RowBox[{ RowBox[{"Solve", "[", RowBox[{ RowBox[{ RowBox[{"Norm", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"r", " ", RowBox[{"Cos", "[", "\[Rho]", "]"}]}], ",", "0", ",", RowBox[{"r", " ", RowBox[{"Sin", "[", "\[Rho]", "]"}]}]}], "}"}], "-", RowBox[{"rc", "[", RowBox[{"\[Theta]", ",", "k", ",", "n"}], "]"}]}], "]"}], "==", "4"}], ",", "r"}], "]"}], "[", RowBox[{"[", RowBox[{"2", ",", "1", ",", "2"}], "]"}], "]"}]}]}], " ", "]"}]}], ";"}], RowBox[{"(*", " ", RowBox[{ "Articulate", " ", "rod", " ", "coordinate", " ", "factor"}], " ", "*)"}]}], " ", RowBox[{ RowBox[{ RowBox[{"cylinders", "[", RowBox[{"\[Mu]_", ",", "n_", ",", "c_", ",", "l_"}], "]"}], ":=", RowBox[{"With", "[", RowBox[{ RowBox[{"{", RowBox[{"\[Theta]", "=", RowBox[{"\[Pi]", " ", "\[Mu]"}]}], "}"}], ",", " ", RowBox[{"{", " ", RowBox[{"Table", "[", " ", RowBox[{ RowBox[{"With", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"p", "=", RowBox[{"rc", "[", RowBox[{"\[Theta]", ",", "i", ",", "n"}], "]"}]}], ",", RowBox[{"q", "=", RowBox[{"{", RowBox[{ RowBox[{"Cos", "[", RowBox[{ FractionBox[ RowBox[{"2", " ", "\[Pi]", " ", RowBox[{"(", RowBox[{"i", "-", "1"}], ")"}]}], "n"], "+", FractionBox["\[Pi]", "2"]}], "]"}], ",", "0", ",", RowBox[{"Sin", "[", RowBox[{ FractionBox[ RowBox[{"2", " ", "\[Pi]", " ", RowBox[{"(", RowBox[{"i", "-", "1"}], ")"}]}], "n"], "+", FractionBox["\[Pi]", "2"]}], "]"}]}], "}"}]}], ",", RowBox[{"r", "=", RowBox[{"acf", "[", RowBox[{"\[Theta]", ",", "i", ",", "n"}], "]"}]}]}], "}"}], ",", " ", RowBox[{"{", RowBox[{ RowBox[{"FaceForm", "[", RowBox[{ RowBox[{"Directive", "[", RowBox[{"LightBlue", ",", RowBox[{"Specularity", "[", RowBox[{"White", ",", "50"}], "]"}]}], "]"}], ",", "Black"}], "]"}], ",", " ", RowBox[{"If", "[", RowBox[{ RowBox[{"i", "==", "1"}], ",", " ", RowBox[{"{", RowBox[{ RowBox[{"Cylinder", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"p", "+", RowBox[{"{", RowBox[{"0", ",", RowBox[{"-", "1.3"}], ",", "0"}], "}"}]}], ",", RowBox[{"p", "+", RowBox[{"{", RowBox[{"0", ",", RowBox[{"-", ".5"}], ",", "0"}], "}"}]}]}], "}"}], ",", ".2"}], "]"}], " ", ",", " ", RowBox[{"Cylinder", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"Cos", "[", "\[Theta]", "]"}], ",", RowBox[{"-", ".9"}], ",", RowBox[{"Sin", "[", "\[Theta]", "]"}]}], "}"}], ",", RowBox[{ RowBox[{"r", " ", "q"}], "+", RowBox[{"{", RowBox[{"0", ",", RowBox[{"-", ".9"}], ",", "0"}], "}"}]}]}], "}"}], ",", ".2"}], "]"}]}], "}"}], ",", " ", RowBox[{"{", RowBox[{ RowBox[{"Cylinder", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"p", "+", RowBox[{"{", RowBox[{"0", ",", RowBox[{"-", "1.5"}], ",", "0"}], "}"}]}], ",", RowBox[{"p", "+", RowBox[{"{", RowBox[{"0", ",", RowBox[{"-", ".3"}], ",", "0"}], "}"}]}]}], "}"}], ",", ".2"}], "]"}], ",", " ", RowBox[{"Cylinder", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"p", "+", RowBox[{"{", RowBox[{"0", ",", RowBox[{"-", ".9"}], ",", "0"}], "}"}]}], ",", RowBox[{ RowBox[{"r", " ", "q"}], "+", RowBox[{"{", RowBox[{"0", ",", RowBox[{"-", ".9"}], ",", "0"}], "}"}]}]}], "}"}], ",", ".2"}], "]"}]}], "}"}]}], " ", "]"}], ",", RowBox[{"(*", " ", RowBox[{"Rod", " ", "and", " ", "pin"}], " ", "*)"}], " ", RowBox[{"Cylinder", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"p", "+", RowBox[{"{", RowBox[{"0", ",", RowBox[{"-", ".9"}], ",", "0"}], "}"}]}], ",", RowBox[{ RowBox[{"r", " ", "q"}], "+", RowBox[{"{", RowBox[{"0", ",", RowBox[{"-", ".9"}], ",", "0"}], "}"}]}]}], "}"}], ",", ".2"}], "]"}], ",", RowBox[{"(*", " ", "Rod", " ", "*)"}], " ", RowBox[{"Cylinder", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"r", " ", "q"}], "+", RowBox[{"{", RowBox[{"0", ",", RowBox[{"-", "1.9"}], ",", "0"}], "}"}]}], ",", RowBox[{ RowBox[{"r", " ", "q"}], "+", RowBox[{"{", RowBox[{"0", ",", ".1", ",", "0"}], "}"}]}]}], "}"}], ",", ".2"}], "]"}], ",", RowBox[{"(*", " ", RowBox[{"Piston", " ", "pin"}], " ", "*)"}], " ", RowBox[{"With", "[", RowBox[{ RowBox[{"{", RowBox[{"\[Nu]", "=", RowBox[{"Mod", "[", RowBox[{ RowBox[{"\[Mu]", "+", ".5", "-", RowBox[{"4", RowBox[{ RowBox[{"Mod", "[", RowBox[{ RowBox[{ RowBox[{"Ceiling", "[", RowBox[{"n", "/", "2"}], "]"}], RowBox[{"(", RowBox[{"i", "-", "1"}], ")"}]}], ",", "n"}], "]"}], "/", "n"}]}]}], ",", "4"}], "]"}]}], "}"}], ",", " ", RowBox[{"{", " ", RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{ ".8", "<=", "\[Nu]", "<=", "1.2"}], ",", " ", RowBox[{"Directive", "[", RowBox[{ RowBox[{"RGBColor", "[", RowBox[{"0.13", ",", "0.25", ",", "0.35"}], "]"}], ",", RowBox[{"Specularity", "[", RowBox[{"Green", ",", "30"}], "]"}], ",", RowBox[{"Glow", "[", RowBox[{"RGBColor", "[", RowBox[{ FractionBox["1", "2"], ",", "0", ",", "0"}], "]"}], "]"}]}], "]"}], ",", " ", RowBox[{"Directive", "[", RowBox[{ RowBox[{"RGBColor", "[", RowBox[{"0.13", ",", "0.25", ",", "0.35"}], "]"}], ",", RowBox[{"Specularity", "[", RowBox[{"Green", ",", "30"}], "]"}]}], "]"}]}], " ", "]"}], ",", " ", RowBox[{"Cylinder", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{ RowBox[{"(", RowBox[{"r", "-", ".4"}], ")"}], "q"}], "+", RowBox[{"{", RowBox[{"0", ",", RowBox[{"-", ".9"}], ",", "0"}], "}"}]}], ",", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{"r", "+", "1"}], ")"}], "q"}], "+", RowBox[{"{", RowBox[{"0", ",", RowBox[{"-", ".9"}], ",", "0"}], "}"}]}]}], "}"}], ",", "1"}], "]"}], ",", RowBox[{"(*", " ", RowBox[{"Piston", " ", "head"}], " ", "*)"}], " ", RowBox[{"If", "[", RowBox[{"l", ",", RowBox[{"{", " ", RowBox[{ RowBox[{"Which", "[", RowBox[{ RowBox[{"0", "<=", "\[Nu]", "<", "1"}], ",", "Orange", ",", RowBox[{"1", "<=", "\[Nu]", "<", "2"}], ",", "Red", ",", RowBox[{"2", "<=", "\[Nu]", "<", "3"}], ",", "Blue", ",", RowBox[{"3", "<=", "\[Nu]", "<", "4"}], ",", "Yellow"}], "]"}], ",", " ", RowBox[{"Sphere", "[", RowBox[{ RowBox[{ RowBox[{"7.5", "q"}], "+", RowBox[{"{", RowBox[{"0", ",", RowBox[{"-", ".9"}], ",", "0"}], "}"}]}], ",", ".2"}], "]"}]}], " ", "}"}], ",", RowBox[{"{", "}"}]}], "]"}]}], " ", "}"}]}], "]"}], ",", " ", RowBox[{"If", "[", RowBox[{"c", ",", RowBox[{"{", RowBox[{ RowBox[{"ControlActive", "[", RowBox[{ RowBox[{"FaceForm", "[", "]"}], ",", RowBox[{"FaceForm", "[", RowBox[{ RowBox[{"Opacity", "[", ".4", "]"}], ",", "White"}], "]"}]}], "]"}], ",", RowBox[{"Cylinder", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"3.4", "q"}], "+", RowBox[{"{", RowBox[{"0", ",", RowBox[{"-", ".9"}], ",", "0"}], "}"}]}], ",", RowBox[{ RowBox[{"7.1", "q"}], "+", RowBox[{"{", RowBox[{"0", ",", RowBox[{"-", ".9"}], ",", "0"}], "}"}]}]}], "}"}], ",", "1.1"}], "]"}]}], "}"}], ",", " ", RowBox[{"{", "}"}]}], "]"}]}], RowBox[{"(*", " ", "Cylinder", " ", "*)"}], " ", "}"}]}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", "n"}], "}"}]}], "]"}], " ", "}"}]}], "]"}]}], ";"}], " ", RowBox[{ RowBox[{ RowBox[{"is", "[", "col_", "]"}], ":=", RowBox[{"Graphics", "[", RowBox[{ RowBox[{"{", RowBox[{"col", ",", RowBox[{"EdgeForm", "[", "Black", "]"}], ",", RowBox[{"Disk", "[", "]"}]}], "}"}], ",", RowBox[{"ImageSize", "->", "10"}], ",", RowBox[{"BaselinePosition", "->", "Bottom"}]}], "]"}]}], ";"}]}], "Input", CellGroupingRules->{"GroupTogetherGrouping", 10000.}, CellChangeTimes->{{3.3871253241406603`*^9, 3.3871255482031603`*^9}, { 3.3871255875625353`*^9, 3.3871256540312853`*^9}, { 3.3871258907500353`*^9, 3.3871258961562853`*^9}, { 3.3871272438750353`*^9, 3.3871272440469103`*^9}, { 3.3871276520781603`*^9, 3.3871276521875353`*^9}, { 3.3871278271094103`*^9, 3.3871278271562853`*^9}, { 3.387153282484375*^9, 3.387153398234375*^9}, {3.3871534475*^9, 3.38715348596875*^9}, {3.387153628046875*^9, 3.387153628921875*^9}, {3.38715438409375*^9, 3.387154384234375*^9}, 3.387154682625*^9, {3.387156383625*^9, 3.387156384015625*^9}, { 3.3871566798125*^9, 3.3871566883125*^9}, {3.387158171*^9, 3.387158253546875*^9}, {3.387158346171875*^9, 3.38715838434375*^9}, {3.387158547015625*^9, 3.387158550015625*^9}, {3.387162157109375*^9, 3.38716218575*^9}, 3.38716221934375*^9, {3.387162873125*^9, 3.387162914140625*^9}, { 3.387163153703125*^9, 3.387163153953125*^9}, {3.387163284140625*^9, 3.387163415125*^9}, {3.387164487640625*^9, 3.387164525640625*^9}, {3.38716520565625*^9, 3.3871652380625*^9}, { 3.3871654615625*^9, 3.3871655386875*^9}, {3.38716557334375*^9, 3.387165580875*^9}, 3.387165658078125*^9, {3.3871657995*^9, 3.387165800296875*^9}, 3.3871658303125*^9, {3.387166123921875*^9, 3.3871661486875*^9}, {3.387166220515625*^9, 3.3871662465625*^9}, 3.387166326375*^9, {3.387166383359375*^9, 3.3871663900625*^9}, { 3.387166493625*^9, 3.387166661078125*^9}, {3.38716712784375*^9, 3.38716713434375*^9}, {3.387167325953125*^9, 3.387167336046875*^9}, {3.387167572890625*^9, 3.387167590515625*^9}, 3.387167635984375*^9, {3.387167730671875*^9, 3.38716774584375*^9}, 3.38716778246875*^9, {3.38716819653125*^9, 3.38716820334375*^9}, {3.387168251515625*^9, 3.387168254015625*^9}, {3.38716839840625*^9, 3.387168426515625*^9}, {3.387168471375*^9, 3.3871684839375*^9}, {3.38716851615625*^9, 3.387168543078125*^9}, {3.387168639921875*^9, 3.38716871528125*^9}, {3.3871691570625*^9, 3.387169164625*^9}, { 3.38716920965625*^9, 3.387169215859375*^9}, {3.387169564796875*^9, 3.387169571953125*^9}, 3.38716970746875*^9, 3.387169811953125*^9, { 3.387169853125*^9, 3.38716985609375*^9}, {3.387169895390625*^9, 3.387169895671875*^9}, {3.38717024315625*^9, 3.387170245546875*^9}, {3.387170317859375*^9, 3.387170348703125*^9}, 3.387170385484375*^9, 3.387170443765625*^9, 3.3871704836875*^9, {3.38717059025*^9, 3.387170612328125*^9}, { 3.38717073421875*^9, 3.387170889796875*^9}, {3.387171013296875*^9, 3.387171059359375*^9}, {3.38717111303125*^9, 3.38717113353125*^9}, {3.387171214734375*^9, 3.38717123609375*^9}, {3.387171267296875*^9, 3.387171269578125*^9}, {3.3873045810140395`*^9, 3.3873045983423862`*^9}, 3.7607816583431683`*^9}, CellID->185491449], Cell[BoxData[ RowBox[{"Manipulate", "[", " ", RowBox[{ RowBox[{"Column", "[", RowBox[{ RowBox[{"{", " ", RowBox[{ RowBox[{"Graphics3D", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"EdgeForm", "[", RowBox[{"Opacity", "[", ".3", "]"}], "]"}], ",", RowBox[{"crank", "[", "\[Mu]", "]"}], ",", RowBox[{"hub", "[", "\[Mu]", "]"}], ",", " ", RowBox[{"cylinders", "[", RowBox[{"\[Mu]", ",", "n", ",", "c", ",", "l"}], "]"}]}], " ", "}"}], ",", RowBox[{"Lighting", "->", "\"\\""}], ",", RowBox[{"Background", "->", RowBox[{"GrayLevel", "[", ".75", "]"}]}], ",", RowBox[{"Boxed", "->", "False"}], ",", RowBox[{"PlotRange", "->", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", "10"}], ",", "10"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "3"}], ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "10"}], ",", "10"}], "}"}]}], "}"}]}], ",", RowBox[{"ViewAngle", "->", "0.23281565895710432`"}], ",", RowBox[{"ImageSize", "->", RowBox[{"{", RowBox[{"350", ",", "350"}], "}"}]}]}], "]"}], ",", " ", RowBox[{"If", "[", RowBox[{"l", ",", " ", RowBox[{"Style", "[", RowBox[{ RowBox[{"Grid", "[", RowBox[{"{", RowBox[{"{", RowBox[{ RowBox[{"is", "[", "Yellow", "]"}], ",", "\"\\"", ",", RowBox[{"is", "[", "Orange", "]"}], ",", "\"\\"", ",", RowBox[{"is", "[", "Red", "]"}], ",", "\"\\"", ",", RowBox[{"is", "[", "Blue", "]"}], ",", "\"\\""}], "}"}], "}"}], "]"}], ",", "10", ",", RowBox[{"FontFamily", "->", "\"\\""}]}], "]"}], ",", " ", RowBox[{"Invisible", "@", RowBox[{"Style", "[", RowBox[{ RowBox[{"Grid", "[", RowBox[{"{", RowBox[{"{", RowBox[{ RowBox[{"is", "[", "Yellow", "]"}], ",", "\"\\"", ",", RowBox[{"is", "[", "Orange", "]"}], ",", "\"\\"", ",", RowBox[{"is", "[", "Red", "]"}], ",", "\"\\"", ",", RowBox[{"is", "[", "Blue", "]"}], ",", "\"\\""}], "}"}], "}"}], "]"}], ",", "10", ",", RowBox[{"FontFamily", "->", "\"\\""}]}], "]"}]}]}], "]"}]}], "}"}], ",", " ", RowBox[{"Alignment", "->", RowBox[{"{", RowBox[{"Center", ",", "Center"}], "}"}]}]}], "]"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"\[Mu]", ",", "0", ",", "\"\\""}], "}"}], ",", "0", ",", "4", ",", ".05", ",", RowBox[{"ControlType", "->", "Animator"}], ",", RowBox[{"AppearanceElements", "->", RowBox[{"{", RowBox[{ "\"\\"", ",", "\"\\""}], "}"}]}], ",", RowBox[{"AnimationRunning", "->", "False"}]}], "}"}], ",", " ", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"\[Mu]", ",", "0", ",", "\"\\""}], "}"}], ",", "0", ",", "4", ",", ".05", ",", RowBox[{"ImageSize", "->", "Small"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"n", ",", "5", ",", "\"\\""}], "}"}], ",", "3", ",", "9", ",", "2", ",", RowBox[{"ControlType", "->", "RadioButton"}], ",", RowBox[{"ImageSize", "->", "Medium"}]}], "}"}], ",", " ", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"c", ",", "True", ",", "\"\\""}], "}"}], ",", RowBox[{"{", RowBox[{"True", ",", "False"}], "}"}]}], "}"}], ",", " ", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"l", ",", "False", ",", "\"\\""}], "}"}], ",", RowBox[{"{", RowBox[{"True", ",", "False"}], "}"}], ",", RowBox[{"ControlPlacement", "->", "Bottom"}]}], "}"}], ",", RowBox[{"AutorunSequencing", "->", RowBox[{"{", RowBox[{"2", ",", "3", ",", "4", ",", "5"}], "}"}]}], ",", RowBox[{"SaveDefinitions", "->", "True"}]}], "]"}]], "Input", CellGroupingRules->{"GroupTogetherGrouping", 10000.}, CellChangeTimes->{ 3.35696210375764*^9, 3.387162923640625*^9, 3.38716295946875*^9, { 3.387163078453125*^9, 3.38716313296875*^9}, {3.387163169046875*^9, 3.387163169171875*^9}, {3.38716567253125*^9, 3.3871656729375*^9}, { 3.387165969921875*^9, 3.3871660085625*^9}, {3.387167254625*^9, 3.38716725696875*^9}, {3.3871709413125*^9, 3.387170951828125*^9}, { 3.387172682265625*^9, 3.387172689453125*^9}, {3.38717272646875*^9, 3.38717274840625*^9}, {3.3873045488417525`*^9, 3.387304557138734*^9}, 3.760781658332397*^9}], Cell[BoxData[ TagBox[ StyleBox[ DynamicModuleBox[{$CellContext`c$$ = True, $CellContext`l$$ = False, $CellContext`n$$ = 5, $CellContext`\[Mu]$$ = 0, Typeset`show$$ = True, Typeset`bookmarkList$$ = {}, Typeset`bookmarkMode$$ = "Menu", Typeset`animator$$, Typeset`animvar$$ = 1, Typeset`name$$ = "\"untitled\"", Typeset`specs$$ = {{{ Hold[$CellContext`\[Mu]$$], 0, "animate"}, 0, 4, 0.05}, {{ Hold[$CellContext`\[Mu]$$], 0, "cycle"}, 0, 4, 0.05}, {{ Hold[$CellContext`n$$], 5, "number of cylinders"}, 3, 9, 2}, {{ Hold[$CellContext`c$$], True, "draw cylinders"}, { True, False}}, {{ Hold[$CellContext`l$$], False, "show cycles"}, {True, False}}}, Typeset`size$$ = {350., {181.5, 186.5}}, Typeset`update$$ = 0, Typeset`initDone$$, Typeset`skipInitDone$$ = False, $CellContext`\[Mu]$1664$$ = 0, $CellContext`n$1665$$ = 0, $CellContext`c$1666$$ = False, $CellContext`l$1667$$ = False}, DynamicBox[Manipulate`ManipulateBoxes[ 1, StandardForm, "Variables" :> {$CellContext`c$$ = True, $CellContext`l$$ = False, $CellContext`n$$ = 5, $CellContext`\[Mu]$$ = 0}, "ControllerVariables" :> { Hold[$CellContext`\[Mu]$$, $CellContext`\[Mu]$1664$$, 0], Hold[$CellContext`n$$, $CellContext`n$1665$$, 0], Hold[$CellContext`c$$, $CellContext`c$1666$$, False], Hold[$CellContext`l$$, $CellContext`l$1667$$, False]}, "OtherVariables" :> { Typeset`show$$, Typeset`bookmarkList$$, Typeset`bookmarkMode$$, Typeset`animator$$, Typeset`animvar$$, Typeset`name$$, Typeset`specs$$, Typeset`size$$, Typeset`update$$, Typeset`initDone$$, Typeset`skipInitDone$$}, "Body" :> Column[{ Graphics3D[{ EdgeForm[ Opacity[0.3]], $CellContext`crank[$CellContext`\[Mu]$$], $CellContext`hub[$CellContext`\[Mu]$$], $CellContext`cylinders[$CellContext`\[Mu]$$, \ $CellContext`n$$, $CellContext`c$$, $CellContext`l$$]}, Lighting -> "Neutral", Background -> GrayLevel[0.75], Boxed -> False, PlotRange -> {{-10, 10}, {-3, 3}, {-10, 10}}, ViewAngle -> 0.23281565895710432`, ImageSize -> {350, 350}], If[$CellContext`l$$, Style[ Grid[{{ $CellContext`is[Yellow], "Intake ", $CellContext`is[Orange], "Compression ", $CellContext`is[Red], "Combustion ", $CellContext`is[Blue], "Exhaust "}}], 10, FontFamily -> "Helvetica"], Invisible[ Style[ Grid[{{ $CellContext`is[Yellow], "Intake ", $CellContext`is[Orange], "Compression ", $CellContext`is[Red], "Combustion ", $CellContext`is[Blue], "Exhaust "}}], 10, FontFamily -> "Helvetica"]]]}, Alignment -> {Center, Center}], "Specifications" :> {{{$CellContext`\[Mu]$$, 0, "animate"}, 0, 4, 0.05, ControlType -> Animator, AppearanceElements -> { "PlayPauseButton", "FasterSlowerButtons"}, AnimationRunning -> False}, {{$CellContext`\[Mu]$$, 0, "cycle"}, 0, 4, 0.05, ImageSize -> Small}, {{$CellContext`n$$, 5, "number of cylinders"}, 3, 9, 2, ControlType -> RadioButton, ImageSize -> Medium}, {{$CellContext`c$$, True, "draw cylinders"}, { True, False}}, {{$CellContext`l$$, False, "show cycles"}, { True, False}, ControlPlacement -> Bottom}}, "Options" :> {AutorunSequencing -> {2, 3, 4, 5}}, "DefaultOptions" :> {ControllerLinking -> True}], ImageSizeCache->{395., {275., 281.}}, SingleEvaluation->True], Deinitialization:>None, DynamicModuleValues:>{}, Initialization:>({$CellContext`crank[ Pattern[$CellContext`\[Mu], Blank[]]] := With[{$CellContext`\[Theta] = Pi $CellContext`\[Mu]}, { GrayLevel[0.3], Specularity[Red, 10], Cylinder[{{0, 0, 0}, {0, 1, 0}}, 1.5], Cylinder[{{0, -0.1, 0}, {0, 3, 0}}, 0.3], Cylinder[{{ Cos[$CellContext`\[Theta] + Pi], -0.2, Sin[$CellContext`\[Theta] + Pi]}, { Cos[$CellContext`\[Theta] + Pi], 1.2, Sin[$CellContext`\[Theta] + Pi]}}, 0.3], GrayLevel[0.2], Specularity[LightBlue, 10], Cylinder[{{ Cos[$CellContext`\[Theta]], -1.5, Sin[$CellContext`\[Theta]]}, { Cos[$CellContext`\[Theta]], 1.2, Sin[$CellContext`\[Theta]]}}, 0.3]}], $CellContext`hub[ Pattern[$CellContext`\[Mu], Blank[]]] := With[{$CellContext`\[Theta] = Pi $CellContext`\[Mu]}, { GrayLevel[0.2], Specularity[LightBlue, 10], Cylinder[{{ Cos[$CellContext`\[Theta]], -0.6, Sin[$CellContext`\[Theta]]}, { Cos[$CellContext`\[Theta]], -0.4, Sin[$CellContext`\[Theta]]}}, 1.4], Cylinder[{{ Cos[$CellContext`\[Theta]], -1.4, Sin[$CellContext`\[Theta]]}, { Cos[$CellContext`\[Theta]], -1.2, Sin[$CellContext`\[Theta]]}}, 1.4]}], $CellContext`cylinders[ Pattern[$CellContext`\[Mu], Blank[]], Pattern[$CellContext`n, Blank[]], Pattern[$CellContext`c, Blank[]]] := With[{$CellContext`\[Theta] = Pi $CellContext`\[Mu]}, { Table[ With[{$CellContext`p = $CellContext`rc[$CellContext`\ \[Theta], $CellContext`i, $CellContext`n], $CellContext`q = { Cos[(2 Pi) (($CellContext`i - 1)/$CellContext`n) + Pi/2], 0, Sin[(2 Pi) (($CellContext`i - 1)/$CellContext`n) + Pi/2]}, $CellContext`r = \ $CellContext`acf[$CellContext`\[Theta], $CellContext`i, \ $CellContext`n]}, { FaceForm[ Directive[LightBlue, Specularity[White, 50]], Black], If[$CellContext`i == 1, Cylinder[{$CellContext`p + { 0, -1.3, 0}, $CellContext`p + {0, -0.5, 0}}, 0.2], Cylinder[{$CellContext`p + { 0, -1.5, 0}, $CellContext`p + {0, -0.3, 0}}, 0.2]], Cylinder[{$CellContext`p + { 0, -0.9, 0}, $CellContext`r $CellContext`q + { 0, -0.9, 0}}, 0.2], Cylinder[{$CellContext`r $CellContext`q + { 0, -1.9, 0}, $CellContext`r $CellContext`q + { 0, 0.1, 0}}, 0.2], Darker[ ColorData["HTML"]["SteelBlue"], 0.5], Specularity[Green, 30], Cylinder[{($CellContext`r - 0.4) $CellContext`q + { 0, -0.9, 0}, ($CellContext`r + 1) $CellContext`q + { 0, -0.9, 0}}, 1], If[$CellContext`c, { ControlActive[ FaceForm[], FaceForm[ Opacity[0.4], White]], Cylinder[{ 3.4 $CellContext`q + {0, -0.9, 0}, 7.1 $CellContext`q + {0, -0.9, 0}}, 1.1]}, {}], Sphere[ 7.5 $CellContext`q + {0, -0.9, 0}, 0.2]}], {$CellContext`i, $CellContext`n}]}], \ $CellContext`cylinders[ Pattern[$CellContext`\[Mu], Blank[]], Pattern[$CellContext`n, Blank[]], Pattern[$CellContext`c, Blank[]], Pattern[$CellContext`l, Blank[]]] := With[{$CellContext`\[Theta] = Pi $CellContext`\[Mu]}, { Table[ With[{$CellContext`p = $CellContext`rc[$CellContext`\ \[Theta], $CellContext`i, $CellContext`n], $CellContext`q = { Cos[((2 Pi) ($CellContext`i - 1))/$CellContext`n + Pi/2], 0, Sin[((2 Pi) ($CellContext`i - 1))/$CellContext`n + Pi/2]}, $CellContext`r = \ $CellContext`acf[$CellContext`\[Theta], $CellContext`i, \ $CellContext`n]}, { FaceForm[ Directive[LightBlue, Specularity[White, 50]], Black], If[$CellContext`i == 1, { Cylinder[{$CellContext`p + { 0, -1.3, 0}, $CellContext`p + {0, -0.5, 0}}, 0.2], Cylinder[{{ Cos[$CellContext`\[Theta]], -0.9, Sin[$CellContext`\[Theta]]}, $CellContext`r \ $CellContext`q + {0, -0.9, 0}}, 0.2]}, { Cylinder[{$CellContext`p + { 0, -1.5, 0}, $CellContext`p + {0, -0.3, 0}}, 0.2], Cylinder[{$CellContext`p + { 0, -0.9, 0}, $CellContext`r $CellContext`q + { 0, -0.9, 0}}, 0.2]}], Cylinder[{$CellContext`p + { 0, -0.9, 0}, $CellContext`r $CellContext`q + { 0, -0.9, 0}}, 0.2], Cylinder[{$CellContext`r $CellContext`q + { 0, -1.9, 0}, $CellContext`r $CellContext`q + { 0, 0.1, 0}}, 0.2], With[{$CellContext`\[Nu] = Mod[$CellContext`\[Mu] + 0.5 - 4 (Mod[ Ceiling[$CellContext`n/2] ($CellContext`i - 1), $CellContext`n]/$CellContext`n), 4]}, { If[0.8 <= $CellContext`\[Nu] <= 1.2, Directive[ RGBColor[0.13, 0.25, 0.35], Specularity[Green, 30], Glow[ RGBColor[1/2, 0, 0]]], Directive[ RGBColor[0.13, 0.25, 0.35], Specularity[Green, 30]]], Cylinder[{($CellContext`r - 0.4) $CellContext`q + { 0, -0.9, 0}, ($CellContext`r + 1) $CellContext`q + { 0, -0.9, 0}}, 1], If[$CellContext`l, { Which[ Inequality[ 0, LessEqual, $CellContext`\[Nu], Less, 1], Orange, Inequality[ 1, LessEqual, $CellContext`\[Nu], Less, 2], Red, Inequality[ 2, LessEqual, $CellContext`\[Nu], Less, 3], Blue, Inequality[ 3, LessEqual, $CellContext`\[Nu], Less, 4], Yellow], Sphere[ 7.5 $CellContext`q + {0, -0.9, 0}, 0.2]}, {}]}], If[$CellContext`c, { ControlActive[ FaceForm[], FaceForm[ Opacity[0.4], White]], Cylinder[{ 3.4 $CellContext`q + {0, -0.9, 0}, 7.1 $CellContext`q + {0, -0.9, 0}}, 1.1]}, {}]}], {$CellContext`i, $CellContext`n}]}], \ $CellContext`rc[ Pattern[$CellContext`\[Theta], Blank[]], Pattern[$CellContext`k, Blank[]], Pattern[$CellContext`n, Blank[]]] := RotationTransform[ Pi/2 + $CellContext`md[$CellContext`\[Theta]] + ((2 Pi) ($CellContext`k - 1))/$CellContext`n, {0, -1, 0}, { Cos[$CellContext`\[Theta]], 0, Sin[$CellContext`\[Theta]]}][{ Cos[$CellContext`\[Theta]] + 1, 0, Sin[$CellContext`\[Theta]]}], $CellContext`md[ Pattern[$CellContext`\[Theta], Blank[]]] := ArcSin[Cos[$CellContext`\[Theta]]/5.], $CellContext`acf[ Pattern[$CellContext`\[Theta], Blank[]], Pattern[$CellContext`k, Blank[]], Pattern[$CellContext`n, Blank[]]] := With[{$CellContext`\[Rho] = ((2 Pi) ($CellContext`k - 1))/$CellContext`n + Pi/2}, Quiet[ Part[ Solve[ Norm[{$CellContext`r Cos[$CellContext`\[Rho]], 0, $CellContext`r Sin[$CellContext`\[Rho]]} - \ $CellContext`rc[$CellContext`\[Theta], $CellContext`k, \ $CellContext`n]] == 4, $CellContext`r], 2, 1, 2]]], Attributes[PlotRange] = {ReadProtected}, $CellContext`is[ Pattern[$CellContext`col, Blank[]]] := Graphics[{$CellContext`col, EdgeForm[Black], Disk[]}, ImageSize -> 10, BaselinePosition -> Bottom]}; Typeset`initDone$$ = True), SynchronousInitialization->True, UnsavedVariables:>{Typeset`initDone$$}, UntrackedVariables:>{Typeset`size$$}], "Manipulate", Deployed->True, StripOnInput->False], Manipulate`InterpretManipulate[1]]], "Output", CellGroupingRules->{"GroupTogetherGrouping", 10000.}, CellChangeTimes->{3.760781658332697*^9}, CellID->435085593] }, {3}]]