[Home]State Space

HomePage | RecentChanges | Preferences | My Website home page

State Space

A system that uses history has a state and the the history has many dimensions or space.

Thoughts on Distributed state machines

Thoughts on Distributed state machines as used in Object Oriented Programming, and web sites.

Here is combinatory simple logic system.

Here is a simple state machine system, as outputs are fed back to provide history.

Here is a simple state machine system, as outputs are fed back to provide history. A latch is added to clock the state machine.

Note: In software, it is probably impossible to not have a latch.

If the state machine is written in a function called ProcessTimeSlice(), then every time the function is called, it is like clocking the state machine latch. In further examples, they will all be latched. There may even be more than one latch, each clocked by their own bit of software.

Here is a state machine where the state information is stored in more than one place. There is an assumption that the state machine is not run continuously. Often it is only run when the inputs change or on a regular time tick.

Getting the state from a database may require a data base query.

Maybe the state is held in a local copy, and either the database is responsible for pushing down updates or the state machine is responsible for polling for updates.

In the diagram above, any available processor can be given the code for the combinationatory logic and run it. It will need to be given access to the state variables, and to avoid corruption, these will be locked for sole use by the processor. It will need a way of storing the state variables back into any central data store. so:

 localCopyOfStateVariables =  StateVariables

get from array:

 localCopyOfStateVariables =  StateVariables[ instanceWanted ]

get from any where:

 localCopyOfStateVariables =  getStateVariables( instanceWanted )
 ...
 putStateVariables(    instanceWanted )

Here is an outline of running with locks:

 lockStateVariables(   instanceWanted )
 localCopyOfStateVariables = getStateVariables( instanceWanted )
 localCopyOfStateVariables = runCombinatoryLogic( localCopyOfStateVariables )
 putStateVariables(    instanceWanted )
 unlockStateVariables( instanceWanted )

Here is a state machine used to model analogue electronics.

Numerical integration is used to convert dV/dt to V with history.

The step size must be small else instabilities. The step size needs to be smaller than the time constant. Using a backward integration can be used.

And a simple circuit:-

The Black components are controlled voltages, the red components the controlled currents.

Ohms Law and Electronic circuits

Electronic circuits are components connected by wiring.

The voltage across a resistor is:

 V = R I

 I = G V

For capacitors and inductors

 dV/dt = I / C  

 dI/dt = V / L

Kirchoff had a theory about loops of voltages that sum to zero and currents flowing into a node sum to zero.

The wiring is expressed as a net list and a sum of currents and a sum of voltages can be expressed.

 [V] = [R] [K] [I] 

 [R] maps Currents into each resistor to voltages
 [K] is the kirchoff sum of currents from adjacent components.

Components map currents to voltages and currents to voltages.

Wiring sums up the currents into the nodes and voltages around loops of components.

Components can be thought of as Voltages sources controlled by currents or Currents controlled by voltages.

If the component is a controlled voltage , it is controlled by the current flowing though it, which is the sum of the currents

A tree of controlled voltages can be drawn, and the inverse of a tree drawn for the current. There should be no loops of controlled voltages.

Equations can be written and iterated numerically to find solutions.

Numerical integration is used to convert dV/dt to V with history.

The step size must be small to prevent instabilities.

Components can map other qualities.

The tree of components can have many branches.

Finding an event

Event driven software looks at the inputs and history and tries to make an event.

The rate of change of a variable is used or when a variable gets to a level or combination of inputs and history

State or Event

Do you order the code for a state machine by state or by event?


HomePage | RecentChanges | Preferences | My Website home page
This page is read-only | View other revisions
Last edited November 6, 2021 9:58 pm by dougrice.plus.com
Search: