KWR-Water / pysimdeum

SIMDEUM in python
European Union Public License 1.2
17 stars 7 forks source link

strange pattern #26

Open FANGXinyudd opened 1 year ago

FANGXinyudd commented 1 year ago

Hello team, when I was running the model, I generated a pattern, but I don't know the reason. It looks like the user used a dishwasher or washing machine between 0:00 and 2:00, but there no water was used at any other time. Moreover, the water usage reached 0.25 at midnight, which is very strange, but I cannot find the reason. In fact, I have generated this kind of pattern more than once. Have you encountered similar situations before? What caused this extreme situation to be generated?

BramHillebrand commented 1 year ago

Could you provide a little more information? What kind of house did you generate? for instance

FANGXinyudd commented 1 year ago

here is my script for your reference: `def simulate_water_consumption(param_values): stats = Statistics() prop = Property(statistics=stats) house = prop.built_house(house_type='one_person') house.populate_house() for user in house.users: age = user.age gender = user.gender print("Number of Household Members:", '1') print("User Age:", user.age) print("User Gender:", user.gender)

for key, appliances in house.statistics.end_uses.items():
    classname = appliances['classname']
    if classname == 'Wc':
           appliances['subtype']['WcNormal']['duration'] = pd.Timedelta(minutes=param_values[0])
           appliances['subtype']['WcNormalSave']['duration'] = pd.Timedelta(minutes=param_values[0])
           appliances['subtype']['WcNew']['duration'] = pd.Timedelta(minutes=param_values[1])
           appliances['subtype']['WcNewSave']['duration'] = pd.Timedelta(minutes=param_values[1])
           appliances['frequency']['average']['work_ad'][gender] = param_values[2]
           appliances['frequency']['average']['home_ad'][gender] = param_values[3]
           appliances['frequency']['average']['senior'][gender] = param_values[4]
           appliances['intensity'] = param_values[5]
           appliances['prob_flush_interuption'] = param_values[6]
           appliances['prob_flush_interuption'] = param_values[6]

furnish house

house.furnish_house()
print("List of Devices:")
print(house.appliances) 

for users in house.users:
     weekday=True
     statistics=stats
     presence = Presence(user=users,weekday=weekday, stats=statistics)
     if presence.go == presence.up:
        presence.go = presence.up + pd.Timedelta(minutes=30)
     if presence.home >= pd.Timedelta(minutes=1440):
        presence.home = pd.Timedelta(minutes=1320)
     pdf = presence.pdf(peak=0.65, normal=0.335, away=0, night=0.015)
     users.presence = pdf

# Simulate water consumption for the house (xarray.DataArray)
consumption = house.simulate(num_patterns=100)   

# consumption (1s) for one household
tot_cons = consumption.sum(['enduse', 'user']).mean(['patterns'])
tot_cons.plot()
tot_cons.rolling(time=3600, center=True).mean().plot()
plt.title("Household Water End-Use Pattern")
plt.show()
# total water use
daily_cons = tot_cons.sum(dim = 'time').values    
return daily_cons`

simulation

for x in (param_value): Y= np.array(simulate_water_consumption(x))

BramHillebrand commented 3 months ago

This script does not allow me to reproduce. However a new version (1.0.1) was released. If you could varify it still occurs in that version that would be great.