List[Null, Null, Null, Null, Null, Null, Null, Notebook[List[Cell[CellGroupData[List[Cell["Exercise 2", "Title"], Cell[CellGroupData[List[Cell["Inheritance through Modification", "Section"], Cell[TextData[List["\nDeclare a ", StyleBox["Real", Rule[FontFamily, "Courier"]], " variable temp with the unit \"degC\" in the class Temperature."]], "Text"], Cell["class Temperature\n\nend Temperature;", "ModelicaInput"], Cell["\n\nUse short class definition and create a new class Temp20 that modifies the variable temp in Temperature to be equal to 20.", "Text"], Cell["", "ModelicaInput"], Cell["\n\nDo the same thing as in Temp20, but this time Temp20 should inherit from Temperature.", "Text"], Cell["", "ModelicaInput"], Cell[CellGroupData[List[Cell["Tip", "Subsection"], Cell["The variable temp must be a parameter so it can be modified in the short class definition.", "Text"]], Closed]], Cell[CellGroupData[List[Cell["Answer", "Subsection"], Cell["class Temperature\n  parameter Real temp(unit = \"degC\");\nend Temperature;", "ModelicaInput"], Cell["", "Text"], Cell["class Temp20 = Temperature(temp = 20);", "ModelicaInput"], Cell["", "Text"], Cell["model Temp20b\n  extends Temperature(temp = 20);\nend Temp20b;", "ModelicaInput"], Cell["", "Text"], Cell[CellGroupData[List[Cell["Simulation of Temperature, Temp20 and Temp20b", "Subsubsection"], Cell["simulate( Temperature );", "ModelicaInput"], Cell[BoxData["\"<SimulationData: \\!\\(Temperature\\) : 2004-1-30 11:53:42.6232283 : \\!\\({0.`, 1.`}\\) : 502 data points : 1 events : 3 variables>\\n\\!\\({\\*TagBox[\\\"\[UnderBracket]derdummy\\\", HoldForm], \\*TagBox[\\\"\[UnderBracket]dummy\\\", HoldForm], \\*TagBox[\\\"temp\\\", HoldForm]}\\)\""], "Output"], Cell["", "Text"], Cell["simulate( Temp20 );", "ModelicaInput"], Cell[BoxData["\"<SimulationData: \\!\\(Temp20\\) : 2004-1-30 11:53:48.5136648 : \\!\\({0.`, 1.`}\\) : 502 data points : 1 events : 3 variables>\\n\\!\\({\\*TagBox[\\\"\[UnderBracket]derdummy\\\", HoldForm], \\*TagBox[\\\"\[UnderBracket]dummy\\\", HoldForm], \\*TagBox[\\\"temp\\\", HoldForm]}\\)\""], "Output"], Cell["", "Text"], Cell["simulate( Temp20b );", "ModelicaInput"], Cell[BoxData["\"<SimulationData: \\!\\(Temp20b\\) : 2004-1-30 11:53:54.4041013 : \\!\\({0.`, 1.`}\\) : 502 data points : 1 events : 3 variables>\\n\\!\\({\\*TagBox[\\\"\[UnderBracket]derdummy\\\", HoldForm], \\*TagBox[\\\"\[UnderBracket]dummy\\\", HoldForm], \\*TagBox[\\\"temp\\\", 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[832, 924]], Rule[WindowMargins, List[List[6, Automatic], List[Automatic, 0]]], Rule[StyleDefinitions, "MathModelica.nb"]], Null, Null, Null, Null, Null]