# pistonSimulation: The Piston Simulator In mistat: Data Sets, Functions and Examples from the Book: "Modern Industrial Statistics" by Kenett, Zacks and Amberti

 pistonSimulation R Documentation

## The Piston Simulator

### Description

A simulator of a piston moving whithin a cylinder. The piston's performance is measured by the time it takes to complete one cycle, in seconds. Several factors can affect the piston's performance, they are listed in the arguments section.

### Usage

```pistonSimulation(m = 60, s = 0.02, v0 = 0.01,
k = 5000, p0 = 110000, t = 296,
t0 = 360, each = 50, seed = NA,
check = TRUE)
```

### Arguments

 `m` the impact pressure determined by the piston weight (kg). A single value or a vector of length n. `s` the piston surface area (m^2). A single value or a vector. `v0` the initial volume of the gas inside the piston (m^3). A single value or a vector of length n. `k` the spring coefficient (N/m^3). A single value or a vector of length n. `p0` the atmospheric pressure (N/m^2). A single value or a vector of length n. `t` the surrounding ambient temperature (K). A single value or a vector of length n. `t0` the filling gas temperature (K). A single value or a vector of length n. `each` non-negative integer. Each element of previous parameters is repeated `each` times. `seed` a single value, interpreted as an integer. If specified make the simulation replicable. `check` if `TRUE` (the default) then a formal check on piston parameters is perfomed

### Details

Factors affect the Cycle Time s via a chain of nonlinear equations:

seconds = 2π sqrt(m/(k + s^2 ((p0 v0)/t0) (t/v^2)))

where

v = (s/2k) (sqrt(a^2 + 4k (p0 v0)/t0 t) - a)

and

a = p0 s + 19.62m - (k v0)/s

### Value

A data frame, a matrix-like structure, with `each` * n rows and with columns:

 m numeric value of `m` s numeric value of `s` v0 numeric value of `v0` k numeric value of `k` p0 numeric value of `p0` t numeric value of `t` t0 numeric value of `t0` seconds numeric time to complete one cycle (s)

Daniele Amberti

### References

Kenett, R., Zacks, S. with contributions by Amberti, D. Modern Industrial Statistics: with applications in R, MINITAB and JMP. Wiley.

### See Also

`powerCircuitSimulation`, `simulationGroup`, `LATHYPPISTON`

### Examples

```Ps <- pistonSimulation(
m = rep(60, 100),
s = rep(0.02, 100),
v0 = rep(0.01, 100),
k = rep(5000, 100),
p0 = rep(110000, 100),
t = c(rep(296,35), 296*1.1^(1:65)),
t0 = rep(360, 100),
each = 1,
seed = 123,
check = FALSE)
head(Ps)
tail(Ps)
plot(Ps\$seconds)
```

mistat documentation built on March 7, 2023, 6:43 p.m.