title: The solution to solve the assertion error and Value error?
body: <p>This is my code with some problem.</p>
  
  <p>AssertionError: Total area is zero in defuzzification!</p>
  
  <p>ValueError: Crisp output cannot be calculated, likely because the system is too sparse. Check to make sure this set of input values will activate at least one connected Term in each Antecedent via the current set of Rules.
  Top of this two error is show after i run my code. </p>
  
  <p>Below the code is the full error message after i run.
  may i know what and where is the problem ?</p>
  
  <pre class="lang-py prettyprint-override"><code>import numpy as np
  import skfuzzy as fuzz
  from skfuzzy import control as ctrl
  
  Temp = ctrl.Antecedent(np.arange(0,101,1),'temperature')
  Temp['Low'] = fuzz.trapmf(Temp.universe, [0,0,20,30])
  Temp['Medium'] = fuzz.trimf(Temp.universe, [25,50,70])
  Temp['High'] = fuzz.trapmf(Temp.universe, [60,80,100,100])
  
  Humidity = ctrl.Antecedent(np.arange(0,101,1),'Humidity')
  Humidity['Poor']=fuzz.trapmf(Humidity.universe, [0,0,10,20])
  Humidity['Fair']=fuzz.trimf(Humidity.universe, [15,30,50])
  Humidity['Good'] = fuzz.trapmf(Humidity.universe, [45,60,100,100])
  
  CO = ctrl.Antecedent(np.arange(0,101,1),'CO')
  CO['Low'] = fuzz.trapmf(CO.universe, [0,0,25,35])
  CO['Medium'] = fuzz.trimf(CO.universe, [30,50,70])
  CO['High'] = fuzz.trapmf(CO.universe, [65,80,100,100])
  
  CO2 = ctrl.Antecedent(np.arange(0,101,1),'CO2')
  CO2['Low'] = fuzz.trapmf(CO2.universe, [0,0,10,20])
  CO2['Medium'] = fuzz.trimf(CO2.universe, [15,30,50])
  CO2['High'] = fuzz.trapmf(CO2.universe, [45,60,100,100])
  
  Condition = ctrl.Consequent(np.arange(0,101,1),'Health Condition')
  Condition['Very Good']=fuzz.trapmf(Condition.universe, [0,0,10,30])
  Condition['Good']=fuzz.trimf(Condition.universe, [20,30,40])
  Condition['Medium']=fuzz.trimf(Condition.universe, [35,50,65])
  Condition['Bad']=fuzz.trimf(Condition.universe, [60,70,80])
  Condition['Dangerous']=fuzz.trapmf(Condition.universe, [75,90,100,100])
  
  Temp.view()
  Humidity.view()
  CO.view()
  CO2.view()
  Condition.view()
  
  rule1 = ctrl.Rule(Temp['Medium'] &amp; Humidity['Fair'] &amp; CO['Low'] &amp; CO2['Low'], Condition['Good'])
  rule2 = ctrl.Rule(Temp['Medium'] &amp; Humidity['Good'] &amp; CO['Medium'] &amp; CO2['Low'], Condition['Very Good'])
  rule3 = ctrl.Rule(Temp['Low'] &amp; Humidity['Poor'] &amp; CO['High'] &amp; CO2['High'], Condition['Dangerous'])
  rule4 = ctrl.Rule(Temp['High'] &amp; Humidity['Poor'] &amp; CO['Medium'] &amp; CO2['Low'], Condition['Bad'])
  rule5 = ctrl.Rule(Temp['Low'] &amp; Humidity['Fair'] &amp; CO['Medium'] &amp; CO2['Medium'], Condition['Medium'])
  
  rule1.view()
  rule2.view()
  rule3.view()
  rule4.view()
  rule5.view()
  
  Health_ctrl = ctrl.ControlSystem([rule1, rule2, rule3, rule4, rule5])
  HealthResult = ctrl.ControlSystemSimulation(Health_ctrl)
  
  HealthResult.input['temperature'] =45
  HealthResult.input['Humidity'] =40
  HealthResult.input['CO'] =50
  HealthResult.input['CO2'] =75
  
  HealthResult.compute()
  
  print(HealthResult.output['Health Condition'])
  Condition.view(sim=HealthResult)
  
  
  
  ---------------------------------------------------------------------------
  AssertionError                            Traceback (most recent call last)
  /usr/local/lib/python3.6/dist-packages/skfuzzy/control/controlsystem.py in defuzz(self)
      586                 return defuzz(ups_universe, output_mf,
  --&gt; 587                               self.var.defuzzify_method)
      588             except AssertionError:
  
  3 frames
  /usr/local/lib/python3.6/dist-packages/skfuzzy/defuzzify/defuzz.py in defuzz(x, mfx, mode)
      247         zero_truth_degree = mfx.sum() == 0  # Approximation of total area
  --&gt; 248         assert not zero_truth_degree, 'Total area is zero in defuzzification!'
      249 
  
  AssertionError: Total area is zero in defuzzification!
  
  During handling of the above exception, another exception occurred:
  ValueError                                Traceback (most recent call last)
  &lt;ipython-input-4-f358e5f1a15d&gt; in &lt;module&gt;()
       56 HealthResult.input['CarbonDioxide'] =75
       57 
  ---&gt; 58 HealthResult.compute()
       59 
       60 print(HealthResult.output['Health Condition'])
  
  /usr/local/lib/python3.6/dist-packages/skfuzzy/control/controlsystem.py in compute(self)
      371         for consequent in self.ctrl.consequents:
      372             consequent.output[self] = \
  --&gt; 373                 CrispValueCalculator(consequent, self).defuzz()
      374             self.output[consequent.label] = consequent.output[self]
      375 
  
  /usr/local/lib/python3.6/dist-packages/skfuzzy/control/controlsystem.py in defuzz(self)
      587                               self.var.defuzzify_method)
      588             except AssertionError:
  --&gt; 589                 raise ValueError("Crisp output cannot be calculated, likely "
      590                                  "because the system is too sparse. Check to "
      591                                  "make sure this set of input values will "
  
  ValueError: Crisp output cannot be calculated, likely because the system is too sparse. Check to make sure this set of input values will activate at least one connected Term in each Antecedent via the current set of Rules.
  </code></pre>