• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

OpenMDAO / dymos / 13721284284

07 Mar 2025 01:03PM UTC coverage: 93.183% (-0.2%) from 93.407%
13721284284

Pull #1146

github

web-flow
Merge 9f14fe818 into 8588548ba
Pull Request #1146: Removed ControlGroup since ControlInterpComp handles all types of controls

55 of 56 new or added lines in 9 files covered. (98.21%)

138 existing lines in 9 files now uncovered.

32848 of 35251 relevant lines covered (93.18%)

5.68 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

84.09
/dymos/examples/goddard_rocket_problem/rocket_ode.py
UNCOV
1
import openmdao.api as om
×
UNCOV
2
import numpy as np
×
3

4

UNCOV
5
class RocketODE(om.ExplicitComponent):
×
UNCOV
6
    def initialize(self):
×
7
        self.options.declare('num_nodes', types=int)
4✔
8

UNCOV
9
    def setup(self):
×
10
        nn = self.options['num_nodes']
4✔
11

12
        self.add_input('h', val=np.zeros(nn), units='ft')
4✔
13
        self.add_input('v', val=np.zeros(nn), units='ft/s')
4✔
14
        self.add_input('m', val=np.zeros(nn), units='slug')
4✔
15
        self.add_input('T', val=np.zeros(nn), units='lbf')
4✔
16

17
        self.add_output('h_dot', val=np.zeros(nn), units='ft/s')
4✔
18
        self.add_output('v_dot', val=np.zeros(nn), units='ft/s**2')
4✔
19
        self.add_output('m_dot', val=np.zeros(nn), units='slug/s')
4✔
20

21
        ar = np.arange(nn)
4✔
22
        self.declare_partials(of='h_dot', wrt='v', rows=ar, cols=ar, val=1.0)
4✔
23
        self.declare_partials(of='v_dot', wrt='h', rows=ar, cols=ar)
4✔
24
        self.declare_partials(of='v_dot', wrt='v', rows=ar, cols=ar)
4✔
25
        self.declare_partials(of='v_dot', wrt='m', rows=ar, cols=ar)
4✔
26
        self.declare_partials(of='v_dot', wrt='T', rows=ar, cols=ar)
4✔
27

28
        self.declare_partials(of='m_dot', wrt='T', rows=ar, cols=ar, val=-1/1580.9425)
4✔
29

UNCOV
30
    def compute(self, inputs, outputs, discrete_inputs=None, discrete_outputs=None):
×
31
        h = inputs['h']
4✔
32
        v = inputs['v']
4✔
33
        m = inputs['m']
4✔
34
        T = inputs['T']
4✔
35

36
        sigma = 5.4915e-5
4✔
37
        g = 32.174
4✔
38
        c = 1580.9425
4✔
39
        h0 = 23800
4✔
40

41
        outputs['h_dot'] = v
4✔
42
        outputs['v_dot'] = (T - sigma * v**2 * np.exp(-h/h0))/m - g
4✔
43
        outputs['m_dot'] = -T / c
4✔
44

UNCOV
45
    def compute_partials(self, inputs, partials, discrete_inputs=None):
×
46
        h = inputs['h']
4✔
47
        v = inputs['v']
4✔
48
        m = inputs['m']
4✔
49
        T = inputs['T']
4✔
50

51
        sigma = 5.4915e-5
4✔
52
        h0 = 23800
4✔
53

54
        partials['v_dot', 'h'] = (sigma * v**2 * np.exp(-h/h0))/(m * h0)
4✔
55
        partials['v_dot', 'v'] = -(2 * sigma * v * np.exp(-h/h0)) / m
4✔
56
        partials['v_dot', 'm'] = -(T - sigma * v**2 * np.exp(-h/h0)) / (m**2)
4✔
57
        partials['v_dot', 'T'] = 1 / m
4✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc