MATLAB仿真程序实现模糊PID控制的开发

版权申诉
0 下载量 46 浏览量 更新于2024-10-07 收藏 863KB ZIP 举报
资源摘要信息: "fuzzy PID.zip_development9v7_fuzzy-PID_noisembb_***模糊" 在讨论这个资源之前,我们需要先理解几个关键的IT概念:模糊PID控制、MATLAB仿真程序以及相关的标签和文件名称。 模糊PID控制是一种先进的控制策略,它是将传统PID(比例-积分-微分)控制理论与模糊逻辑控制系统相结合的产物。在处理不确定、模糊或非线性系统问题时,传统的PID控制可能无法达到理想的控制效果,而模糊PID控制则通过模糊逻辑的规则来改善控制器对于系统变化的适应性和鲁棒性。 MATLAB是一种广泛使用的高级数学计算和仿真软件,它提供了强大的工具箱用于控制系统的设计、分析和仿真。通过MATLAB,工程师和研究人员可以编写代码或使用内置的函数和图形用户界面(GUI)来进行系统仿真实验。 资源的标题中的“fuzzy PID.zip_development9v7_fuzzy-PID_noisembb_***模糊”指出了几个重要的关键词:文件名暗示它是一个压缩包(.zip),可能是包含仿真程序文件的压缩格式;"development9v7"和"noisembb"看起来像是版本号或者特定项目的标识符;"***"可能是资源的来源或者特定的项目名称;最后的“模糊”强调了模糊逻辑在其中的应用。 从描述中我们得知,这是一个关于模糊PID控制的仿真程序,具体的编程和运行环境很可能是在MATLAB平台上的。仿真程序允许用户测试和分析模糊PID控制器在不同条件下的性能表现,比如它对于噪声的响应能力以及在多变工作条件下的控制稳定性。 标签中的“development9v7”,“fuzzy-pid”,“noisembb”,“***”和“模糊pid控制”进一步强调了仿真程序的用途、版本和特点。这些标签有助于相关领域的研究人员和工程师在搜索或分类相关资源时快速定位到此仿真程序。 最后,提到的“压缩包子文件的文件名称列表”中的“仿真程序”意味着压缩包中应该包含具体的仿真程序文件。这可能包括了MATLAB脚本(.m文件)、图形用户界面文件(.fig文件)、以及可能的模型文件(.mdl文件)。解压缩后的文件将会被用来在MATLAB环境中部署和运行仿真测试。 为了深入理解和使用这个资源,用户应该具备MATLAB软件的基本操作知识,熟悉PID控制的理论基础,以及掌握模糊逻辑控制系统的设计原理。通过这些知识点的结合使用,用户将能够利用这个仿真程序在模拟的环境中测试模糊PID控制算法,评估其性能,并根据仿真结果对控制器参数进行调整优化,以达到预期的控制效果。

修改和补充下列代码得到十折交叉验证的平均每一折auc值和平均每一折aoc曲线,平均每一折分类报告以及平均每一折混淆矩阵 min_max_scaler = MinMaxScaler() X_train1, X_test1 = x[train_id], x[test_id] y_train1, y_test1 = y[train_id], y[test_id] # apply the same scaler to both sets of data X_train1 = min_max_scaler.fit_transform(X_train1) X_test1 = min_max_scaler.transform(X_test1) X_train1 = np.array(X_train1) X_test1 = np.array(X_test1) config = get_config() tree = gcForest(config) tree.fit(X_train1, y_train1) y_pred11 = tree.predict(X_test1) y_pred1.append(y_pred11 X_train.append(X_train1) X_test.append(X_test1) y_test.append(y_test1) y_train.append(y_train1) X_train_fuzzy1, X_test_fuzzy1 = X_fuzzy[train_id], X_fuzzy[test_id] y_train_fuzzy1, y_test_fuzzy1 = y_sampled[train_id], y_sampled[test_id] X_train_fuzzy1 = min_max_scaler.fit_transform(X_train_fuzzy1) X_test_fuzzy1 = min_max_scaler.transform(X_test_fuzzy1) X_train_fuzzy1 = np.array(X_train_fuzzy1) X_test_fuzzy1 = np.array(X_test_fuzzy1) config = get_config() tree = gcForest(config) tree.fit(X_train_fuzzy1, y_train_fuzzy1) y_predd = tree.predict(X_test_fuzzy1) y_pred.append(y_predd) X_test_fuzzy.append(X_test_fuzzy1) y_test_fuzzy.append(y_test_fuzzy1)y_pred = to_categorical(np.concatenate(y_pred), num_classes=3) y_pred1 = to_categorical(np.concatenate(y_pred1), num_classes=3) y_test = to_categorical(np.concatenate(y_test), num_classes=3) y_test_fuzzy = to_categorical(np.concatenate(y_test_fuzzy), num_classes=3) print(y_pred.shape) print(y_pred1.shape) print(y_test.shape) print(y_test_fuzzy.shape) # 深度森林 report1 = classification_report(y_test, y_prprint("DF",report1) report = classification_report(y_test_fuzzy, y_pred) print("DF-F",report) mse = mean_squared_error(y_test, y_pred1) rmse = math.sqrt(mse) print('深度森林RMSE:', rmse) print('深度森林Accuracy:', accuracy_score(y_test, y_pred1)) mse = mean_squared_error(y_test_fuzzy, y_pred) rmse = math.sqrt(mse) print('F深度森林RMSE:', rmse) print('F深度森林Accuracy:', accuracy_score(y_test_fuzzy, y_pred)) mse = mean_squared_error(y_test, y_pred) rmse = math.sqrt(mse)

2023-06-02 上传

修改和补充下列代码得到十折交叉验证的平均auc值和平均aoc曲线,平均分类报告以及平均混淆矩阵 min_max_scaler = MinMaxScaler() X_train1, X_test1 = x[train_id], x[test_id] y_train1, y_test1 = y[train_id], y[test_id] # apply the same scaler to both sets of data X_train1 = min_max_scaler.fit_transform(X_train1) X_test1 = min_max_scaler.transform(X_test1) X_train1 = np.array(X_train1) X_test1 = np.array(X_test1) config = get_config() tree = gcForest(config) tree.fit(X_train1, y_train1) y_pred11 = tree.predict(X_test1) y_pred1.append(y_pred11 X_train.append(X_train1) X_test.append(X_test1) y_test.append(y_test1) y_train.append(y_train1) X_train_fuzzy1, X_test_fuzzy1 = X_fuzzy[train_id], X_fuzzy[test_id] y_train_fuzzy1, y_test_fuzzy1 = y_sampled[train_id], y_sampled[test_id] X_train_fuzzy1 = min_max_scaler.fit_transform(X_train_fuzzy1) X_test_fuzzy1 = min_max_scaler.transform(X_test_fuzzy1) X_train_fuzzy1 = np.array(X_train_fuzzy1) X_test_fuzzy1 = np.array(X_test_fuzzy1) config = get_config() tree = gcForest(config) tree.fit(X_train_fuzzy1, y_train_fuzzy1) y_predd = tree.predict(X_test_fuzzy1) y_pred.append(y_predd) X_test_fuzzy.append(X_test_fuzzy1) y_test_fuzzy.append(y_test_fuzzy1)y_pred = to_categorical(np.concatenate(y_pred), num_classes=3) y_pred1 = to_categorical(np.concatenate(y_pred1), num_classes=3) y_test = to_categorical(np.concatenate(y_test), num_classes=3) y_test_fuzzy = to_categorical(np.concatenate(y_test_fuzzy), num_classes=3) print(y_pred.shape) print(y_pred1.shape) print(y_test.shape) print(y_test_fuzzy.shape) # 深度森林 report1 = classification_report(y_test, y_prprint("DF",report1) report = classification_report(y_test_fuzzy, y_pred) print("DF-F",report) mse = mean_squared_error(y_test, y_pred1) rmse = math.sqrt(mse) print('深度森林RMSE:', rmse) print('深度森林Accuracy:', accuracy_score(y_test, y_pred1)) mse = mean_squared_error(y_test_fuzzy, y_pred) rmse = math.sqrt(mse) print('F深度森林RMSE:', rmse) print('F深度森林Accuracy:', accuracy_score(y_test_fuzzy, y_pred)) mse = mean_squared_error(y_test, y_pred) rmse = math.sqrt(mse) print('F?深度森林RMSE:', rmse) print('F?深度森林Accuracy:', accuracy_score(y_test, y_pred))

2023-06-02 上传
2023-05-25 上传