I have a fuzzy system with 2 inputs and 1 output, each has 5 membership functions, thus there is 5*5*5=125 rules for this system. how can i find the true rules using a computer program, or using an algorithm?
You do not need to have 125 rules. You can have something like this
if x is x1 and y is y1, then z =z1.
This means that you need 25 rules maximum.
To generate the rules automatically, you have to know the required behavior as a mathematical function, linguistic rules or to optimize certain criteria. Please provide us with the required objectives in order to tell you the technique of rule generation.
Number of memberships and rules depend on your idea. Fuzzy is an artificial intelligence technique, this mean, input-output realations can be selected as how we want. You need to know, ANFIS may be used, but rules and memberships must be individuated. Because all systems are different from ecah others. Be carefull, effect of an input have any variance on the output? After this one, you can use this effect for output direction.
Number of rules can be reduced to an extent with the help of experts in the particular topic you are persuading, and the in depth idea on the topic and your experience also lets you know which are the best set of rules to applied for your particular problem. You can use Qualitative and quantitative analysis by yourself for deciding on the rules. But generally the number rules generated for your case is, Number of Rules = Number of Inputs * Number of linguistic variables/[ membership functions in your case] assigned for each input. You can also search for journals on "Rule extraction for Fuzzy modelling".
The number of rules for your system can be as low as 4 for a simple system. If you two inputs (x1 and x2) and one output (y), you define only 2 linguistic variable (low and high ) for inputs and outputs.
If x1 in high and x2 is high THEN …
If x1 in high and x2 is high THEN …
If x1 in high and x2 is high THEN …
If x1 in high and x2 is high THEN …
Clustering can be used for extracting fuzzy rules for function approximation and to determine the number of rules and initial rule parameters Each cluster essentially identifies a region in the data space that containsa sufficient NUMBER of data to support the existence of a fuzzy input/output relationship. Because a rule is generated only where there is a cluster of data, the resultant rules are scattered in the input space rather than placed according to grid-like partitions in the input space.
You construct 25 (5x5) rules of type IF (x1 is small) AND (x2 is medium) THEN (y is ?). For each rule you have to investigate what value of y is true (correct, appropriate) for given values of x1 and x2. This knowledge you can get from the system ekspert or from the learning process of a neuro-fuzzy network with sample pieces of the system under modeling.