{"id":16542713,"url":"https://github.com/sakura-cat/water-tank","last_synced_at":"2025-10-28T15:30:57.789Z","repository":{"id":234728761,"uuid":"789303650","full_name":"SAKURA-CAT/water-tank","owner":"SAKURA-CAT","description":"基于Matlab的单水箱液位的模糊控制系统设计","archived":true,"fork":false,"pushed_at":"2024-05-29T07:58:04.000Z","size":1013,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-23T14:19:19.489Z","etag":null,"topics":["fuzzy-control","matlab","x-du"],"latest_commit_sha":null,"homepage":"","language":"MATLAB","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SAKURA-CAT.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-20T07:15:03.000Z","updated_at":"2025-01-03T05:24:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"d7e8e3b9-eaec-47ea-87fe-6c0e72df970d","html_url":"https://github.com/SAKURA-CAT/water-tank","commit_stats":null,"previous_names":["sakura-cat/water-tank"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SAKURA-CAT%2Fwater-tank","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SAKURA-CAT%2Fwater-tank/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SAKURA-CAT%2Fwater-tank/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SAKURA-CAT%2Fwater-tank/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SAKURA-CAT","download_url":"https://codeload.github.com/SAKURA-CAT/water-tank/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238672048,"owners_count":19511200,"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","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":["fuzzy-control","matlab","x-du"],"created_at":"2024-10-11T18:58:21.475Z","updated_at":"2025-10-28T15:30:57.346Z","avatar_url":"https://github.com/SAKURA-CAT.png","language":"MATLAB","funding_links":[],"categories":[],"sub_categories":[],"readme":"# water-tank: 单水箱液位模糊控制系统设计\n\n《基于Matlab的单水箱液位的模糊控制系统设计》是本人的一次课堂作业，由于网上的资源不是很多，所以这边分享一个我对我们的\"祖传代码\"稍加修改的版本。\n\n## 1. 情景说明\n\n![scenario](./static/scenario.png)\n\n如上图所示，有一个倒锥形容器盛放水，有一个出水口`V_2`，一个入水口`V_1`，现在可以通过测量装置得到当前容器中的水位`h`，现在需要设计一个模糊控制系统，使得水位`h`能够稳定在某个目标值。\n\n因此有如下关系：\n\n* 控制目标：倒锥形容器的液位高度h=h0\n* 检测装置：通过测量容器底部压力来间接测量液位\n* 执行机构：控制进水电磁阀V1的开启度（[0,90°]）。\n* 为简单起见，假设电磁阀V1的开启度与进水量间呈线性关系（即上水箱的液位恒定）。\n* 注意：受控对象是倒锥形容器，其液位高度h和进水量Q间的关系不是线性关系。电磁阀V2的开度固定，但出水量与倒锥形容器的液位高度成正比。\n\n## 2. 仓库说明\n\n\u003e 本仓库只供学习使用，并且因为本人也比较🥦，所以有不妥之处欢迎指正~\n\n一般情况下，如果要“抄作业”，应该先跑代码（校验一下可行性，一般情况下应该跑得通），然后再看笔者与小组成员上交的文档，这样可以更好地理解。\n\n### 2.1 文档说明\n\n为了观看体验和上传的方便，我将代码和文档分开了，文档在`./docs`文件夹下，代码在`./src`文件夹下。并且为了观看格式的统一，我将文档转为了PDF格式。\n\n### 2.2 代码说明\n\n由于文档中对模糊控制规则进行了对照试验，分为[25规则](./src/main.m)与[5规则](./src/test.m)，所以代码也分为了两个版本。\n\n另一方面，笔者在使用使用的matlab的时候，会有警告说相关的api即将被弃用（但是偷懒所以笔者没改），所以如果来者在跑代码的时候发现跑不通，可以提交[issue](https://github.com/SAKURA-CAT/water-tank/issues)，我看到会尽快修复。\n\n\u003e 或者提交[PR](https://github.com/SAKURA-CAT/water-tank/pulls)也行~\n\n## 3. 代码运行\n\n导入matlab后直接运行即可。两份代码实际上只有在模糊规则定义的部分会有不同，但是为了单个文件的可执行性，会有一些重复的部分。\n\n## 4. 其他\n\n也没啥了，如果来者能够采纳我们小组的代码——或者我们的工作对你有所帮助，将是我们的荣幸。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsakura-cat%2Fwater-tank","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsakura-cat%2Fwater-tank","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsakura-cat%2Fwater-tank/lists"}