RectangleWave[ ] Notebook containing the definitions for who ever will need it
- To: mathgroup at smc.vnet.net
- Subject: [mg118323] RectangleWave[ ] Notebook containing the definitions for who ever will need it
- From: roby <roby.nowak at gmail.com>
- Date: Thu, 21 Apr 2011 03:13:34 -0400 (EDT)
Notebook[{ Cell[CellGroupData[{ Cell["RectangleWave", "Section", CellChangeTimes->{{3.512286263806546*^9, 3.5122862689933825`*^9}}], Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"RectangleWave", "::", "usage"}], "=", RowBox[{"\"\<RectangleWave[{\!\(\*SubscriptBox[ StyleBox[\"x\", \"TI\"], StyleBox[\"1\", \"TR\"]]\),\!\(\*SubscriptBox[ StyleBox[\"x\", \"TI\"], StyleBox[\"2\", \"TR\"]]\)},\!\(\* StyleBox[\"x\", \"TI\"]\)] gives a rectangele wave that alternates \ between +1 and -1 with semiperiods \!\(\*SubscriptBox[ StyleBox[\"x\", \"TI\"], StyleBox[\"1\", \"TR\"]]\) and \!\(\*SubscriptBox[ StyleBox[\"x\", \"TI\"], StyleBox[\"2\", \"TR\"]]\).\\n\>\"", "<>", "\n", "\"\<RectangleWave[{\!\(\*SubscriptBox[ StyleBox[\"y\", \"TI\"], StyleBox[\"1\", \"TR\"]]\),\!\(\*SubscriptBox[ StyleBox[\"y\", \"TI\"], StyleBox[\"2\", \"TR\"]]\)},{\!\(\*SubscriptBox[ StyleBox[\"x\", \"TI\"], StyleBox[\"1\", \"TR\"]]\),\!\(\*SubscriptBox[ StyleBox[\"x\", \"TI\"], StyleBox[\"2\", \"TR\"]]\)},\!\(\* StyleBox[\"x\", \"TI\"]\)] gives a rectangele wave that alternates \ between \!\(\*SubscriptBox[ StyleBox[\"y\", \"TI\"], StyleBox[\"1\", \"TR\"]]\) and \!\(\*SubscriptBox[ StyleBox[\"y\", \"TI\"], StyleBox[\"2\", \"TR\"]]\) with semiperiods \!\(\*SubscriptBox[ StyleBox[\"x\", \"TI\"], StyleBox[\"1\", \"TR\"]]\) and \!\(\*SubscriptBox[ StyleBox[\"x\", \"TI\"], StyleBox[\"2\", \"TR\"]]\).\\n\>\"", "<>", "\n", "\"\<RectangleWave[\!\(\* StyleBox[\"f\", \"TI\"]\),\!\(\* StyleBox[\"x\", \"TI\"]\)] gives a rectangele wave that alternates \ between +1 and -1 with semiperiods \!\(\* StyleBox[\"f\", \"TI\"]\) and 1-\!\(\* StyleBox[\"f\", \"TI\"]\), 0<=\!\(\* StyleBox[\"f\", \"TI\"]\)<=1\\n\>\"", "<>", "\n", "\"\<RectangleWave[{\!\(\*SubscriptBox[ StyleBox[\"y\", \"TI\"], StyleBox[\"1\", \"TR\"]]\),\!\(\*SubscriptBox[ StyleBox[\"y\", \"TI\"], StyleBox[\"2\", \"TR\"]]\)},\!\(\* StyleBox[\"f\", \"TI\"]\),\!\(\* StyleBox[\"x\", \"TI\"]\)] gives a rectangele wave that alternates \ between \!\(\*SubscriptBox[ StyleBox[\"y\", \"TI\"], StyleBox[\"1\", \"TR\"]]\) and \!\(\*SubscriptBox[ StyleBox[\"y\", \"TI\"], StyleBox[\"2\", \"TR\"]]\) with semiperiods \!\(\* StyleBox[\"f\", \"TI\"]\) and 1-\!\(\* StyleBox[\"f\", \"TI\"]\), 0<=\!\(\* StyleBox[\"f\", \"TI\"]\)<=1\\n\>\""}]}], ";"}], "\n", RowBox[{ RowBox[{ RowBox[{"RectangleWave", "[", RowBox[{ RowBox[{"xp", ":", RowBox[{"{", RowBox[{"x1_", ",", "x2_"}], "}"}]}], ",", RowBox[{"yr", ":", RowBox[{ RowBox[{"{", RowBox[{"y1_", ",", "y2_"}], "}"}], ":", RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "1"}], "}"}]}]}], ",", "x_"}], "]"}], ":=", RowBox[{"Piecewise", "[", RowBox[{ RowBox[{"{", RowBox[{"{", RowBox[{"y1", ",", RowBox[{ RowBox[{"Mod", "[", RowBox[{"x", ",", RowBox[{"x2", "+", "x1"}]}], "]"}], ">", "x1"}]}], "}"}], "}"}], ",", "y2"}], "]"}]}], ";"}], "\n", RowBox[{ RowBox[{ RowBox[{"RectangleWave", "[", RowBox[{"f_", ",", RowBox[{"yr_:", RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "1"}], "}"}]}], ",", "x_"}], "]"}], ":=", RowBox[{ RowBox[{"RectangleWave", "[", RowBox[{ RowBox[{"{", RowBox[{"f", ",", RowBox[{"1", "-", "f"}]}], "}"}], ",", "yr", ",", "x"}], "]"}], "/;", RowBox[{"0", "<=", "f", "\[LessEqual]", "1"}]}]}], ";"}]}], "Input", InitializationCell->True, CellChangeTimes->{{3.512291663024753*^9, 3.5122916720079207`*^9}, { 3.5122917784623613`*^9, 3.512292146469103*^9}, { 3.512292189758774*^9, 3.5122923224705973`*^9}, { 3.5122923947706013`*^9, 3.51229246403988*^9}, { 3.5122925019083347`*^9, 3.5122925416358433`*^9}, 3.5122926177472544`*^9, {3.512292663629656*^9, 3.512292664551366*^9}, {3.512292747739581*^9, 3.5122927659863105`*^9}, {3.5122928683117204`*^9, 3.512292877731907*^9}, {3.5122929320502963`*^9, 3.5122929956326504`*^9}, {3.5122931369198275`*^9, 3.5122931515265837`*^9}, {3.5122931865671787`*^9, 3.5122931895978856`*^9}, 3.512293229075185*^9, { 3.512294165894277*^9, 3.5122941923961563`*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"?", "RectangleWave"}]], "Input", CellChangeTimes->{3.5122940192047358`*^9}], Cell[BoxData[ StyleBox["\<\"RectangleWave[{\\!\\(\\*SubscriptBox[\\n \ StyleBox[\\\"x\\\", \\\"TI\\\"], \\n StyleBox[\\\"1\\\", \\\"TR\\\"]]\ \\),\\!\\(\\*SubscriptBox[\\n StyleBox[\\\"x\\\", \\\"TI\\\"], \\n \ StyleBox[\\\"2\\\", \\\"TR\\\"]]\\)},\\!\\(\\*\\nStyleBox[\\\"x\\\", \ \\\"TI\\\"]\\)] gives a rectangele wave that alternates between +1 \ and -1 with semiperiods \\!\\(\\*SubscriptBox[\\n StyleBox[\\\"x\\\", \ \\\"TI\\\"], \\n StyleBox[\\\"1\\\", \\\"TR\\\"]]\\) and \ \\!\\(\\*SubscriptBox[\\n StyleBox[\\\"x\\\", \\\"TI\\\"], \\n \ StyleBox[\\\"2\\\", \ \\\"TR\\\"]]\\).\\nRectangleWave[{\\!\\(\\*SubscriptBox[\\n StyleBox[\ \\\"y\\\", \\\"TI\\\"], \\n StyleBox[\\\"1\\\", \ \\\"TR\\\"]]\\),\\!\\(\\*SubscriptBox[\\n StyleBox[\\\"y\\\", \ \\\"TI\\\"], \\n StyleBox[\\\"2\\\", \ \\\"TR\\\"]]\\)},{\\!\\(\\*SubscriptBox[\\n StyleBox[\\\"x\\\", \ \\\"TI\\\"], \\n StyleBox[\\\"1\\\", \ \\\"TR\\\"]]\\),\\!\\(\\*SubscriptBox[\\n StyleBox[\\\"x\\\", \ \\\"TI\\\"], \\n StyleBox[\\\"2\\\", \ \\\"TR\\\"]]\\)},\\!\\(\\*\\nStyleBox[\\\"x\\\", \\\"TI\\\"]\\)] \ gives a rectangele wave that alternates between \ \\!\\(\\*SubscriptBox[\\n StyleBox[\\\"y\\\", \\\"TI\\\"], \\n \ StyleBox[\\\"1\\\", \\\"TR\\\"]]\\) and \\!\\(\\*SubscriptBox[\\n \ StyleBox[\\\"y\\\", \\\"TI\\\"], \\n StyleBox[\\\"2\\\", \\\"TR\\\"]]\ \\) with semiperiods \\!\\(\\*SubscriptBox[\\n StyleBox[\\\"x\\\", \\\ \"TI\\\"], \\n StyleBox[\\\"1\\\", \\\"TR\\\"]]\\) and \ \\!\\(\\*SubscriptBox[\\n StyleBox[\\\"x\\\", \\\"TI\\\"], \\n \ StyleBox[\\\"2\\\", \ \\\"TR\\\"]]\\).\\nRectangleWave[\\!\\(\\*\\nStyleBox[\\\"f\\\", \ \\\"TI\\\"]\\),\\!\\(\\*\\nStyleBox[\\\"x\\\", \\\"TI\\\"]\\)] gives \ a rectangele wave that alternates between +1 and -1 with semiperiods \ \\!\\(\\*\\nStyleBox[\\\"f\\\", \\\"TI\\\"]\\) and \ 1-\\!\\(\\*\\nStyleBox[\\\"f\\\", \\\"TI\\\"]\\), \ 0<=\\!\\(\\*\\nStyleBox[\\\"f\\\", \ \\\"TI\\\"]\\)<=1\\nRectangleWave[{\\!\\(\\*SubscriptBox[\\n \ StyleBox[\\\"y\\\", \\\"TI\\\"], \\n StyleBox[\\\"1\\\", \\\"TR\\\"]]\ \\),\\!\\(\\*SubscriptBox[\\n StyleBox[\\\"y\\\", \\\"TI\\\"], \\n \ StyleBox[\\\"2\\\", \\\"TR\\\"]]\\)},\\!\\(\\*\\nStyleBox[\\\"f\\\", \ \\\"TI\\\"]\\),\\!\\(\\*\\nStyleBox[\\\"x\\\", \\\"TI\\\"]\\)] gives \ a rectangele wave that alternates between \\!\\(\\*SubscriptBox[\\n \ StyleBox[\\\"y\\\", \\\"TI\\\"], \\n StyleBox[\\\"1\\\", \\\"TR\\\"]]\ \\) and \\!\\(\\*SubscriptBox[\\n StyleBox[\\\"y\\\", \\\"TI\\\"], \ \\n StyleBox[\\\"2\\\", \\\"TR\\\"]]\\) with semiperiods \ \\!\\(\\*\\nStyleBox[\\\"f\\\", \\\"TI\\\"]\\) and \ 1-\\!\\(\\*\\nStyleBox[\\\"f\\\", \\\"TI\\\"]\\), \ 0<=\\!\\(\\*\\nStyleBox[\\\"f\\\", \\\"TI\\\"]\\)<=1\\n\"\>", "MSG"]], "Print", "PrintUsage", CellChangeTimes->{3.51229420532695*^9}, CellTags->"Info3512301405-1927562"] }, {2}]] }, Open ]] }, WindowSize->{1434, 764}, WindowMargins->{{166, Automatic}, {Automatic, 59}}, ShowSelection->True, Magnification->1.8000000715255737`, FrontEndVersion->"7.0 for Microsoft Windows (32-bit) (November 10, \ 2008)", StyleDefinitions->"Default.nb" ]