Skip to main content

9.3) Including PV Lifetime


Before we start implementing tools to measure and observe our model. We need to make sure that our PV installations do age and eventually die. The best way to do this is with an ask turtles with [ ] statement at the end of the go procedure. The age is fairly easy as we do have a parameter for the PV age already, we just need to increase that every year (first line). We then want to check if the age is longer than the PV lifetime with an if statement. We are not using a fixed lifetime as the panels may vary regarding the time they live. To account for that we use a normal distribution around the average PV lifetime with a standard deviation of 5 years. Check the NetLogo primitive random-normal in the dictionary and read about other random distributions available, there too. If the solar panels go out of stock we reset the PV related patch variables to their default values. To test the procedure type show “PV panel died” into the if statement.

Insert the following code at the end of the go procedure.

 ask turtles with [PV] [
    set PV-age PV-age + 1
    if PV-age > random-normal PV-lifetime 5 [
       set PV false
       set PV-age 0
       set PV-output 0
       ]
    ]