List[Null, Null, Null, Null, Null, Null, Null, Notebook[List[Cell[CellGroupData[List[Cell["Exercise 3", "Title"], Cell[CellGroupData[List[Cell["More on redeclaration", "Section"], Cell[TextData[List["\nWrite a class ", StyleBox["MoreRed", Rule[FontFamily, "Courier"]], " that declares two variables ", StyleBox["v1", Rule[FontFamily, "Courier"]], " and ", StyleBox["v2", Rule[FontFamily, "Courier"]], " being vectors and one variable ", StyleBox["x", Rule[FontFamily, "Courier"]], " being a ", StyleBox["Integer", Rule[FontFamily, "Courier"]], ". Set x to a value."]], "Text"], Cell["", "ModelicaInput"], Cell[TextData[List["\n\nUse the class above to redeclare the dimension sizes of  ", StyleBox["v1 and", Rule[FontFamily, "Courier"]], " ", StyleBox["v2", Rule[FontFamily, "Courier"]], " and the type of ", StyleBox["x", Rule[FontFamily, "Courier"]], "."]], "Text"], Cell["", "ModelicaInput"], Cell[CellGroupData[List[Cell["Tip", "Subsection"], Cell["In the redeclaration-statement of the variables, you have to include the term \"parameter\" so that they, as parameters, can be modified.", "Text"]], Closed]], Cell[CellGroupData[List[Cell["Answer", "Subsection"], Cell[CellGroupData[List[Cell["Answer - MoreRed", "Subsubsection"], Cell["class MoreRed\n  parameter Real v1[3];\n  parameter Real v2[:];\n  Integer x = 2; \nend MoreRed;", "ModelicaInput"]], Closed]], Cell[CellGroupData[List[Cell["Answer MoreRed2", "Subsubsection"], Cell[TextData[List["Notice that you don't need the keyword ", StyleBox["replaceable", Rule[FontSlant, "Italic"]], " for v1 and v2."]], "Text"], Cell["class MoreRed2 = MoreRed(redeclare parameter Integer x, \n\t\t\t\t\t\t redeclare parameter Real v1[5], \n\t\t\t\t\t\t redeclare parameter Real v2[12]);", "ModelicaInput"]], Closed]], Cell[CellGroupData[List[Cell["Simulation of MoreRed2", "Subsubsection"], Cell["simulate( MoreRed2 );", "ModelicaInput"], Cell[BoxData["\"<SimulationData: \\!\\(MoreRed2\\) : 2004-1-30 12:45:20.8355075 : \\!\\({0.`, 1.`}\\) : 502 data points : 1 events : 20 variables>\\n\\!\\({\\*TagBox[\\\"\[UnderBracket]derdummy\\\", HoldForm], \\*TagBox[\\\"\[UnderBracket]dummy\\\", HoldForm], \\*TagBox[\\(v1 \[LeftDoubleBracket] \\(\\(1\\)\\) \[RightDoubleBracket]\\), HoldForm], \\*TagBox[\\(v1 \[LeftDoubleBracket] \\(\\(2\\)\\) \[RightDoubleBracket]\\), HoldForm], \\*TagBox[\\(v1 \[LeftDoubleBracket] \\(\\(3\\)\\) \[RightDoubleBracket]\\), HoldForm], \\*TagBox[\\(v1 \[LeftDoubleBracket] \\(\\(4\\)\\) \[RightDoubleBracket]\\), HoldForm], \\*TagBox[\\(v1 \[LeftDoubleBracket] \\(\\(5\\)\\) \[RightDoubleBracket]\\), HoldForm], \\*TagBox[\\(v2 \[LeftDoubleBracket] \\(\\(1\\)\\) \[RightDoubleBracket]\\), HoldForm], \\*TagBox[\\(v2 \[LeftDoubleBracket] \\(\\(10\\)\\) \[RightDoubleBracket]\\), HoldForm], \\*TagBox[\\(v2 \[LeftDoubleBracket] \\(\\(11\\)\\) \[RightDoubleBracket]\\), HoldForm], \\*TagBox[\\(v2 \[LeftDoubleBracket] \\(\\(12\\)\\) \[RightDoubleBracket]\\), HoldForm], \\*TagBox[\\(v2 \[LeftDoubleBracket] \\(\\(2\\)\\) \[RightDoubleBracket]\\), HoldForm], \\*TagBox[\\(v2 \[LeftDoubleBracket] \\(\\(3\\)\\) \[RightDoubleBracket]\\), HoldForm], \\*TagBox[\\(v2 \[LeftDoubleBracket] \\(\\(4\\)\\) \[RightDoubleBracket]\\), HoldForm], \\*TagBox[\\(v2 \[LeftDoubleBracket] \\(\\(5\\)\\) \[RightDoubleBracket]\\), HoldForm], \\*TagBox[\\(v2 \[LeftDoubleBracket] \\(\\(6\\)\\) \[RightDoubleBracket]\\), HoldForm], \\*TagBox[\\(v2 \[LeftDoubleBracket] \\(\\(7\\)\\) \[RightDoubleBracket]\\), HoldForm], \\*TagBox[\\(v2 \[LeftDoubleBracket] \\(\\(8\\)\\) \[RightDoubleBracket]\\), HoldForm], \\*TagBox[\\(v2 \[LeftDoubleBracket] \\(\\(9\\)\\) \[RightDoubleBracket]\\), HoldForm], \\*TagBox[\\\"x\\\", HoldForm]}\\)\""], "Output"]], Closed]]], Closed]]], Open]]], Open]]], Rule[FrontEndVersion, "5.1 for Microsoft Windows"], Rule[ScreenRectangle, List[List[0, 1280], List[0, 951]]], Rule[WindowSize, List[821, 869]], Rule[WindowMargins, List[List[7, Automatic], List[Automatic, 3]]], Rule[StyleDefinitions, "MathModelica.nb"]], Null, Null, Null, Null, Null]