I'm very new in modeling systems. With a friend's help, We created this model in R
hours <- seq(6+20/60, 18+31/60, 0.01)
h_radians <- (pi/12) * (hours - (12+26/60))
doy <- 268
decl_radians <- 23.45 * sin(2*pi*(284+doy)/365) * pi / 180
lat_radians <- 23.45 * pi / 180
sin_gamma <- sin(lat_radians)*sin(decl_radians) + cos(lat_radians)*cos(decl_radians)*cos(h_radians)
m <- 1/sin_gamma
irradiance[is.na(irradiance)] <- 0
irradiance <- 1353 * sin_gamma * 0.687 ^ (m ^ 0.678)
the output is like that;
When I try to move this mathematical model to simulink, cannot do it. That is what I tried to do
Actually, I cant imagine how the time is used in Simulink. Would you help me to fix my issue ?