# m: Product of two LR fuzzy numbers In Calculator.LR.FNs: Calculator for LR Fuzzy Numbers

## Description

This function calculates the multiplication (product) of two LR fuzzy numbers. Although on the basis of Zadeh extension principle, the class of LR fuzzy numbers is not closed under the operations multiplication and division, but we consider the following approximation for the product of two LR fuzzy numbers M=(m, α, β)_{LR} and N=(n, γ, δ)_{LR} in this package to work easy in the class of LR fuzzy numbers:

M \otimes N \simeq ≤ft\{ \begin{array}{lcc} (mn, m γ + n α, m δ + n β)_{LR} &\ \ if & \ \ M \succ 0 \ and \ N \succ 0 \\ (mn, m γ - n β, m δ - n α)_{RL} &\ \ if & \ \ M \succ 0 \ and \ N \prec 0 \\ (mn, -n β - m δ , -n α -m γ)_{RL} &\ \ if & \ \ M \prec 0 \ and \ N \prec 0 \end{array} \right.

## Usage

 1 m(M, N) 

## Arguments

 M The first LR (or RL or L) fuzzy number N The second LR (or RL or L) fuzzy number

## Value

A LR (or RL or L) fuzzy number

Abbas Parchami

## References

Dubois, D., Prade, H., Fuzzy Sets and Systems: Theory and Applications. Academic Press (1980).

Dubois, D., Prade, H., Operations on fuzzy numbers. International Journal of Systems Science 9 (1978), 613-626.

Dubois, D., Prade, H., Fuzzy numbers: An overview. In In: Analysis of Fuzzy Information. Mathematical Logic, Vol. I. CRC Press (1987), 3-39.

Dubois, D., Prade, H., The mean value of a fuzzy number. Fuzzy Sets and Systems 24 (1987), 279-300.

Kaufmann, A., Gupta, M.M., Introduction to Fuzzy Arithmetic. van Nostrand Reinhold Company, New York (1985).

Taheri, S.M, Mashinchi, M., Introduction to Fuzzy Probability and Statistics. Shahid Bahonar University of Kerman Publications, In Persian (2009).

Viertl, R., Statistical Methods for Fuzzy Data. John Wiley & Sons, Chichester (2011).

Zadeh, L.A., The concept of a linguistic variable and its application to approximate reasoning-I. Information Sciences 8 (1975), 199-249.

## Examples

  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 # Example 1: Left.fun = function(x) { (1-x)*(x>=0)} Right.fun = function(x) { (1/(1+(2*abs(x))))*(x>=0)} A = LR(1, 0.6, 0.2) B = LR(-3, 0.5, 1) m(A, B) m(B, A) xlim = c(-5,4) LRFN.plot( A, xlim=xlim, lwd=2, lty=2, col=2) LRFN.plot( B, lwd=2, lty=2, col=3, add=TRUE) legend( "topright", c("A = LR(1, 0.6, 0.2)", "B = LR(-3, 0.5, 1)"), col = c(2, 3) , text.col = 1, lwd = c(2,2), lty = c(2, 2) ) # Example 2: Left.fun = function(x) { (1-x)*(x>=0)} Right.fun = function(x) { (exp(-x))*(x>=0)} A = LR(1.5, 1, 2) B = LR(3, 2, 1) LRFN.plot( A, xlim=c(-3,20), ylim=c(0,1), lwd=2, lty=2, col=2) LRFN.plot( B, lwd=2, lty=2, col=3, add=TRUE) LRFN.plot( m(A,B), lwd=2, lty=3, col=1, add=TRUE) legend( "topright", c("A = LR(1.5, 1, 2)", "B = LR(3, 2, 1)", "A * B = LR(4.5, 6, 7.5)") , col = c(2, 3, 1), text.col = 1, lwd = c(2,2,2), lty = c(2, 2, 3) ) # Example 3: M = LR(1.2, 0.6, 0.2) N = LR(3, 0.5, 1) m(M,N) m( LR(1.2, 0.6, 0.2) , LR(3, 0.5, 1) ) m(N,m(M,M)) m(m(N,M),M) LRFN.plot( M, xlim=c(-2,10), ylim=c(0,1.4), lwd=2, lty=2, col=2) LRFN.plot( N, lwd=2, lty=2, col=3, add=TRUE) LRFN.plot( m(M,N), lwd=2, lty=3, col=4, add=TRUE) LRFN.plot( m(M,M), lwd=2, lty=4, col=5, add=TRUE) LRFN.plot( m(m(N,M),M), lwd=2, lty=5, col=1, add=TRUE) legend( "topright", c("M = LR(1.2, 0.6, 0.2)", "N = LR(3, 0.5, 1)", "M * N = LR(3.6, 2.4, 1.8)" , "M * M = LR(3.6, 2.4, 1.8)", "(N * M) * M = LR(4.32, 5.04, 2.88)"), col = c(2, 3, 4, 5, 1), text.col = 1, lwd = c(2,2,2,2,2), lty = c(2, 2, 3, 4, 5) ) ## The function is currently defined as function (M, N) { options(warn = -1) if (messages(M) != 1) { return(messages(M)) } if (messages(N) != 1) { return(messages(N)) } if (M[4] != N[4]) { return(noquote(paste0("Production has NOT a closed form of a LR fuzzy number"))) } else if ((sign(M) == "Positive") & (sign(N) == "Positive")) { a1 = M[1] * N[1] a2 = (M[1] * N[2]) + (N[1] * M[2]) a3 = (M[1] * N[3]) + (N[1] * M[3]) a4 = (M[4] + N[4])/2 print(noquote(paste0("the result of multiplication is approximately (core = ", a1, ", left spread = ", a2, ", right spread = ", a3, ")", if (a4 == 0) { paste0(" LR") } else if (a4 == 1) { paste0(" RL") } else { paste0(" L") }))) return(invisible(c(a1, a2, a3, a4))) } else if ((sign(M) == "Negative") & (sign(N) == "Negative")) { a1 = M[1] * N[1] a2 = -(M[1] * N[2]) - (N[1] * M[2]) a3 = -(M[1] * N[3]) - (N[1] * M[3]) a4 = abs(M[4] - 1) print(noquote(paste0("the result of multiplication is approximately (core = ", a1, ", left spread = ", a2, ", right spread = ", a3, ")", if (a4 == 0) { paste0(" LR") } else if (a4 == 1) { paste0(" RL") } else { paste0(" L") }))) return(invisible(c(a1, a2, a3, a4))) } else if ((sign(M) == "Positive") & (sign(N) == "Negative")) { a1 = M[1] * N[1] a2 = (M[1] * N[2]) - (N[1] * M[3]) a3 = (M[1] * N[3]) - (N[1] * M[2]) a4 = abs(M[4] - 1) print(noquote(paste0("the result of multiplication is approximately (core = ", a1, ", left spread = ", a2, ", right spread = ", a3, ")", if (a4 == 0) { paste0(" LR") } else if (a4 == 1) { paste0(" RL") } else { paste0(" L") }))) return(invisible(c(a1, a2, a3, a4))) } else if ((sign(M) == "Negative") & (sign(N) == "Positive")) { a1 = M[1] * N[1] a2 = (N[1] * M[2]) - (M[1] * N[3]) a3 = (N[1] * M[3]) - (M[1] * N[2]) a4 = abs(N[4] - 1) print(noquote(paste0("the result of multiplication is approximately (core = ", a1, ", left spread = ", a2, ", right spread = ", a3, ")", if (a4 == 0) { paste0(" LR") } else if (a4 == 1) { paste0(" RL") } else { paste0(" L") }))) return(invisible(c(a1, a2, a3, a4))) } else { return(noquote(paste0( "A regular approxi. is not defined for multiplication since at least one of FNs is non + and non -" ))) } } 

### Example output

Attaching package: 'Calculator.LR.FNs'

The following object is masked from 'package:base':

sign

[1] A regular approximation is not defined for multiplication since at least one of LR fuzzy numbers is non-positive and non-negative fuzzy number
[1] A regular approximation is not defined for multiplication since at least one of LR fuzzy numbers is non-positive and non-negative fuzzy number
[1] the result of multiplication is approximately  (core = 4.5, left spread = 6, right spread = 7.5) LR
[1] the result of multiplication is approximately  (core = 3.6, left spread = 2.4, right spread = 1.8) LR
[1] the result of multiplication is approximately  (core = 3.6, left spread = 2.4, right spread = 1.8) LR
[1] the result of multiplication is approximately  (core = 1.44, left spread = 1.44, right spread = 0.48) LR
[1] the result of multiplication is approximately  (core = 4.32, left spread = 5.04, right spread = 2.88) LR
[1] the result of multiplication is approximately  (core = 3.6, left spread = 2.4, right spread = 1.8) LR
[1] the result of multiplication is approximately  (core = 4.32, left spread = 5.04, right spread = 2.88) LR
[1] the result of multiplication is approximately  (core = 3.6, left spread = 2.4, right spread = 1.8) LR
[1] the result of multiplication is approximately  (core = 1.44, left spread = 1.44, right spread = 0.48) LR
[1] the result of multiplication is approximately  (core = 3.6, left spread = 2.4, right spread = 1.8) LR
[1] the result of multiplication is approximately  (core = 4.32, left spread = 5.04, right spread = 2.88) LR
function (M, N)
{
options(warn = -1)
if (messages(M) != 1) {
return(messages(M))
}
if (messages(N) != 1) {
return(messages(N))
}
if (M[4] != N[4]) {
return(noquote(paste0("Production has NOT a closed form of a LR fuzzy number")))
}
else if ((sign(M) == "Positive") & (sign(N) == "Positive")) {
a1 = M[1] * N[1]
a2 = (M[1] * N[2]) + (N[1] * M[2])
a3 = (M[1] * N[3]) + (N[1] * M[3])
a4 = (M[4] + N[4])/2
print(noquote(paste0("the result of multiplication is approximately  (core = ",
a1, ", left spread = ", a2, ", right spread = ",
a3, ")", if (a4 == 0) {
paste0(" LR")
}
else if (a4 == 1) {
paste0(" RL")
}
else {
paste0(" L")
})))
return(invisible(c(a1, a2, a3, a4)))
}
else if ((sign(M) == "Negative") & (sign(N) == "Negative")) {
a1 = M[1] * N[1]
a2 = -(M[1] * N[2]) - (N[1] * M[2])
a3 = -(M[1] * N[3]) - (N[1] * M[3])
a4 = abs(M[4] - 1)
print(noquote(paste0("the result of multiplication is approximately  (core = ",
a1, ", left spread = ", a2, ", right spread = ",
a3, ")", if (a4 == 0) {
paste0(" LR")
}
else if (a4 == 1) {
paste0(" RL")
}
else {
paste0(" L")
})))
return(invisible(c(a1, a2, a3, a4)))
}
else if ((sign(M) == "Positive") & (sign(N) == "Negative")) {
a1 = M[1] * N[1]
a2 = (M[1] * N[2]) - (N[1] * M[3])
a3 = (M[1] * N[3]) - (N[1] * M[2])
a4 = abs(M[4] - 1)
print(noquote(paste0("the result of multiplication is approximately  (core = ",
a1, ", left spread = ", a2, ", right spread = ",
a3, ")", if (a4 == 0) {
paste0(" LR")
}
else if (a4 == 1) {
paste0(" RL")
}
else {
paste0(" L")
})))
return(invisible(c(a1, a2, a3, a4)))
}
else if ((sign(M) == "Negative") & (sign(N) == "Positive")) {
a1 = M[1] * N[1]
a2 = (N[1] * M[2]) - (M[1] * N[3])
a3 = (N[1] * M[3]) - (M[1] * N[2])
a4 = abs(N[4] - 1)
print(noquote(paste0("the result of multiplication is approximately  (core = ",
a1, ", left spread = ", a2, ", right spread = ",
a3, ")", if (a4 == 0) {
paste0(" LR")
}
else if (a4 == 1) {
paste0(" RL")
}
else {
paste0(" L")
})))
return(invisible(c(a1, a2, a3, a4)))
}
else {
return(noquote(paste0("A regular approxi. is not defined for multiplication since at least one of FNs is non + and non -")))
}
}


Calculator.LR.FNs documentation built on May 2, 2019, 8:25 a.m.