{"id":22338160,"url":"https://github.com/clementetienam/data_driven_mpc_controller_using_ccr","last_synced_at":"2025-10-14T17:30:59.758Z","repository":{"id":191931958,"uuid":"321647147","full_name":"clementetienam/Data_Driven_MPC_Controller_Using_CCR","owner":"clementetienam","description":null,"archived":false,"fork":false,"pushed_at":"2020-12-15T11:50:51.000Z","size":12434,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-07T09:39:59.177Z","etag":null,"topics":["data-driven-mpc","machine-learning","mixture-of-experts","supervised-learning","time-series","xgboost-model"],"latest_commit_sha":null,"homepage":"","language":"MATLAB","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/clementetienam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-12-15T11:28:42.000Z","updated_at":"2025-02-04T03:12:01.000Z","dependencies_parsed_at":"2023-09-01T15:59:03.405Z","dependency_job_id":null,"html_url":"https://github.com/clementetienam/Data_Driven_MPC_Controller_Using_CCR","commit_stats":null,"previous_names":["clementetienam/data_driven_mpc_controller_using_ccr"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/clementetienam/Data_Driven_MPC_Controller_Using_CCR","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clementetienam%2FData_Driven_MPC_Controller_Using_CCR","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clementetienam%2FData_Driven_MPC_Controller_Using_CCR/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clementetienam%2FData_Driven_MPC_Controller_Using_CCR/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clementetienam%2FData_Driven_MPC_Controller_Using_CCR/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/clementetienam","download_url":"https://codeload.github.com/clementetienam/Data_Driven_MPC_Controller_Using_CCR/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clementetienam%2FData_Driven_MPC_Controller_Using_CCR/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279020077,"owners_count":26086806,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-driven-mpc","machine-learning","mixture-of-experts","supervised-learning","time-series","xgboost-model"],"created_at":"2024-12-04T06:13:20.690Z","updated_at":"2025-10-14T17:30:55.562Z","avatar_url":"https://github.com/clementetienam.png","language":"MATLAB","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Data_Driven_MPC_Controller_Using_CCR\n------------------------------------------------------------------------------\nBox Configuration\nInputs:\nEnvironment:Site Outdoor Air Drybulb Temperature [C]\nEnvironment:Site Outdoor Air Wetbulb Temperature [C]\nEnvironment:Site Outdoor Air Relative Humidity [%]\nEnvironment:Site Wind Speed [m/s]\nEnvironment:Site Wind Direction [deg]\nEnvironment:Site Horizontal Infrared Radiation Rate per Area [W/m2]\nEnvironment:Site Diffuse Solar Radiation Rate per Area [W/m2]\nEnvironment:Site Direct Solar Radiation Rate per Area [W/m2]\nTHERMAL ZONE: BOX:Zone Outdoor Air Wind Speed [m/s]\n\nOutputs:\nTHERMAL ZONE: BOX:Zone Mean Air Temperature [C]\n\n\n------------------------------------------------------------------------------\nGSHP configuration\nInputs:\nEnvironment:Site Outdoor Air Drybulb Temperature [C]\nEnvironment:Site Outdoor Air Wetbulb Temperature [C]\nEnvironment:Site Outdoor Air Relative Humidity [%]\nEnvironment:Site Wind Speed [m/s]\nEnvironment:Site Wind Direction [deg]\nEnvironment:Site Horizontal Infrared Radiation Rate per Area [W/m2]\nEnvironment:Site Diffuse Solar Radiation Rate per Area [W/m2]\nEnvironment:Site Direct Solar Radiation Rate per Area [W/m2]\nTHERMAL ZONE: BOX:Zone Outdoor Air Wind Speed [m/s]\nGSHPCLG:Heat Pump Electric Power [W]\nGSHPCLG:Heat Pump Source Side Inlet Temperature [C]\nGSHPHEATING:Heat Pump Electric Power [W]\nGSHPHEATING:Heat Pump Source Side Inlet Temperature [C]\n\n\nOutputs:\nTHERMAL ZONE: BOX:Zone Mean Air Temperature [C]\n\nData Driven MPC Approach. Online approach\nsteps:\n    1) Predict room temperature at time t given current weather states\n    2) Optimise for control at time t to reference room temperature\n    3) Predict room temperature at time t+1 using temperature at time t\n    4) Predict weather states for t+1 using temperature at t+1 (gotten from 3)\n    4) Set for next evolution, temperature at t= temperature at t+1\n      (prior(t)= posterior(t+1))\n    \nmathematically;    \ny=room temperature\nX=weather states\nu=control for GSHP pump\n\ninput: u(t-1)= initial guess,X(t-1)(= Known), r for all t(= known), f1, f2,g (= Learned),\ny(t-1)(=Infered from y(t-1)=f1(X(t-1))+e )\ng=LSTM machine\nf1=States to output (room temperature) machine (Pure weather conditions)\nf2=Augmented states (with control inputs) to room temperature\n\nset:\ny(1)=y(t-1) \nX(1)=X(t-1) \nu(1)=u(t-1) \nDo t= 1: Horizon:\n    y(t+1)=g(y(t))+n # Predict the future output given present output\n    y(t)=f1(X(t))+e # Predict current output with current states\n    ybig(t,:)=y(t)\n    u(opt)=argmin||r(t)-f2(X(t);u(t),X(t))||+z # Optimise the control at time t\n    ubig(t,:)=u(opt)\n    Xbig(t,:)=X\n    \n    X(opt)=argmin||y(t+1)-f1(X(t)||+z # Optimise the state at time t+1\n    set X(t)= X(t+1)=X(opt)\n    set u(t)= u(t+1)=u(opt)\n    \n    \nEnd Do\n\nGetting Started:\n---------------------------------\nThese instructions will get you a copy of the project up and running on your local machine for development and testing purposes. \nSee deployment for notes on how to deploy the project on a live system.\n\n-Run the script TRAINING.m to learn the machines of the LSTM, states to room temperature and states+contoller (GSHP pump) to temperature\n-Optimise the controller input using the DD_MPC.m for Batch optimisation or DD_MPC_SEQUENTIAL_2 for sequential optimsation\nPrerequisites:\n-------------------------------\nMATLAB 2018 upwards\n\nMethods:\n-------------------------------\nTwo methods are available for the optimisation problem;\n- LBFGS\n- Iterative Ensemble SMoother\n\n\n\nDatasets\n-----------------------------\nBoth datasets can be found i the Data directory\n- The Weather dataset for 2 years with a daily frequency is called \"Box.csv\"\n-The training dataset for the controller is found in the \"GSHP.csv\" FILE\n\nRunning the Numerical Experiment:\n-----------------------------\n-Run the script TRAINING.m to learn the machines of the LSTM, states to room temperature and states+contoller (GSHP pump) to temperature\n-Optimise the controller input using the DD_MPC.m for Batch optimisation or DD_MPC_SEQUENTIAL_2 for sequential optimsation\n\nDependencies\n----------------------------\n\n\nAll libraries are included for your convenience.\n\nManuscript\n-----------------------------\n-\n\nAuthor:\n--------------------------------\nDr Clement Etienam- Research Officer-Machine Learning. Active Building Centre\n\n\nAcknowledgments:\n------------------------------\n\n\nReferences:\n----------------------------\n\n[1] Luca Ambrogioni, Umut Güçlü, Marcel AJ van Gerven, and Eric Maris. The kernel mixture network: A non-parametric method for conditional density estimation \nof continuous random variables. arXiv preprint arXiv:1705.07111, 2017.\n\n[2] Christopher M Bishop. Mixture density networks. 1994.\n\n[3] Isobel C. Gormley and Sylvia Frühwirth-Schnatter. Mixtures of Experts Models. Chapman and Hall/CRC, 2019.\n\n[4] R.B. Gramacy and H.K. Lee. Bayesian treed Gaussian process models with an application to computer modeling. Journal of the American Statistical Association, 103(483):1119–1130,\n2008.\n\n[5] Robert A Jacobs, Michael I Jordan, Steven J Nowlan, Geoffrey E Hinton, et al. Adaptive\nmixtures of local experts. Neural computation, 3(1):79–87, 1991.\n2\n\n[6] Michael I Jordan and Robert A Jacobs. Hierarchical mixtures of experts and the em algorithm.\nNeural computation, 6(2):181–214, 1994.\n\n[7] Trung Nguyen and Edwin Bonilla. Fast allocation of gaussian process experts. In International\nConference on Machine Learning, pages 145–153, 2014.\n\n[8] Carl E Rasmussen and Zoubin Ghahramani. Infinite mixtures of gaussian process experts. In\nAdvances in neural information processing systems, pages 881–888, 2002.\n\n[9] Tommaso Rigon and Daniele Durante. Tractable bayesian density regression via logit stickbreaking\npriors. arXiv preprint arXiv:1701.02969, 2017.\n\n[10] Volker Tresp. Mixtures of gaussian processes. In Advances in neural information processing\nsystems, pages 654–660, 2001.\n\n[11] Lei Xu, Michael I Jordan, and Geoffrey E Hinton. An alternative model for mixtures of experts.\n\n[12] Rasmussen, Carl Edward and Nickisch, Hannes. Gaussian processes for machine learning (gpml) toolbox. The\nJournal of Machine Learning Research, 11:3011–3015, 2010\n\n[13] David E. Bernholdt, Mark R. Cianciosa, David L. Green, Jin M. Park, Kody J. H. Law, and\nClement Etienam. Cluster, classify, regress: A general method for learning discontinuous functions. Foundations of Data Science, \n1(2639-8001-2019-4-491):491, 2019.\n\n[14] Clement Etienam, Kody Law, Sara Wade. Ultra-fast Deep Mixtures of Gaussian Process Experts. arXiv preprint arXiv:2006.13309, 2020.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclementetienam%2Fdata_driven_mpc_controller_using_ccr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclementetienam%2Fdata_driven_mpc_controller_using_ccr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclementetienam%2Fdata_driven_mpc_controller_using_ccr/lists"}