neuromancer.psl.coupled_systems module

class neuromancer.psl.coupled_systems.Boids(backend='numpy', set_stats=False, coherence=0.05, separation=0.01, alignment=0.05, avoidance_range=0.2, visual_range=None, nx=50, x0=None, seed=59)[source]

Bases: Coupled_ODE

equations(t, x)[source]
get_x0(nx=None, rseed=None)[source]

Randomly sample an initial condition

Parameters:

box – Dictionary with keys ‘min’ and ‘max’ and values np.arrays with shape=(nx,)

message_passing(receivers, senders, t)[source]

Stub function for message passing operation Systems that inherit should compute interactions between corresponding rows of receivers and senders :return messages from senders to receivers np.array of shape(len(receivers), **)

Parameters:
  • receivers – _description_

  • senders – _description_

  • t – _description_

normalize_max(x, length)[source]
pos_idx = [0, 1]
simulate(nsim=None, Time=None, ts=None, x0=None)
Parameters:
  • nsim – (int) Number of steps for open loop response

  • ninit – (float) initial simulation time

  • ts – (float) step size, sampling time

  • Time – (Sequence of float) Optional timesteps to integrate over.

  • x0 – (float) state initial conditions

Returns:

The response matrices, i.e. X

vel_idx = [2, 3]
class neuromancer.psl.coupled_systems.Coupled_NonAutonomous(exclude_norms=['Time'], backend='numpy', requires_grad=False, seed=59, set_stats=False, adj=None, nx=1)[source]

Bases: ODE_NonAutonomous

equations(t, x, u)[source]
message_passing(receivers, senders, t, u)[source]

Stub function for message passing operation Systems that inherit should compute interactions between corresponding rows of receivers and senders: (receivers[i], senders[i]) are coupled :return messages from senders to receivers np.array of shape(len(receivers), **)

Parameters:
  • receivers – Receiving agents

  • senders – Sending agents

  • t – time step

  • u – Control Variables

property params
class neuromancer.psl.coupled_systems.Coupled_ODE(exclude_norms=['Time'], backend='numpy', requires_grad=False, seed=59, set_stats=True, adj=None, nx=1)[source]

Bases: ODE_Autonomous

equations(t, x)[source]
message_passing(receivers, senders, t)[source]

Stub function for message passing operation Systems that inherit should compute interactions between corresponding rows of receivers and senders :return messages from senders to receivers np.array of shape(len(receivers), **)

Parameters:
  • receivers – _description_

  • senders – _description_

  • t – _description_

property params
class neuromancer.psl.coupled_systems.Gravitational_System(backend='numpy', set_stats=False, G=6.67e-11, adj=None, nx=4, seed=59, x0=None)[source]

Bases: Coupled_ODE

equations(t, x)[source]
get_x0()[source]

Randomly sample an initial condition

Parameters:

box – Dictionary with keys ‘min’ and ‘max’ and values np.arrays with shape=(nx,)

static make_4_body(nsim=10000)[source]
Returns:

A system with 3 satelites orbiting one larger body

mass_idx = [0]
message_passing(receivers, senders, t)[source]

Stub function for message passing operation Systems that inherit should compute interactions between corresponding rows of receivers and senders :return messages from senders to receivers np.array of shape(len(receivers), **)

Parameters:
  • receivers – _description_

  • senders – _description_

  • t – _description_

pos_idx = [1, 2]
simulate(nsim=None, Time=None, ts=None, x0=None)
Parameters:
  • nsim – (int) Number of steps for open loop response

  • ninit – (float) initial simulation time

  • ts – (float) step size, sampling time

  • Time – (Sequence of float) Optional timesteps to integrate over.

  • x0 – (float) state initial conditions

Returns:

The response matrices, i.e. X

vel_idx = [3, 4]
class neuromancer.psl.coupled_systems.RC_Network(exclude_norms=['Time'], backend='numpy', requires_grad=False, seed=59, set_stats=False, adj=None, nx=1, R=None, C=None, U=None)[source]

Bases: Coupled_NonAutonomous

equations(t, x, u)[source]
get_C(num=1)[source]
get_U(nsim, periods=None)[source]

For sampling a sequence of control actions :param nsim: length of sequence :return: Matrix nsim X nU

get_resistances(adj_list, Rval=3.5, amax=20, amin=0, symmetric=True)[source]
get_x0()[source]

Randomly sample an initial condition

Parameters:

box – Dictionary with keys ‘min’ and ‘max’ and values np.arrays with shape=(nx,)

static make_5_room(nsim=10000)[source]
message_passing(receivers, senders, t, u)[source]

Stub function for message passing operation Systems that inherit should compute interactions between corresponding rows of receivers and senders: (receivers[i], senders[i]) are coupled :return messages from senders to receivers np.array of shape(len(receivers), **)

Parameters:
  • receivers – Receiving agents

  • senders – Sending agents

  • t – time step

  • u – Control Variables

neuromancer.psl.coupled_systems.multidim(is_autonomous)[source]