Monitors

#### Next topic

Power-Spectra Interactive

# Phase-Plane Interactive¶

An interactive phase-plane plot generated from a Model object of TVB.

Optionally an Integrator object from TVB can be specified, this will be used to generate sample trajectories – not the phase-plane. This is mainly interesting for visualising the effect of noise on a trajectory.

Demo:

from tvb.simulator.plot.phase_plane_interactive import PhasePlaneInteractive
ppi_fig = PhasePlaneInteractive()
ppi_fig.show()


Example specifying a Model and stochastic sample trajectories:

import tvb.simulator.models
from tvb.simulator.plot.phase_plane_interactive import PhasePlaneInteractive
MODEL = tvb.simulator.models.JansenRit()
import tvb.simulator.integrators
INTEGRATOR = tvb.simulator.integrators.HeunStochastic(dt=2**-5)
ppi_fig = PhasePlaneInteractive(model=MODEL, integrator=INTEGRATOR)
ppi_fig.show()

class tvb.simulator.plot.phase_plane_interactive.PhasePlaneInteractive(**kwargs)[source]
The GUI for the interactive phase-plane viewer provides sliders for setting:
• The value of all parameters of the Model.
• The extent of the axes.
• A fixed value for the state-variables which aren’t currently selected.
• The noise strength, if a stocahstic integrator is specified.
• Which state-variables to show on each axis.
• Which mode to show, if the Model has them.

Clicking on the phase-plane will generate a sample trajectory, originating from where you clicked.

model : tvb.simulator.plot.phase_plane_interactive.PhasePlaneInteractive.model = Attr(field_type=<class ‘tvb.simulator.models.base.Model’>, default=<tvb.simulator.models.oscillator.Generic2dOscillator object at 0x7f718361cb90>, required=True)
An instance of the local dynamic model to be investigated with PhasePlaneInteractive.
integrator : tvb.simulator.plot.phase_plane_interactive.PhasePlaneInteractive.integrator = Attr(field_type=<class ‘tvb.simulator.integrators.Integrator’>, default=<tvb.simulator.integrators.RungeKutta4thOrderDeterministic object at 0x7f718561cdd0>, required=True)
The integration scheme used to for generating sample trajectories on the phase-plane. NOTE: This is not used for generating the phase-plane itself, ie the vector field and nulclines.

exclude_sliders : tvb.simulator.plot.phase_plane_interactive.PhasePlaneInteractive.exclude_sliders = List(of=<class ‘str’>, default=(), required=True)

gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)

Add sliders to the figure to allow the phase-planes axes to be set.

Add a radio button to the figure for selecting which mode of the model should be displayed.

Add a slider to the figure to allow the integrators noise strength to be set.

Add sliders to the figure to allow the models parameters to be set.

Add a button to the figure for reseting the phase-plane axes to their default ranges.

Add a button to the figure for reseting the noise to its default value.

Add a button to the figure for reseting the model parameter values to their original values.

Add a button to the figure for reseting the random number generator to its intial state. For reproducible noise...

Add a button to the figure for reseting the model state variables to their default values.

Generate radio selector buttons to set which state variable is displayed on the x and y axis of the phase-plane plot.

Add sliders to the figure to allow default values for the models state variable to be set.

calc_phase_plane()[source]

Calculate the vector field.

click_trajectory(event)[source]

This method captures mouse clicks on the phase-plane and then uses the plot_trajectory() method to generate a sample trajectory.

create_figure()[source]

Create the figure and phase-plane axes.

exclude_sliders

The attribute is a list of values. Choices and type are reinterpreted as applying not to the list but to the elements of it

integrator

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

model

An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.

plot_phase_plane()[source]

Plot the vector field and its nullclines.

plot_trajectory(x, y)[source]

Plot a sample trajectory, starting at the position x,y in the phase-plane. This method is called as a result of a mouse click on the phase-plane.

set_mesh_grid()[source]

Generate the phase-plane gridding based on currently selected state-variables and their range values.

set_state_vector()[source]

Set up a vector containing the default state-variable values and create a filler(all zeros) for the coupling arg of the Model’s dfun method. This method is called once at initialisation (show()).

show()[source]

Generate the interactive phase-plane figure.

update_mode(label)[source]

Update the visualised mode based on radio button selection.

update_noise(nsig)[source]

Update integrator noise based on the noise slider value.

update_parameters(val)[source]

Update model parameters based on the current parameter slider values.

NOTE: Haven’t figured out how to update independantly, so just update
everything.
update_phase_plane()[source]

Clear the axes and redraw the phase-plane.

update_range(val)[source]

Update the axes ranges based on the current axes slider values.

NOTE: Haven’t figured out how to update independantly, so just update
everything.
update_state_variables(val)[source]

Update the default state-variable values, used for non-visualised state variables, based of the current slider values.

update_svx(label)[source]

Update state variable used for x-axis based on radio buttton selection.

update_svy(label)[source]

Update state variable used for y-axis based on radio buttton selection.

update_xrange_sliders()[source]

A hacky update of the x-axis range sliders that is called when the state-variable selected for the x-axis is changed.

update_yrange_sliders()[source]

A hacky update of the y-axis range sliders that is called when the state-variable selected for the y-axis is changed.

tvb.simulator.plot.phase_plane_interactive.get_color(num_colours)[source]