I am working on a project for my Applied Mathematics major, basically I have a number class (triangular fuzzy numbers) and I have a function that uses similarity method on fuzzy numbers I give as input.
Problem is, this is a Fuzzy Linear Programming problem, so what I do is let's say:
For fuzzy numbers A, B and C:
Max Z = (2, 3, 4)A (+) (3, 5, 7)B (+) (2, 4, 6)C
To find Max Z, I have to turn this into the following:
Max Z = Sqrt((1/3)((2Ax + 3Ay + 4Az)^2 + (3Bx + 5By + 7Bz)^2 + (2Cx + 4Cy + 6Cz)^2))
There is also ranking function, which takes x, y and z of a fuzzy number and gives back (x+2y+z)/4
So for fuzzy number (3, 5, 7)A it has to give back:
(3Ax + 10Ay + 7Az)/4
What is the best approach to this?
I decided to give my "Triangular Fuzzy" or Trifuz class called __type, which is "Defined" as default but it has a try/expect method that tries to convert input parameters to create a triangular fuzzy number (like Trifuz([3, 5, 7])) into int and if it is unable, it assigns itself as "Undefined" so I can know if a fuzzy numbers is defined as numbers or defined as unknowns.
Problem is, operation on a Fuzzy Number A = (Ax, Ay, Az) is easy, operating on fuzzy number A = (3Ax, 5Ay, 7Az) is hard because I need to be able to operate on these numbers like 3, 5 and 7, while Ax, Ay and Az are reassigned to new values.
What is the best approach to this?
Edit: Also I am talking about operating on numeric part of the unknown number, not operating on unknown part. I want to sqrt(2x) to return 1.414√x.
Forgot to mention that I am trying to do this without using any additional libraries, especially any math related libraries, even Math itself.