visuEq: Displays the models Equations

Description Usage Arguments Author(s) Examples

Description

Displays the model equations for a polynomial model which description is provided as a matrix K, each column corresponding to one equation. The coefficients of the polynomial terms are given following the order defined by function poLabs. The matrix can also be provided in a list K, in this case, the matrix should be located in K$model[[selecmod]] where selecmod should be provided as input parameter.

Usage

1
2
3
4
5
6
7
8
visuEq(
  K,
  nVar = NULL,
  dMax = NULL,
  substit = 0,
  approx = FALSE,
  selecmod = NULL
)

Arguments

K

A matrix providing the model description: each column corresponds to one equation which polynomial organisation is following the convention defined by function poLabs.

nVar

The number of variables

dMax

The maximum degree allowed in the formulation

substit

Applies subtitutions to the default values: for substit = 0 (default value), variables are chosen as X1, X2, ... for substit = 1, variable X1, X2, ... will be replaced by x, y, z, ... for substit = 2, the codes provides a LaTex-like formulation of the model. The variables name can also be defined explicitely as follows: for substit = c('x', 'H', 'T1'), variables X1, X2, X3 ... will be replaced by x, H and T1.

approx

The number of extra digits to be used: for approx = FALSE (default value) digits are edited with double precision; for approx = TRUE, only the minimum number of digits is edited (in order to have all the terms different from 0) for approx = 1, 2, etc. then respectively 1, 2, etc. digits are added to the minimum number of digits corresponding to approx = TRUE.

selecmod

An integer providing the number in the sublist when the model matrix is provided in a list. Should not be provided (or NULL) if the model matrix is provided directly.

Author(s)

Sylvain Mangiarotti

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#EQUATIONS VISUALISATION
# number of variables:
nVar <- 3
# maximum polynomial degree:
dMax <- 2
# polynomial organization:
poLabs(nVar,dMax)
# model construction
KL = matrix(0, ncol = 3, nrow = 10)
KL[1,1] <- KL[2,2] <- 1
KL[4,1] <- -1
KL[5,3] <- -0.123456789
# Equations visualisation:
# (a) by default, variables names X1, X2, X3 are used
visuEq(KL, nVar, dMax)
# (b) for susbstit=1, variables names x, y, y are used instead
visuEq(KL, nVar, dMax, approx = TRUE, substit=1)
# (c) the name of the variables can also be chosen manualy
visuEq(KL, nVar, dMax, approx = 3, substit=c('U', 'V', 'W'))

# A canonical model can be provided as a single vector
polyTerms <- c(0.2,0,-1,0.5,0,0,0,0,0,0)
visuEq(KL, 3,2)

GPoM documentation built on Feb. 18, 2020, 5:08 p.m.