I made a calculation test based on the formula of this video:
I used the following algorithm:
function simular() {
var radiacao = 5.6;
var tarifa = 0.71;
var valorc = $("#valor-conta").val();
var consumom = (valorc / tarifa);
var paineis = ((consumom * 1000) / 30); // consumo diario
paineis = ((paineis * 0.86) / radiacao); // eficiencia / radiacao
paineis = parseFloat(paineis.toFixed(1)).toFixed(3); // ajusta o resultado
$("#quantidade-paineis").val(Math.ceil(paineis / 330)); // quantidade de placas de 330w nescessárias
}
<script src="http://code.jquery.com/jquery-1.12.4.min.js"></script><inputtype="text" id="valor-conta" value="100" />
<input type="text" id="quantidade-paineis" value="0" />
<button onClick="simular()"> Simular </button>
The result works but when comparing with other existing simulators it modifies the result of number of boards, do not know the correct calculation, if the simulators are calculating wrong, or my code does not follow the correct pattern.
LINK Simulator: link