Calculation for quantity of JAVASCRIPT photovoltaic panels (JQUERY)

Asked

Viewed 218 times

0

I did a calculation test based on the formula of this video:

https://www.youtube.com/watch?v=NdFHC3gv63U

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>

<input type="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, I do not know the right calculation, if the simulators are miscalculating, or my code does not follow the correct standard.

LINK Simulator: https://portalsolar.com.br/calculo-solar/iframe

  • Good guy, I do not know how it is accomplished these calculations exactly, but, the code already gives error right away, because you are calling elements that to the jQuery do not exist as $("valor-conta").val(); and $("quantidade-paineis"). Out also other mistakes like $("quantidade-paineis").val() = Math.ceil(paineis / 330);, that does not exist in jQuery, when the correct would be $("quantidade-paineis").val(Math.ceil(paineis / 330));

  • Yes it is that I made a sketch in case he takes the value of the account, example 100 real he divides by the tariff that returns in the case the monthly consumption in kWh, that has to be multiplied by 1000 to base its value of wats, dividing by 30 days that is not well every month that has 30, others have 31, it’s just simulator, the code I made now did not copy the project, but I will put with the HTML together I will edit it, thanks friend.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.