user28070: Regarding my program, it is a program that does some calculations and then outputs a voltage based on the result using analogWrite function. However my problem is that I had done my programming based on a misconception that analogWrite function via PWM does output an analog voltage, where in fact it only "simulates" the analog voltage instead.
Here are the relevant parts of my code :
int pwmOutput = 11;
int pwm = 0;

void compareNewOldVoltageYes(void)
{
  if(pv_Vnew > pv_Vold && pwm != 255)
  {
    ++pwm;           //increasing value
  }
  else if(pwm != 0)
  {
    --pwm;           //decreasing
  }
}

void compareNewOldVoltageNo(void)
{
  if(pv_Vnew > pv_Vold && pwm != 0)
  {
    --pwm;
  }
  else if(pwm != 255)
  {
    ++pwm;
  }
}

void loop() 
{
   reading();
   PowerCalculation();

   if(pv_NewP > pv_OldP)
   {
      compareNewOldVoltageYes();
   }
   else
   {
      compareNewOldVoltageNo();
   }

   analogWrite(pwmOutput, pwm);           //analogWrite

   float displayPWMvolt = pwm * 0.0196;

   Serial.print("Output Voltage: ");
   Serial.print(displayPWMvolt);
   Serial.println(" V");

   pv_OldP = pv_NewP;

   Serial.print("Previous Power: ");
   Serial.print(pv_OldP);
   Serial.println(" W");

}

As for the circuitry, output pin 11 is being connected to a 1 ohm resistor and then to GND. (Where I measured the voltage) I am using Arduino Uno board.
UPDATE:
As said in the comments by @DatHa, pwm does not output voltage. Is there a way to output voltage as said, without changing the board?

user8552: There is no direct way. 
In addition to @Majenko
Alternative way: you can use H bridge like L293d to provide continuous level. Many diy inverter circuits are useing this technique. 
http://www.instructables.com/id/How-to-Make-an-Inverter-Using-ARDUINO/?ALLSTEPS

user28569: As far as I know Arduinos have ADC (Analog to Digital Converters) but do not have any DAC (Digital to Analog Converters). So you can not output a set voltage from any pins based on a digital value.

user6628: At 5V, a 1 ohm resistor will try to sink 1A and far exceed the 40mA specs.  Please use at least a 5/0.040=125 ohm resistor to protect your pin.  And if you put the a capacitor between your resistor and ground, the RC circuit of the capacitor will smooth out the PWM into an analog voltage.   
Please try the suggested @russell answer with a 47K resistor and 1uF capacitor, you will get an analog voltage at the junction to use with your electronic load.

user4143: You basically have three options:

Switch to an Arduino Due which has a built-in DAC which outputs a real voltage.
Add an external DAC chip (such as the MCP4821/2) to create the voltage for you
Use a low-pass filter (R-C network) on a PWM pin.

Of the three options I usually use an MCP4822 since it gives the best results and doesn't cost as much as using a Due. 

28070: <p>Regarding my program, it is a program that does some calculations and then outputs a voltage based on the result using analogWrite function. However my problem is that I had done my programming based on a misconception that analogWrite function via PWM does output an analog voltage, where in fact it only "simulates" the analog voltage instead.</p>

<p>Here are the relevant parts of my code :</p>

<pre><code>int pwmOutput = 11;
int pwm = 0;

void compareNewOldVoltageYes(void)
{
  if(pv_Vnew &gt; pv_Vold &amp;&amp; pwm != 255)
  {
    ++pwm;           //increasing value
  }
  else if(pwm != 0)
  {
    --pwm;           //decreasing
  }
}

void compareNewOldVoltageNo(void)
{
  if(pv_Vnew &gt; pv_Vold &amp;&amp; pwm != 0)
  {
    --pwm;
  }
  else if(pwm != 255)
  {
    ++pwm;
  }
}

void loop() 
{
   reading();
   PowerCalculation();

   if(pv_NewP &gt; pv_OldP)
   {
      compareNewOldVoltageYes();
   }
   else
   {
      compareNewOldVoltageNo();
   }

   analogWrite(pwmOutput, pwm);           //analogWrite

   float displayPWMvolt = pwm * 0.0196;

   Serial.print("Output Voltage: ");
   Serial.print(displayPWMvolt);
   Serial.println(" V");

   pv_OldP = pv_NewP;

   Serial.print("Previous Power: ");
   Serial.print(pv_OldP);
   Serial.println(" W");

}
</code></pre>

<p>As for the circuitry, output pin 11 is being connected to a 1 ohm resistor and then to GND. (Where I measured the voltage) I am using Arduino Uno board.</p>

<p><strong>UPDATE</strong>:</p>

<p>As said in the comments by @DatHa, pwm does not output voltage. <strong>Is there a way to output voltage as said, without changing the board?</strong></p>
 8552: <p>There is no direct way. </p>

<p>In addition to @Majenko</p>

<p>Alternative way: you can use H bridge like L293d to provide continuous level. Many diy inverter circuits are useing this technique. </p>

<p><a href="http://www.instructables.com/id/How-to-Make-an-Inverter-Using-ARDUINO/?ALLSTEPS" rel="nofollow noreferrer">http://www.instructables.com/id/How-to-Make-an-Inverter-Using-ARDUINO/?ALLSTEPS</a></p>
 28569: <p>As far as I know Arduinos have ADC (Analog to Digital Converters) but do not have any DAC (Digital to Analog Converters). So you can not output a set voltage from any pins based on a digital value.</p>
 6628: <p>At 5V, a 1 ohm resistor will try to sink 1A and far exceed the 40mA specs.  Please use at least a 5/0.040=125 ohm resistor to protect your pin.  And if you put the a capacitor between your resistor and ground, the RC circuit of the capacitor will smooth out the PWM into an analog voltage.   </p>

<p>Please try the suggested <a href="https://arduino.stackexchange.com/a/10047/6628">@russell answer</a> with a 47K resistor and 1uF capacitor, you will get an analog voltage at the junction to use with your electronic load.</p>
 4143: <p>You basically have three options:</p>

<ol>
<li>Switch to an Arduino Due which has a built-in DAC which outputs a real voltage.</li>
<li>Add an external DAC chip (such as the MCP4821/2) to create the voltage for you</li>
<li>Use a low-pass filter (R-C network) on a PWM pin.</li>
</ol>

<p>Of the three options I usually use an MCP4822 since it gives the best results and doesn't cost as much as using a Due. </p>
