! Programa_MPPT_simplificado.f90
! Calcula Pm (potencia máxima) usando la ecuación derivada de Shockley.
! Solo usa los valores definidos en el código, sin entrada del usuario.
! Compilar: gfortran -O2 -o Programa_MPPT Programa_MPPT_simplificado.f90
! Ejecutar: ./Programa_MPPT

program Programa_MPPT_simplificado
  implicit none
  integer, parameter :: dp = kind(1.0d0)
  real(dp) :: q, k, G
  real(dp) :: T_cell, T, coef, n_max, n_min, n
  real(dp) :: I0, IL, Im, Vm
  real(dp) :: Rs, Rsh
  real(dp) :: Pm

  ! Parámetros base
  q = 1.602d-19
  k = 1.381d-23
  G = 990.0d0

  T_cell = 54.85
  T = T_cell + 273.15

  n_max = 2.0
  n_min = 1.0
  coef  = 0.0015

  I0 = 1.8993d-22
  IL = 1.5768
  Im = 1.5351
  Vm = 2.3487

  Rs = 0.0094d0
  Rsh = 14.0d12

  ! Calcular n
  n = n_max + (n_min - n_max) * exp(-coef * G)

  ! Calcular Pm
  Pm = ((n * k * T) / q) * Im * log((IL - Im - (Vm + Im * Rs) / Rsh) / I0) - Im**2 * Rs

  print *, '--- Resultado del cálculo de Pm ---'
  print '(A, F8.6)', 'n =', n
  print '(A, F10.6)', 'Pm =', Pm

end program Programa_MPPT_simplificado

Embed on website

To embed this program on your website, copy the following code and paste it into your website's HTML: