Ejemplo n.º 1
0
 def setUp(self):
     self.ode = LorenzEquation()
     self.solver = ODESolver(ode=self.ode)
     self.solver.initial_state = [10., 50., 50.]
Ejemplo n.º 2
0
 def setUp(self):
     self.ode = LorenzEquation()
     self.solver = ODESolver(ode=self.ode)
     self.solver.initial_state = [10., 50., 50.]
     self.solver.t = numpy.linspace(0, 10, 1001)
Ejemplo n.º 3
0
    def _plot_default(self):
        self._set_arr(self.index_name, 'index')
        self._set_arr(self.value_name, 'value')
        plot = Plot(self.pd)
        plot.tools.append(TraitsTool(component=plot))
        plot.tools.append(ZoomTool(component=plot))
        plot.tools.append(PanTool(component=plot))
        plot.x_axis.title = self.index_name
        plot.y_axis.title = self.value_name
        plot.plot(('index', 'value'))
        return plot

    def _index_name_default(self):
        return self.name_list[0]

    def _value_name_default(self):
        return self.name_list[-1]


if __name__ == '__main__':
    from ode import EpidemicODE, LorenzEquation, GenericODE
    import numpy
    ode = EpidemicODE()
    ode = LorenzEquation()
    ode.configure_traits()
    solver = ODESolver(ode=ode,
                       initial_state=[10., 50., 50.],
                       t=numpy.linspace(0, 10, 1001))
    plot = ODEPlot(solver=solver)
    plot.configure_traits()