ChangePerIterate: ChangePerIterate A function for plotting the change in each...

View source: R/Figures.R

ChangePerIterateR Documentation

ChangePerIterate A function for plotting the change in each vector per iterate.

Description

ChangePerIterate A function for plotting the change in each vector per iterate.

Usage

ChangePerIterate(
  Inputs,
  Outputs,
  ConvergenceVector = c(),
  ConvergenceSigFig = 5,
  ShowInputs = TRUE,
  ShowOutputs = TRUE,
  ShowPrevious = TRUE,
  xaxis = c(),
  secondhold = 0,
  FromIterate = 1,
  ToIterate = c()
)

Arguments

Inputs

The Inputs matrix returned by FixedPoint.

Outputs

The Outputs matrix returned by FixedPoint.

ConvergenceVector

The Convergence vector returned by fixedpoint.

ConvergenceSigFig

The number of significant figures convergence values should be shown with in the plot header.

ShowInputs

A boolean describing whether to show the inputs in the figure.

ShowOutputs

A boolean describing whether to show the outputs in the figure.

ShowPrevious

A boolean describing whether to show the previous inputs/outputs in the figure.

xaxis

A vector for meaningful values corresponding to the input/output values. By default the indexes of each input/output vector are used.

secondhold

If this is -1 or less then all plotting happens immediately. This means that very quickly only the last iterate will be seen so it makes sense to do it only if FromIterate and ToIterate indicate only one iterate. If this is 0 then a user can click through each figure. If this is positive then it describes how many seconds to pause between frames. By default this is 0 so a user must click through each frame.

FromIterate

This describes what iterate to show first.

ToIterate

This describes what iterate to show last.

Value

This function returns nothing. It just shows a plot in the console.

Examples

Inputs = seq(1,10)
Function = function(x){ cos(x) }
A = FixedPoint(Function, Inputs, Method = "Anderson")
ChangePerIterate(A$Inputs, A$Outputs, A$Convergence)
#Any now to have it play one frame every half a second starting from the nineth iterate
ChangePerIterate(A$Inputs, A$Outputs, A$Convergence, secondhold = 0.5, FromIterate = 9)

FixedPoint documentation built on Dec. 28, 2022, 2:56 a.m.