- #1

- 2

- 0

## Main Question or Discussion Point

Hi guys I'm new to MATLAB but now i need to use it for my study. I've tried to learn by myself to run it but unfortunately it failed, so I need some guidance on how to run following time step function in MATLAB

S

= S

then

R

= P

P

ET

S = Retained rainwater depth in substrate

S

R = runoff

it is a hourly time step function, hourly rainfall data for a year will be inserted to the function

i would be really appreciated if anyone could help me.

S

_{t}= S_{t-1}+ P_{t}- ET_{t}, S_{t-1}+ P_{t}- ET_{t}≤ S_{max}= S

_{max}, S_{t-1}+ P_{t}- ET_{t}> S_{max}then

R

_{t}= 0, S_{t-1}+ P_{t}- ET_{t}≤ S_{max}= P

_{t}- (S_{max}- S_{t-1}) - ET_{t}, S_{t-1}+ P_{t}- ET_{t}> S_{max}P

_{t}= rainfall depthET

_{t}= evapotranspiration rateS = Retained rainwater depth in substrate

S

_{max}= maximum retention capacityR = runoff

it is a hourly time step function, hourly rainfall data for a year will be inserted to the function

i would be really appreciated if anyone could help me.