Optimal Spatiotemporal Resource Allocation In Public Health And Renewable Energy