Learn R Programming

ZEP (version 0.3.1)

AnimateListZEP: Function for animation of the whole list of fuzzy numbers

Description

AnimateListZEP animates the whole list consisting of fuzzy numbers.

Usage

AnimateListZEP(
  listOfValues,
  FUN,
  knots = 10,
  grid = TRUE,
  approximation = FALSE,
  method = "NearestEuclidean",
  sleep = 1,
  ...
)

Value

The figures are animated: the series of the input and output fuzzy numbers (for the Zadeh's principle and the applied function) or their approximation (if selected).

Arguments

listOfValues

List of the input fuzzy numbers.

FUN

Function used for the input fuzzy number with the help of the Zadeh's principle.

knots

Number of the alpha-cuts used during calculation of the output.

grid

If TRUE, then additional grid is plotted.

approximation

If TRUE, the approximated output is calculated.

method

The selected approximation method.

sleep

Interval between frames in the animation.

...

Additional parameters passed to other functions.

Details

The function takes the list of input fuzzy numbers listOfValues (which should be described by one of the classes from FuzzyNumbers package) and applies the function FUN using the Zadeh's principle. The output is given as animation of consecutive fuzzy numbers or their approximations (when approximation is set to TRUE and the respective method is selected). To properly find the output, value of FUN is calculated for many alpha-cuts of listOfValues. The number of these alpha-cuts is equal to knots (plus 2 for the support and the core). If the approximation is used, then the approximated fuzzy number is shown with green line.

The input fuzzy number from a list listOfValues should be given by fuzzy number described by classes from FuzzyNumbers package.

Examples

Run this code

library(FuzzyNumbers)

# prepare list of fuzzy numbers

a <- seq(0,5,by=1)

fuzzyList <- list()

for (i in 1:length(a)) {
 
 fuzzyList[[i]] <- TrapezoidalFuzzyNumber(i,i+1,2*i+1,3*i+1)
 
}

# check the list
fuzzyList

# now some animations for various functions and then with approximation
AnimateListZEP(fuzzyList,FUN=function(x) x^2)

AnimateListZEP(fuzzyList,FUN=function(x) sin(x))

AnimateListZEP(fuzzyList,FUN=function(x) x^3+1,approximation = TRUE)




Run the code above in your browser using DataLab