List[Null, Null, Null, Null, Null, Null, Null, Notebook[List[Cell[CellGroupData[List[Cell["Exercise 2", "Title"], Cell[CellGroupData[List[Cell["Question", "Section"], Cell["Is it really possible to inherit packages?", "Text"], Cell[CellGroupData[List[Cell["Answer", "Subsection"], Cell["Yes, as a matter of fact it is!", "Text"]], Closed]]], Open]], Cell[CellGroupData[List[Cell["Inheriting packages", "Section"], Cell[TextData[List["Inherit the package ", StyleBox["Geometry", Rule[FontFamily, "Courier"]], " into a class ", StyleBox["GeometryUser", Rule[FontFamily, "Courier"]], ", which is calling functions from ", StyleBox["Geometry", Rule[FontFamily, "Courier"]], ".\n"]], "Text"], Cell["class GeometryUser\n\nend GeometryUser;", "ModelicaInput"], Cell["\n", "Text"], Cell["package Geometry\n  constant Real PI = 3.1415926536;\n\n  type Distance = Real(unit = \"m\");\n\n  function RectangleArea\n    input Distance B;\n    input Distance H;\n    output Distance area;\n  algorithm\n    area := B*H;  \n  end RectangleArea;\n\n\n  function TriangleArea\n    input Distance B;\n    input Distance H;\n    output Distance area;\n  algorithm \n    area := RectangleArea(B, H)/2;  \n  end TriangleArea;\n  \n  \n  function CirclePerimeter\n    input Distance radius;\n    output Distance perimeter;\n  algorithm\n    perimeter := 2*PI*radius;  \n  end CirclePerimeter;\n  \n  \n  function CircleArea\n    input Distance radius;\n    output Distance area;\n  algorithm\n     area := PI*radius^2;\n  end CircleArea;\n\nend Geometry;", "ModelicaInput"], Cell[CellGroupData[List[Cell["Answer", "Subsection"], Cell[CellGroupData[List[Cell["GeometryUser", "Subsubsection"], Cell["class GeometryUser\nextends Geometry;\n  Distance rectangleArea \t= RectangleArea(4, 5); \n  Distance rectangleArea \t= TriangleArea(4, 5);\t\n  Distance circlePerimeter \t= CirclePerimeter(3.5);\n  Distance circleArea \t\t= CircleArea(3.5);\nend GeometryUser;", "ModelicaInput"]], Closed]], Cell[CellGroupData[List[Cell["Simulation of GeometryUser", "Subsubsection"], Cell["simulate( GeometryUser );", "ModelicaInput"], Cell[BoxData["\"<SimulationData: \\!\\(GeometryUser\\) : 2004-1-30 15:40:32.4241920 : \\!\\({0.`, 1.`}\\) : 502 data points : 1 events : 6 variables>\\n\\!\\({\\*TagBox[\\\"circleArea\\\", HoldForm], \\*TagBox[\\\"circlePerimeter\\\", HoldForm], \\*TagBox[\\\"\[UnderBracket]derdummy\\\", HoldForm], \\*TagBox[\\\"\[UnderBracket]dummy\\\", HoldForm], \\*TagBox[\\\"PI\\\", HoldForm], \\*TagBox[\\\"rectangleArea\\\", HoldForm]}\\)\""], "Output"], Cell[BoxData[RowBox[List["{", RowBox[List[RowBox[List["rectangleArea", "[", "0", "]"]], ",", " ", RowBox[List["rectangleArea", "[", "0", "]"]], ",", " ", RowBox[List["circlePerimeter", "[", "0", "]"]], ",", " ", RowBox[List["circleArea", "[", "0", "]"]]]], "}"]]], "Input"]], Closed]]], Closed]]], Open]]], Open]]], Rule[FrontEndVersion, "5.1 for Microsoft Windows"], Rule[ScreenRectangle, List[List[0, 1280], List[0, 951]]], Rule[WindowSize, List[820, 883]], Rule[WindowMargins, List[List[0, Automatic], List[Automatic, 5]]], Rule[StyleDefinitions, "MathModelica.nb"]], Null, Null, Null, Null, Null]