List[Null, Null, Null, Null, Null, Null, Null, Notebook[List[Cell[CellGroupData[List[Cell["Exercise 1", "Title"], Cell[CellGroupData[List[Cell["Using replaceable and redeclare on class Point", "Section"], Cell[TextData[List[StyleBox["Point", Rule[FontFamily, "Courier"]], " is a built-in type in Modelica."]], "Text"], Cell["class Point\n  parameter Real x; \n  parameter Real y;\n  parameter Real z;\nend Point;", "ModelicaInput"], Cell[TextData[List["\n\nCreate a class ", StyleBox["Redeclaration", Rule[FontFamily, "Courier"]], ", containing a Point ", StyleBox["P", Rule[FontFamily, "Courier"]], " as a variable. You should set the values of x, y and z as well."]], "Text"], Cell["", "ModelicaInput"], Cell[TextData[List["\n\nIn the class below you should redeclare ", StyleBox["P", Rule[FontFamily, "Courier"]], " as the type ", StyleBox["myPoint", Rule[FontFamily, "Courier"]], ", which is a subtype of ", StyleBox["Point", Rule[FontFamily, "Courier"]], " (you can write ", StyleBox["myPoint", Rule[FontFamily, "Courier"]], " further below)."]], "Text"], Cell["class PointRed\n\nend PointRed;", "ModelicaInput"], Cell[TextData[List["\n\nYou can declare the class ", StyleBox["myPoint", Rule[FontFamily, "Courier"]], " here, below."]], "Text"], Cell["", "ModelicaInput"], Cell[CellGroupData[List[Cell["Tip", "Subsection"], Cell[TextData[List["The variable ", StyleBox["P", Rule[FontFamily, "Courier"]], " must be declared replaceable in class ", StyleBox["Redeclaration", Rule[FontFamily, "Courier"]], "."]], "Text"]], Closed]], Cell[CellGroupData[List[Cell["Answer", "Subsection"], Cell[CellGroupData[List[Cell["class Point", "Subsubsection"], Cell["class Point\n  parameter Real x;\n  parameter Real y;\n  parameter Real z;\nend Point;", "ModelicaInput"]], Open]], Cell[CellGroupData[List[Cell["class Redeclaration", "Subsubsection"], Cell["class Redeclaration\n  replaceable Point P(x = 1, y = 2, z = 3);\nend Redeclaration;", "ModelicaInput"]], Open]], Cell[CellGroupData[List[Cell["class MyPoint", "Subsubsection"], Cell["class MyPoint\n  extends Point(z = 4);\nend MyPoint;", "ModelicaInput"]], Open]], Cell[CellGroupData[List[Cell["class PointRed", "Subsubsection"], Cell[TextData[List[StyleBox["myPoint", Rule[FontFamily, "Courier"]], " is a subtype of Point, it changes type and prefix of P"]], "Text"], Cell["class PointRed\n  Redeclaration myPoint(redeclare MyPoint P);\nend PointRed;", "ModelicaInput"], Cell["", "Text"]], Open]], Cell[CellGroupData[List[Cell["Simulation of Redeclaration and PointRed", "Subsubsection"], Cell["simulate( Redeclaration );", "ModelicaInput"], Cell[BoxData["\"<SimulationData: \\!\\(Redeclaration\\) : 2004-1-30 12:42:54.7923713 : \\!\\({0.`, 1.`}\\) : 502 data points : 1 events : 5 variables>\\n\\!\\({\\*TagBox[\\\"\[UnderBracket]derdummy\\\", HoldForm], \\*TagBox[\\\"\[UnderBracket]dummy\\\", HoldForm], \\*TagBox[\\(P . x\\), HoldForm], \\*TagBox[\\(P . y\\), HoldForm], \\*TagBox[\\(P . z\\), HoldForm]}\\)\""], "Output"], Cell["", "Text"], Cell["simulate( PointRed );", "ModelicaInput"], Cell[BoxData["\"<SimulationData: \\!\\(PointRed\\) : 2004-1-30 12:43:20.9948255 : \\!\\({0.`, 1.`}\\) : 502 data points : 1 events : 5 variables>\\n\\!\\({\\*TagBox[\\\"\[UnderBracket]derdummy\\\", HoldForm], \\*TagBox[\\\"\[UnderBracket]dummy\\\", HoldForm], \\*TagBox[\\(myPoint . P . x\\), HoldForm], \\*TagBox[\\(myPoint . P . y\\), HoldForm], \\*TagBox[\\(myPoint . P . z\\), HoldForm]}\\)\""], "Output"]], Closed]]], Closed]]], Open]], Cell[CellGroupData[List[Cell["Question", "Section"], Cell["If you instead had a class MyPoint with z as an Integer. Would that work?", "Text"], Cell["class MyPoint\n  parameter Real x;\n  parameter Real y;\n  parameter Integer z = 4;\nend MyPoint;", "ModelicaInput"], Cell[CellGroupData[List[Cell["Answer", "Subsection"], Cell["No, because then MyPoint would not be a subclass of Point.", "Text"]], Closed]]], Open]]], Open]]], Rule[FrontEndVersion, "5.1 for Microsoft Windows"], Rule[ScreenRectangle, List[List[0, 1280], List[0, 951]]], Rule[WindowSize, List[758, 924]], Rule[WindowMargins, List[List[57, Automatic], List[Automatic, 0]]], Rule[StyleDefinitions, "MathModelica.nb"]], Null, Null, Null, Null, Null]