Beginner Question: How to use JuMP model variables in different functions

Just add M3_storage = m[:M3_storage] as a first line of your new function