|
11 | 11 | "import numpy as np\n", |
12 | 12 | "from scipy.signal import savgol_filter\n", |
13 | 13 | "from rocketpy.rocket.rocket import PointMassRocket\n", |
14 | | - "from rocketpy import Flight, Environment, Function\n" |
| 14 | + "from rocketpy import Flight, Environment, Function, PointMassMotor\n" |
15 | 15 | ] |
16 | 16 | }, |
17 | 17 | { |
|
106 | 106 | }, |
107 | 107 | { |
108 | 108 | "cell_type": "code", |
109 | | - "execution_count": 3, |
| 109 | + "execution_count": 5, |
110 | 110 | "metadata": {}, |
111 | | - "outputs": [ |
112 | | - { |
113 | | - "ename": "NameError", |
114 | | - "evalue": "name 'PointMassMotor' is not defined", |
115 | | - "output_type": "error", |
116 | | - "traceback": [ |
117 | | - "\u001b[31m---------------------------------------------------------------------------\u001b[39m", |
118 | | - "\u001b[31mNameError\u001b[39m Traceback (most recent call last)", |
119 | | - "\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[3]\u001b[39m\u001b[32m, line 6\u001b[39m\n\u001b[32m 3\u001b[39m \u001b[38;5;28;01mdef\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34mthrust_profile\u001b[39m(t):\n\u001b[32m 4\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[32m250\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m \u001b[32m0\u001b[39m <= t <= \u001b[32m3\u001b[39m \u001b[38;5;28;01melse\u001b[39;00m \u001b[32m0\u001b[39m\n\u001b[32m----> \u001b[39m\u001b[32m6\u001b[39m motor = \u001b[43mPointMassMotor\u001b[49m(\n\u001b[32m 7\u001b[39m thrust_source=thrust_profile,\n\u001b[32m 8\u001b[39m dry_mass=\u001b[32m1.0\u001b[39m,\n\u001b[32m 9\u001b[39m thrust_curve=thrust_profile,\n\u001b[32m 10\u001b[39m propellant_initial_mass=\u001b[32m0.5\u001b[39m,\n\u001b[32m 11\u001b[39m propellant_final_mass=\u001b[32m0.0\u001b[39m,\n\u001b[32m 12\u001b[39m burn_time=\u001b[32m3.0\u001b[39m\n\u001b[32m 13\u001b[39m )\n", |
120 | | - "\u001b[31mNameError\u001b[39m: name 'PointMassMotor' is not defined" |
121 | | - ] |
122 | | - } |
123 | | - ], |
| 111 | + "outputs": [], |
124 | 112 | "source": [ |
125 | 113 | "# Define Motor\n", |
126 | 114 | "# Thrust profile: constant for 3 seconds\n", |
|
130 | 118 | "motor = PointMassMotor(\n", |
131 | 119 | " thrust_source=thrust_profile,\n", |
132 | 120 | " dry_mass=1.0,\n", |
133 | | - " thrust_curve=thrust_profile,\n", |
134 | 121 | " propellant_initial_mass=0.5,\n", |
135 | 122 | " propellant_final_mass=0.0,\n", |
136 | 123 | " burn_time=3.0\n", |
|
139 | 126 | }, |
140 | 127 | { |
141 | 128 | "cell_type": "code", |
142 | | - "execution_count": 4, |
| 129 | + "execution_count": 6, |
143 | 130 | "metadata": {}, |
144 | | - "outputs": [], |
| 131 | + "outputs": [ |
| 132 | + { |
| 133 | + "ename": "TypeError", |
| 134 | + "evalue": "PointMassRocket.__init__() got an unexpected keyword argument 'drag_coefficient'", |
| 135 | + "output_type": "error", |
| 136 | + "traceback": [ |
| 137 | + "\u001b[31m---------------------------------------------------------------------------\u001b[39m", |
| 138 | + "\u001b[31mTypeError\u001b[39m Traceback (most recent call last)", |
| 139 | + "\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[6]\u001b[39m\u001b[32m, line 2\u001b[39m\n\u001b[32m 1\u001b[39m \u001b[38;5;66;03m# Define Rocket\u001b[39;00m\n\u001b[32m----> \u001b[39m\u001b[32m2\u001b[39m rocket = \u001b[43mPointMassRocket\u001b[49m\u001b[43m(\u001b[49m\u001b[43mmass\u001b[49m\u001b[43m=\u001b[49m\u001b[32;43m2.0\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mdrag_coefficient\u001b[49m\u001b[43m=\u001b[49m\u001b[32;43m0.75\u001b[39;49m\u001b[43m)\u001b[49m\n\u001b[32m 3\u001b[39m rocket.add_motor(motor)\n", |
| 140 | + "\u001b[31mTypeError\u001b[39m: PointMassRocket.__init__() got an unexpected keyword argument 'drag_coefficient'" |
| 141 | + ] |
| 142 | + } |
| 143 | + ], |
145 | 144 | "source": [ |
146 | 145 | "# Define Rocket\n", |
147 | 146 | "rocket = PointMassRocket(mass=2.0, drag_coefficient=0.75)\n", |
|
0 commit comments