From 8359b9e5a3dcd9bc00fdfaae6992a6bb47288ec0 Mon Sep 17 00:00:00 2001 From: "daisuke.aramaki" <92370011+da1996-04@users.noreply.github.com> Date: Fri, 24 May 2024 18:14:11 +0900 Subject: [PATCH 01/17] Update readme.md --- readme.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/readme.md b/readme.md index 164ecd7..a450d23 100644 --- a/readme.md +++ b/readme.md @@ -29,6 +29,17 @@ * [B章 codegen for func](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapterB_codegen_function_object.ipynb) * [B章 codegen for solver](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapterB_codegen_solver_interface.ipynb) * [B章 discrete](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapterB_discrete_actuator.ipynb) + +## 本書で作成する制御のアニメーション例 + +* 倒立振子 + + +* 2次元ドローン + + +* ゴム紐 + ## リンク集 From fb7d566eaf7a18979aff0cfe1123950d56047efe Mon Sep 17 00:00:00 2001 From: "daisuke.aramaki" <92370011+da1996-04@users.noreply.github.com> Date: Fri, 24 May 2024 18:16:54 +0900 Subject: [PATCH 02/17] Update readme.md --- readme.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/readme.md b/readme.md index a450d23..5e3a611 100644 --- a/readme.md +++ b/readme.md @@ -43,6 +43,9 @@ ## リンク集 +### Amazon +[単行本](https://www.amazon.co.jp/Python%E3%81%A8CasADi%E3%81%A7%E5%AD%A6%E3%81%B6%E3%83%A2%E3%83%87%E3%83%AB%E4%BA%88%E6%B8%AC%E5%88%B6%E5%BE%A1-KS%E7%90%86%E5%B7%A5%E5%AD%A6%E5%B0%82%E9%96%80%E6%9B%B8-%E6%B7%B1%E6%B4%A5-%E5%8D%93%E5%BC%A5/dp/4065356113) + ### 著者発信の情報 |ソース |リンク |補足| From 2d5538bd0ec2aa96be042b9cd33fc60499759403 Mon Sep 17 00:00:00 2001 From: "daisuke.aramaki" <92370011+da1996-04@users.noreply.github.com> Date: Fri, 24 May 2024 18:21:27 +0900 Subject: [PATCH 03/17] Update readme.md --- readme.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/readme.md b/readme.md index 5e3a611..67f86b8 100644 --- a/readme.md +++ b/readme.md @@ -26,9 +26,9 @@ * [8章 CSTRに対するMPCxMHE](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter8_CSTR.ipynb) * B章 CasADi中級 * [B章 acados(* Google Colabでの動作は行えません。)](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapterB_acados_getting_started.ipynb) - * [B章 codegen for func](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapterB_codegen_function_object.ipynb) - * [B章 codegen for solver](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapterB_codegen_solver_interface.ipynb) - * [B章 discrete](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapterB_discrete_actuator.ipynb) + * [B章 関数オブジェクトのCコード生成](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapterB_codegen_function_object.ipynb) + * [B章 ソルバーオブジェクトのCコード生成](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapterB_codegen_solver_interface.ipynb) + * [B章 ロトカ・ヴォルテラモデルに対する離散入力MPC](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapterB_discrete_actuator.ipynb) ## 本書で作成する制御のアニメーション例 From 51f99fcbe535b11523a41325d6f247259117e6ad Mon Sep 17 00:00:00 2001 From: "daisuke.aramaki" <92370011+da1996-04@users.noreply.github.com> Date: Sat, 25 May 2024 17:00:20 +0900 Subject: [PATCH 04/17] Update readme.md --- readme.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/readme.md b/readme.md index 67f86b8..98e63be 100644 --- a/readme.md +++ b/readme.md @@ -32,19 +32,20 @@ ## 本書で作成する制御のアニメーション例 -* 倒立振子 +* **倒立振子** -* 2次元ドローン +* **2次元ドローン** -* ゴム紐 +* **ゴム紐** ## リンク集 ### Amazon [単行本](https://www.amazon.co.jp/Python%E3%81%A8CasADi%E3%81%A7%E5%AD%A6%E3%81%B6%E3%83%A2%E3%83%87%E3%83%AB%E4%BA%88%E6%B8%AC%E5%88%B6%E5%BE%A1-KS%E7%90%86%E5%B7%A5%E5%AD%A6%E5%B0%82%E9%96%80%E6%9B%B8-%E6%B7%B1%E6%B4%A5-%E5%8D%93%E5%BC%A5/dp/4065356113) +[サポートサイト](https://github.com/proxima-technology/casadi_mpc_nyuumon) ### 著者発信の情報 From 8d2fa849e162344b1f292b5a7d878c753730dde2 Mon Sep 17 00:00:00 2001 From: "daisuke.aramaki" <92370011+da1996-04@users.noreply.github.com> Date: Sat, 25 May 2024 17:41:33 +0900 Subject: [PATCH 05/17] Create LICENSE --- LICENSE | 201 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 201 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..261eeb9 --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. From 2be08cff309cc4dcae7a5c39499f7b8392aa067b Mon Sep 17 00:00:00 2001 From: "daisuke.aramaki" <92370011+da1996-04@users.noreply.github.com> Date: Sat, 25 May 2024 19:22:24 +0900 Subject: [PATCH 06/17] Update readme.md --- readme.md | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/readme.md b/readme.md index 98e63be..a9f3fa3 100644 --- a/readme.md +++ b/readme.md @@ -5,26 +5,26 @@ ## Google Colabへのリンク -* 3章 CasADi入門 - * [CasADiの基本](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter3.ipynb) -* 4章 離散時間のモデル予測制御 - * [ロトカ・ヴォルテラモデルに対するMPC](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter4.ipynb) -* 5章 連続時間のモデル予測制御 - * [倒立振子に対するMPC](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter5.ipynb) -* 6章 モデル予測制御の実装に向けて +* **3章 CasADi入門** + * [3章 CasADiの基本](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter3.ipynb) +* **4章 離散時間のモデル予測制御** + * [4章 ロトカ・ヴォルテラモデルに対するMPC](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter4.ipynb) +* **5章 連続時間のモデル予測制御** + * [5章 倒立振子に対するMPC](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter5.ipynb) +* **6章 モデル予測制御の実装に向けて** * [6章 直接的単一シューティング法と直接的多重シューティング法の比較](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter6_single_shooting.ipynb) * [6章 直接的コロケーション法と直接的多重シューティング法の比較(計算速度)](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter6_collocation_cartpole.ipynb) * [6章 直接的コロケーション法と直接的多重シューティング法の比較(硬い状態方程式モデル)](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter6_collocation_stiff.ipynb) * [6章 ウォームスタート](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter6_warm_start_experiment_solution_time.ipynb) * [6章 反復回数の制限](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter6_limit_iteration.ipynb) -* 7章 CasADiにおける最適化ソルバーの比較 +* **7章 CasADiにおける最適化ソルバーの比較** * [7章 マス・バネ・ダンバモデルを例に用いたIPOPTとOSQPの比較](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter7_mass_spring_damper.ipynb) * [7章 2次元ドローンを例に用いたQPソルバーの比較](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter7_2d_quadrotor.ipynb) * [7章 ゴム紐モデルを例に用いたNLPソルバーの比較](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter7_chain_of_masses.ipynb) -* 8章 状態推定問題と移動ホライズン推定 +* **8章 状態推定問題と移動ホライズン推定** * [8章 リチウムイオン電池に対するMHE](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter8_LIB.ipynb) * [8章 CSTRに対するMPCxMHE](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter8_CSTR.ipynb) -* B章 CasADi中級 +* **B章 CasADi中級** * [B章 acados(* Google Colabでの動作は行えません。)](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapterB_acados_getting_started.ipynb) * [B章 関数オブジェクトのCコード生成](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapterB_codegen_function_object.ipynb) * [B章 ソルバーオブジェクトのCコード生成](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapterB_codegen_solver_interface.ipynb) @@ -45,6 +45,8 @@ ### Amazon [単行本](https://www.amazon.co.jp/Python%E3%81%A8CasADi%E3%81%A7%E5%AD%A6%E3%81%B6%E3%83%A2%E3%83%87%E3%83%AB%E4%BA%88%E6%B8%AC%E5%88%B6%E5%BE%A1-KS%E7%90%86%E5%B7%A5%E5%AD%A6%E5%B0%82%E9%96%80%E6%9B%B8-%E6%B7%B1%E6%B4%A5-%E5%8D%93%E5%BC%A5/dp/4065356113) + +### 参考資料 [サポートサイト](https://github.com/proxima-technology/casadi_mpc_nyuumon) ### 著者発信の情報 From 18038505a27c9d923e7b1f93d3ae5ea68eaf3a1d Mon Sep 17 00:00:00 2001 From: "daisuke.aramaki" <92370011+da1996-04@users.noreply.github.com> Date: Sun, 26 May 2024 23:52:29 +0900 Subject: [PATCH 07/17] Update readme.md --- readme.md | 68 +++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 43 insertions(+), 25 deletions(-) diff --git a/readme.md b/readme.md index a9f3fa3..c6d4b92 100644 --- a/readme.md +++ b/readme.md @@ -3,34 +3,52 @@ [](https://amzn.asia/d/8TwVTO3) +### 書籍の購入はこちら: +[Amazonで購入](https://amzn.asia/d/8TwVTO3) + +## 目次 +- [Google Colabへのリンク](#google-colabへのリンク) +- [制御のアニメーション例](#制御のアニメーション例) +- [リンク集](#リンク集) +- [著者発信の情報](#著者発信の情報) + ## Google Colabへのリンク +ここでは、本書の各章に対応するGoogle Colabノートブックへのリンクを提供します。以下のリンクから直接実行可能です。 + +### 3章 CasADi入門 +- [3章 CasADiの基本](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter3.ipynb) + +### 4章 離散時間のモデル予測制御 +- [4章 ロトカ・ヴォルテラモデルに対するMPC](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter4.ipynb) + +### 5章 連続時間のモデル予測制御 +- [5章 倒立振子に対するMPC](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter5.ipynb) + +### 6章 モデル予測制御の実装に向けて +- [6章 直接的単一シューティング法と直接的多重シューティング法の比較](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter6_single_shooting.ipynb) +- [6章 直接的コロケーション法と直接的多重シューティング法の比較(計算速度)](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter6_collocation_cartpole.ipynb) +- [6章 直接的コロケーション法と直接的多重シューティング法の比較(硬い状態方程式モデル)](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter6_collocation_stiff.ipynb) +- [6章 ウォームスタート](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter6_warm_start_experiment_solution_time.ipynb) +- [6章 反復回数の制限](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter6_limit_iteration.ipynb) + +### 7章 CasADiにおける最適化ソルバーの比較 +- [7章 マス・バネ・ダンバモデルを例に用いたIPOPTとOSQPの比較](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter7_mass_spring_damper.ipynb) +- [7章 2次元ドローンを例に用いたQPソルバーの比較](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter7_2d_quadrotor.ipynb) +- [7章 ゴム紐モデルを例に用いたNLPソルバーの比較](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter7_chain_of_masses.ipynb) + +### 8章 状態推定問題と移動ホライズン推定 +- [8章 リチウムイオン電池に対するMHE](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter8_LIB.ipynb) +- [8章 CSTRに対するMPCxMHE](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter8_CSTR.ipynb) + +### B章 CasADi中級 +- [B章 acados(* Google Colabでの動作は行えません。)](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapterB_acados_getting_started.ipynb) +- [B章 関数オブジェクトのCコード生成](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapterB_codegen_function_object.ipynb) +- [B章 ソルバーオブジェクトのCコード生成](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapterB_codegen_solver_interface.ipynb) +- [B章 ロトカ・ヴォルテラモデルに対する離散入力MPC](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapterB_discrete_actuator.ipynb) -* **3章 CasADi入門** - * [3章 CasADiの基本](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter3.ipynb) -* **4章 離散時間のモデル予測制御** - * [4章 ロトカ・ヴォルテラモデルに対するMPC](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter4.ipynb) -* **5章 連続時間のモデル予測制御** - * [5章 倒立振子に対するMPC](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter5.ipynb) -* **6章 モデル予測制御の実装に向けて** - * [6章 直接的単一シューティング法と直接的多重シューティング法の比較](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter6_single_shooting.ipynb) - * [6章 直接的コロケーション法と直接的多重シューティング法の比較(計算速度)](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter6_collocation_cartpole.ipynb) - * [6章 直接的コロケーション法と直接的多重シューティング法の比較(硬い状態方程式モデル)](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter6_collocation_stiff.ipynb) - * [6章 ウォームスタート](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter6_warm_start_experiment_solution_time.ipynb) - * [6章 反復回数の制限](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter6_limit_iteration.ipynb) -* **7章 CasADiにおける最適化ソルバーの比較** - * [7章 マス・バネ・ダンバモデルを例に用いたIPOPTとOSQPの比較](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter7_mass_spring_damper.ipynb) - * [7章 2次元ドローンを例に用いたQPソルバーの比較](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter7_2d_quadrotor.ipynb) - * [7章 ゴム紐モデルを例に用いたNLPソルバーの比較](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter7_chain_of_masses.ipynb) -* **8章 状態推定問題と移動ホライズン推定** - * [8章 リチウムイオン電池に対するMHE](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter8_LIB.ipynb) - * [8章 CSTRに対するMPCxMHE](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter8_CSTR.ipynb) -* **B章 CasADi中級** - * [B章 acados(* Google Colabでの動作は行えません。)](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapterB_acados_getting_started.ipynb) - * [B章 関数オブジェクトのCコード生成](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapterB_codegen_function_object.ipynb) - * [B章 ソルバーオブジェクトのCコード生成](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapterB_codegen_solver_interface.ipynb) - * [B章 ロトカ・ヴォルテラモデルに対する離散入力MPC](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapterB_discrete_actuator.ipynb) -## 本書で作成する制御のアニメーション例 +## 制御のアニメーション例 +本書では、以下のような制御のアニメーションを作成することができます。 * **倒立振子** From 107e98971edd1027b369a4eb23aff38b9b104fe9 Mon Sep 17 00:00:00 2001 From: Toru Hishinuma Date: Mon, 27 May 2024 11:32:18 +0900 Subject: [PATCH 08/17] =?UTF-8?q?acados=E4=BE=8B=E9=A1=8C=E3=81=AE?= =?UTF-8?q?=E5=A4=89=E6=95=B0=E5=90=8D=E3=82=92=E6=96=B0=E3=81=97=E3=81=84?= =?UTF-8?q?=E3=82=82=E3=81=AE=E3=81=AB=E5=90=88=E3=82=8F=E3=81=9B=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/chapterB_acados_getting_started.ipynb | 110 ++++++++++------------ 1 file changed, 49 insertions(+), 61 deletions(-) diff --git a/src/chapterB_acados_getting_started.ipynb b/src/chapterB_acados_getting_started.ipynb index c8077a4..f26fac6 100644 --- a/src/chapterB_acados_getting_started.ipynb +++ b/src/chapterB_acados_getting_started.ipynb @@ -4,19 +4,7 @@ "cell_type": "code", "execution_count": 1, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Collecting casadi==3.6.3\n", - " Downloading casadi-3.6.3-cp310-none-manylinux2014_x86_64.whl.metadata (1.8 kB)\n", - "Requirement already satisfied: numpy in /home/proxima/anaconda3/envs/work/lib/python3.10/site-packages (from casadi==3.6.3) (1.26.4)\n", - "Downloading casadi-3.6.3-cp310-none-manylinux2014_x86_64.whl (67.5 MB)\n", - "\u001b[2K \u001b[38;2;249;38;114m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[38;5;237m╺\u001b[0m\u001b[38;5;237m━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m34.6/67.5 MB\u001b[0m \u001b[31m3.5 MB/s\u001b[0m eta \u001b[36m0:00:10\u001b[0m:10\u001b[0m" - ] - } - ], + "outputs": [], "source": [ "# !pip install casadi\n", "!pip install casadi==3.6.3 # officially supported newest version by acados at the time of writing.\n", @@ -29,10 +17,10 @@ "import matplotlib.patches as patches\n", "from matplotlib.animation import FuncAnimation\n", "\n", - "os.makedirs('images',exist_ok=True)\n", - "if os.name == 'nt':\n", - " plt.rcParams['font.family'] = 'MS Gothic'\n", - "elif os.name == 'posix':\n", + "os.makedirs(\"images\",exist_ok=True)\n", + "if os.name == \"nt\":\n", + " plt.rcParams[\"font.family\"] = \"MS Gothic\"\n", + "elif os.name == \"posix\":\n", " !pip install japanize-matplotlib\n", "\n", "clear_output()" @@ -131,7 +119,7 @@ " cost = (casadi.dot(Q@x,x) + casadi.dot(R@u,u)) / 2\n", " return cost\n", "\n", - "def compute_final_cost(x):\n", + "def compute_terminal_cost(x):\n", " cost = casadi.dot(Q_f@x,x) / 2\n", " return cost" ] @@ -145,8 +133,8 @@ "def make_nlp():\n", " RK4 = make_RK4()\n", "\n", - " U = [casadi.SX.sym(f\"u_{i}\",nu) for i in range(K)]\n", - " X = [casadi.SX.sym(f\"x_{i}\",nx) for i in range(K+1)]\n", + " U = [casadi.SX.sym(f\"u_{k}\",nu) for k in range(K)]\n", + " X = [casadi.SX.sym(f\"x_{k}\",nx) for k in range(K+1)]\n", " G = []\n", "\n", " J = 0\n", @@ -155,7 +143,7 @@ " J += compute_stage_cost(X[k],U[k])*dt\n", " eq = X[k+1] - RK4(x=X[k],u=U[k])[\"x_next\"]\n", " G.append(eq)\n", - " J += compute_final_cost(X[-1])\n", + " J += compute_terminal_cost(X[-1])\n", "\n", " # option = {'print_time':False,'ipopt':{'print_level':0}}\n", " option = {} # printオプションを有効化\n", @@ -323,16 +311,16 @@ "Number of equality constraint Jacobian evaluations = 46\n", "Number of inequality constraint Jacobian evaluations = 0\n", "Number of Lagrangian Hessian evaluations = 44\n", - "Total seconds in IPOPT = 0.043\n", + "Total seconds in IPOPT = 0.037\n", "\n", "EXIT: Optimal Solution Found.\n", " S : t_proc (avg) t_wall (avg) n_eval\n", - " nlp_f | 2.98ms ( 15.60us) 290.62us ( 1.52us) 191\n", - " nlp_g | 15.27ms ( 79.94us) 1.49ms ( 7.82us) 191\n", - " nlp_grad_f | 1.01ms ( 24.51us) 107.45us ( 2.62us) 41\n", - " nlp_hess_l | 29.34ms (682.42us) 3.36ms ( 78.11us) 43\n", - " nlp_jac_g | 12.18ms (259.09us) 1.35ms ( 28.65us) 47\n", - " total | 437.09ms (437.09ms) 44.92ms ( 44.92ms) 1\n" + " nlp_f | 2.29ms ( 11.97us) 273.77us ( 1.43us) 191\n", + " nlp_g | 11.70ms ( 61.23us) 1.40ms ( 7.34us) 191\n", + " nlp_grad_f | 803.00us ( 19.59us) 101.46us ( 2.47us) 41\n", + " nlp_hess_l | 22.32ms (519.05us) 3.14ms ( 73.11us) 43\n", + " nlp_jac_g | 8.68ms (184.64us) 1.19ms ( 25.24us) 47\n", + " total | 291.19ms (291.19ms) 37.68ms ( 37.68ms) 1\n" ] } ], @@ -367,7 +355,7 @@ "\n", "def export_cart_pole_model() -> AcadosModel:\n", "\n", - " model_name = 'cart_pole'\n", + " model_name = \"cart_pole\"\n", " \n", " f = make_f()\n", " states = casadi.SX.sym(\"states\",nx)\n", @@ -423,20 +411,20 @@ "\n", "rm -f libacados_ocp_solver_cart_pole.so\n", "rm -f cart_pole_cost/cart_pole_cost_ext_cost_0_fun.o cart_pole_cost/cart_pole_cost_ext_cost_0_fun_jac.o cart_pole_cost/cart_pole_cost_ext_cost_0_fun_jac_hess.o cart_pole_cost/cart_pole_cost_ext_cost_fun.o cart_pole_cost/cart_pole_cost_ext_cost_fun_jac.o cart_pole_cost/cart_pole_cost_ext_cost_fun_jac_hess.o cart_pole_cost/cart_pole_cost_ext_cost_e_fun.o cart_pole_cost/cart_pole_cost_ext_cost_e_fun_jac.o cart_pole_cost/cart_pole_cost_ext_cost_e_fun_jac_hess.o acados_solver_cart_pole.o\n", - "cc -fPIC -std=c99 -O3 -I/home/hishinuma/acados/include -I/home/hishinuma/acados/include/acados -I/home/hishinuma/acados/include/blasfeo/include -I/home/hishinuma/acados/include/hpipm/include -c -o cart_pole_cost/cart_pole_cost_ext_cost_0_fun.o cart_pole_cost/cart_pole_cost_ext_cost_0_fun.c\n", - "cc -fPIC -std=c99 -O3 -I/home/hishinuma/acados/include -I/home/hishinuma/acados/include/acados -I/home/hishinuma/acados/include/blasfeo/include -I/home/hishinuma/acados/include/hpipm/include -c -o cart_pole_cost/cart_pole_cost_ext_cost_0_fun_jac.o cart_pole_cost/cart_pole_cost_ext_cost_0_fun_jac.c\n", - "cc -fPIC -std=c99 -O3 -I/home/hishinuma/acados/include -I/home/hishinuma/acados/include/acados -I/home/hishinuma/acados/include/blasfeo/include -I/home/hishinuma/acados/include/hpipm/include -c -o cart_pole_cost/cart_pole_cost_ext_cost_0_fun_jac_hess.o cart_pole_cost/cart_pole_cost_ext_cost_0_fun_jac_hess.c\n", - "cc -fPIC -std=c99 -O3 -I/home/hishinuma/acados/include -I/home/hishinuma/acados/include/acados -I/home/hishinuma/acados/include/blasfeo/include -I/home/hishinuma/acados/include/hpipm/include -c -o cart_pole_cost/cart_pole_cost_ext_cost_fun.o cart_pole_cost/cart_pole_cost_ext_cost_fun.c\n", - "cc -fPIC -std=c99 -O3 -I/home/hishinuma/acados/include -I/home/hishinuma/acados/include/acados -I/home/hishinuma/acados/include/blasfeo/include -I/home/hishinuma/acados/include/hpipm/include -c -o cart_pole_cost/cart_pole_cost_ext_cost_fun_jac.o cart_pole_cost/cart_pole_cost_ext_cost_fun_jac.c\n", - "cc -fPIC -std=c99 -O3 -I/home/hishinuma/acados/include -I/home/hishinuma/acados/include/acados -I/home/hishinuma/acados/include/blasfeo/include -I/home/hishinuma/acados/include/hpipm/include -c -o cart_pole_cost/cart_pole_cost_ext_cost_fun_jac_hess.o cart_pole_cost/cart_pole_cost_ext_cost_fun_jac_hess.c\n", - "cc -fPIC -std=c99 -O3 -I/home/hishinuma/acados/include -I/home/hishinuma/acados/include/acados -I/home/hishinuma/acados/include/blasfeo/include -I/home/hishinuma/acados/include/hpipm/include -c -o cart_pole_cost/cart_pole_cost_ext_cost_e_fun.o cart_pole_cost/cart_pole_cost_ext_cost_e_fun.c\n", - "cc -fPIC -std=c99 -O3 -I/home/hishinuma/acados/include -I/home/hishinuma/acados/include/acados -I/home/hishinuma/acados/include/blasfeo/include -I/home/hishinuma/acados/include/hpipm/include -c -o cart_pole_cost/cart_pole_cost_ext_cost_e_fun_jac.o cart_pole_cost/cart_pole_cost_ext_cost_e_fun_jac.c\n", - "cc -fPIC -std=c99 -O3 -I/home/hishinuma/acados/include -I/home/hishinuma/acados/include/acados -I/home/hishinuma/acados/include/blasfeo/include -I/home/hishinuma/acados/include/hpipm/include -c -o cart_pole_cost/cart_pole_cost_ext_cost_e_fun_jac_hess.o cart_pole_cost/cart_pole_cost_ext_cost_e_fun_jac_hess.c\n", - "cc -fPIC -std=c99 -O3 -I/home/hishinuma/acados/include -I/home/hishinuma/acados/include/acados -I/home/hishinuma/acados/include/blasfeo/include -I/home/hishinuma/acados/include/hpipm/include -c -o acados_solver_cart_pole.o acados_solver_cart_pole.c\n", - "cc -fPIC -std=c99 -O3 -I/home/hishinuma/acados/include -I/home/hishinuma/acados/include/acados -I/home/hishinuma/acados/include/blasfeo/include -I/home/hishinuma/acados/include/hpipm/include -c -o cart_pole_model/cart_pole_expl_ode_fun.o cart_pole_model/cart_pole_expl_ode_fun.c\n", - "cc -fPIC -std=c99 -O3 -I/home/hishinuma/acados/include -I/home/hishinuma/acados/include/acados -I/home/hishinuma/acados/include/blasfeo/include -I/home/hishinuma/acados/include/hpipm/include -c -o cart_pole_model/cart_pole_expl_vde_forw.o cart_pole_model/cart_pole_expl_vde_forw.c\n", - "cc -fPIC -std=c99 -O3 -I/home/hishinuma/acados/include -I/home/hishinuma/acados/include/acados -I/home/hishinuma/acados/include/blasfeo/include -I/home/hishinuma/acados/include/hpipm/include -c -o cart_pole_model/cart_pole_expl_vde_adj.o cart_pole_model/cart_pole_expl_vde_adj.c\n", - "cc -shared cart_pole_cost/cart_pole_cost_ext_cost_0_fun.o cart_pole_cost/cart_pole_cost_ext_cost_0_fun_jac.o cart_pole_cost/cart_pole_cost_ext_cost_0_fun_jac_hess.o cart_pole_cost/cart_pole_cost_ext_cost_fun.o cart_pole_cost/cart_pole_cost_ext_cost_fun_jac.o cart_pole_cost/cart_pole_cost_ext_cost_fun_jac_hess.o cart_pole_cost/cart_pole_cost_ext_cost_e_fun.o cart_pole_cost/cart_pole_cost_ext_cost_e_fun_jac.o cart_pole_cost/cart_pole_cost_ext_cost_e_fun_jac_hess.o acados_solver_cart_pole.o cart_pole_model/cart_pole_expl_ode_fun.o cart_pole_model/cart_pole_expl_vde_forw.o cart_pole_model/cart_pole_expl_vde_adj.o -o libacados_ocp_solver_cart_pole.so -L/home/hishinuma/acados/lib -lacados -lhpipm -lblasfeo -lm \\\n", + "/usr/lib/ccache/gcc -fPIC -std=c99 -O3 -I/home/proxima/acados/include -I/home/proxima/acados/include/acados -I/home/proxima/acados/include/blasfeo/include -I/home/proxima/acados/include/hpipm/include -c -o cart_pole_cost/cart_pole_cost_ext_cost_0_fun.o cart_pole_cost/cart_pole_cost_ext_cost_0_fun.c\n", + "/usr/lib/ccache/gcc -fPIC -std=c99 -O3 -I/home/proxima/acados/include -I/home/proxima/acados/include/acados -I/home/proxima/acados/include/blasfeo/include -I/home/proxima/acados/include/hpipm/include -c -o cart_pole_cost/cart_pole_cost_ext_cost_0_fun_jac.o cart_pole_cost/cart_pole_cost_ext_cost_0_fun_jac.c\n", + "/usr/lib/ccache/gcc -fPIC -std=c99 -O3 -I/home/proxima/acados/include -I/home/proxima/acados/include/acados -I/home/proxima/acados/include/blasfeo/include -I/home/proxima/acados/include/hpipm/include -c -o cart_pole_cost/cart_pole_cost_ext_cost_0_fun_jac_hess.o cart_pole_cost/cart_pole_cost_ext_cost_0_fun_jac_hess.c\n", + "/usr/lib/ccache/gcc -fPIC -std=c99 -O3 -I/home/proxima/acados/include -I/home/proxima/acados/include/acados -I/home/proxima/acados/include/blasfeo/include -I/home/proxima/acados/include/hpipm/include -c -o cart_pole_cost/cart_pole_cost_ext_cost_fun.o cart_pole_cost/cart_pole_cost_ext_cost_fun.c\n", + "/usr/lib/ccache/gcc -fPIC -std=c99 -O3 -I/home/proxima/acados/include -I/home/proxima/acados/include/acados -I/home/proxima/acados/include/blasfeo/include -I/home/proxima/acados/include/hpipm/include -c -o cart_pole_cost/cart_pole_cost_ext_cost_fun_jac.o cart_pole_cost/cart_pole_cost_ext_cost_fun_jac.c\n", + "/usr/lib/ccache/gcc -fPIC -std=c99 -O3 -I/home/proxima/acados/include -I/home/proxima/acados/include/acados -I/home/proxima/acados/include/blasfeo/include -I/home/proxima/acados/include/hpipm/include -c -o cart_pole_cost/cart_pole_cost_ext_cost_fun_jac_hess.o cart_pole_cost/cart_pole_cost_ext_cost_fun_jac_hess.c\n", + "/usr/lib/ccache/gcc -fPIC -std=c99 -O3 -I/home/proxima/acados/include -I/home/proxima/acados/include/acados -I/home/proxima/acados/include/blasfeo/include -I/home/proxima/acados/include/hpipm/include -c -o cart_pole_cost/cart_pole_cost_ext_cost_e_fun.o cart_pole_cost/cart_pole_cost_ext_cost_e_fun.c\n", + "/usr/lib/ccache/gcc -fPIC -std=c99 -O3 -I/home/proxima/acados/include -I/home/proxima/acados/include/acados -I/home/proxima/acados/include/blasfeo/include -I/home/proxima/acados/include/hpipm/include -c -o cart_pole_cost/cart_pole_cost_ext_cost_e_fun_jac.o cart_pole_cost/cart_pole_cost_ext_cost_e_fun_jac.c\n", + "/usr/lib/ccache/gcc -fPIC -std=c99 -O3 -I/home/proxima/acados/include -I/home/proxima/acados/include/acados -I/home/proxima/acados/include/blasfeo/include -I/home/proxima/acados/include/hpipm/include -c -o cart_pole_cost/cart_pole_cost_ext_cost_e_fun_jac_hess.o cart_pole_cost/cart_pole_cost_ext_cost_e_fun_jac_hess.c\n", + "/usr/lib/ccache/gcc -fPIC -std=c99 -O3 -I/home/proxima/acados/include -I/home/proxima/acados/include/acados -I/home/proxima/acados/include/blasfeo/include -I/home/proxima/acados/include/hpipm/include -c -o acados_solver_cart_pole.o acados_solver_cart_pole.c\n", + "/usr/lib/ccache/gcc -fPIC -std=c99 -O3 -I/home/proxima/acados/include -I/home/proxima/acados/include/acados -I/home/proxima/acados/include/blasfeo/include -I/home/proxima/acados/include/hpipm/include -c -o cart_pole_model/cart_pole_expl_ode_fun.o cart_pole_model/cart_pole_expl_ode_fun.c\n", + "/usr/lib/ccache/gcc -fPIC -std=c99 -O3 -I/home/proxima/acados/include -I/home/proxima/acados/include/acados -I/home/proxima/acados/include/blasfeo/include -I/home/proxima/acados/include/hpipm/include -c -o cart_pole_model/cart_pole_expl_vde_forw.o cart_pole_model/cart_pole_expl_vde_forw.c\n", + "/usr/lib/ccache/gcc -fPIC -std=c99 -O3 -I/home/proxima/acados/include -I/home/proxima/acados/include/acados -I/home/proxima/acados/include/blasfeo/include -I/home/proxima/acados/include/hpipm/include -c -o cart_pole_model/cart_pole_expl_vde_adj.o cart_pole_model/cart_pole_expl_vde_adj.c\n", + "/usr/lib/ccache/gcc -shared cart_pole_cost/cart_pole_cost_ext_cost_0_fun.o cart_pole_cost/cart_pole_cost_ext_cost_0_fun_jac.o cart_pole_cost/cart_pole_cost_ext_cost_0_fun_jac_hess.o cart_pole_cost/cart_pole_cost_ext_cost_fun.o cart_pole_cost/cart_pole_cost_ext_cost_fun_jac.o cart_pole_cost/cart_pole_cost_ext_cost_fun_jac_hess.o cart_pole_cost/cart_pole_cost_ext_cost_e_fun.o cart_pole_cost/cart_pole_cost_ext_cost_e_fun_jac.o cart_pole_cost/cart_pole_cost_ext_cost_e_fun_jac_hess.o acados_solver_cart_pole.o cart_pole_model/cart_pole_expl_ode_fun.o cart_pole_model/cart_pole_expl_vde_forw.o cart_pole_model/cart_pole_expl_vde_adj.o -o libacados_ocp_solver_cart_pole.so -L/home/proxima/acados/lib -lacados -lhpipm -lblasfeo -lm \\\n", "-L -l\n", "acados was compiled without OpenMP.\n" ] @@ -452,10 +440,10 @@ "ocp.model = model\n", "ocp.dims.N = K\n", "\n", - "ocp.cost.cost_type = 'EXTERNAL'\n", - "ocp.cost.cost_type_e = 'EXTERNAL'\n", + "ocp.cost.cost_type = \"EXTERNAL\"\n", + "ocp.cost.cost_type_e = \"EXTERNAL\"\n", "ocp.model.cost_expr_ext_cost = compute_stage_cost(model.x,model.u)\n", - "ocp.model.cost_expr_ext_cost_e = compute_final_cost(model.x)\n", + "ocp.model.cost_expr_ext_cost_e = compute_terminal_cost(model.x)\n", "\n", "ocp.constraints.lbu = np.array(u_lb)\n", "ocp.constraints.ubu = np.array(u_ub)\n", @@ -463,21 +451,21 @@ "\n", "ocp.constraints.x0 = state_init\n", "\n", - "ocp.solver_options.qp_solver = 'PARTIAL_CONDENSING_HPIPM'\n", + "ocp.solver_options.qp_solver = \"PARTIAL_CONDENSING_HPIPM\"\n", "ocp.solver_options.qp_solver_cond_N = 5\n", "\n", - "ocp.solver_options.hpipm_mode = 'SPEED'\n", - "# ocp.solver_options.hpipm_mode = 'BALANCE' \n", - "# ocp.solver_options.hpipm_mode = 'ROBUST' \n", + "ocp.solver_options.hpipm_mode = \"SPEED\"\n", + "# ocp.solver_options.hpipm_mode = \"BALANCE\"\n", + "# ocp.solver_options.hpipm_mode = \"ROBUST\"\n", "\n", - "# ocp.solver_options.hessian_approx = 'EXACT'\n", - "ocp.solver_options.hessian_approx = 'GAUSS_NEWTON' \n", + "# ocp.solver_options.hessian_approx = \"EXACT\"\n", + "ocp.solver_options.hessian_approx = \"GAUSS_NEWTON\"\n", "\n", - "ocp.solver_options.nlp_solver_type = 'SQP'\n", - "ocp.solver_options.ext_fun_compile_flags = '-O3'\n", + "ocp.solver_options.nlp_solver_type = \"SQP\"\n", + "ocp.solver_options.ext_fun_compile_flags = \"-O3\"\n", "\n", "ocp.solver_options.tf = T\n", - "ocp_solver = AcadosOcpSolver(ocp, json_file = 'acados_ocp.json')" + "ocp_solver = AcadosOcpSolver(ocp, json_file = \"acados_ocp.json\")" ] }, { @@ -489,7 +477,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "{'Tsim': 0.05, 'alpha_min': 0.05, 'alpha_reduction': 0.7, 'collocation_type': 'GAUSS_LEGENDRE', 'cost_discretization': 'EULER', 'custom_templates': [], 'custom_update_copy': True, 'custom_update_filename': '', 'custom_update_header_filename': '', 'eps_sufficient_descent': 0.0001, 'exact_hess_constr': 1, 'exact_hess_cost': 1, 'exact_hess_dyn': 1, 'ext_cost_num_hess': 0, 'ext_fun_compile_flags': '-O3', 'full_step_dual': 0, 'globalization': 'FIXED_STEP', 'globalization_use_SOC': 0, 'hessian_approx': 'GAUSS_NEWTON', 'hpipm_mode': 'SPEED', 'initialize_t_slacks': 0, 'integrator_type': 'ERK', 'levenberg_marquardt': 0.0, 'line_search_use_sufficient_descent': 0, 'model_external_shared_lib_dir': None, 'model_external_shared_lib_name': None, 'nlp_solver_ext_qp_res': 0, 'nlp_solver_max_iter': 100, 'nlp_solver_step_length': 1.0, 'nlp_solver_tol_comp': 1e-06, 'nlp_solver_tol_eq': 1e-06, 'nlp_solver_tol_ineq': 1e-06, 'nlp_solver_tol_stat': 1e-06, 'nlp_solver_type': 'SQP', 'print_level': 0, 'qp_solver': 'PARTIAL_CONDENSING_HPIPM', 'qp_solver_cond_N': 5, 'qp_solver_cond_ric_alg': 1, 'qp_solver_iter_max': 50, 'qp_solver_ric_alg': 1, 'qp_solver_tol_comp': None, 'qp_solver_tol_eq': None, 'qp_solver_tol_ineq': None, 'qp_solver_tol_stat': None, 'qp_solver_warm_start': 0, 'reg_epsilon': 0.0001, 'regularize_method': 'NO_REGULARIZE', 'shooting_nodes': [0.0, 0.05, 0.1, 0.15000000000000002, 0.2, 0.25, 0.3, 0.35, 0.39999999999999997, 0.44999999999999996, 0.49999999999999994, 0.5499999999999999, 0.6, 0.65, 0.7000000000000001, 0.7500000000000001, 0.8000000000000002, 0.8500000000000002, 0.9000000000000002, 0.9500000000000003, 1.0000000000000002], 'sim_method_jac_reuse': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 'sim_method_newton_iter': 3, 'sim_method_newton_tol': 0.0, 'sim_method_num_stages': [4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4], 'sim_method_num_steps': [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], 'tf': 1, 'time_steps': [0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05]}\n" + "{'Tsim': 0.05, 'adaptive_levenberg_marquardt_lam': 5.0, 'adaptive_levenberg_marquardt_mu0': 0.001, 'adaptive_levenberg_marquardt_mu_min': 1e-16, 'alpha_min': 0.05, 'alpha_reduction': 0.7, 'as_rti_iter': 1, 'as_rti_level': 4, 'collocation_type': 'GAUSS_LEGENDRE', 'cost_discretization': 'EULER', 'custom_templates': [], 'custom_update_copy': True, 'custom_update_filename': '', 'custom_update_header_filename': '', 'eps_sufficient_descent': 0.0001, 'exact_hess_constr': 1, 'exact_hess_cost': 1, 'exact_hess_dyn': 1, 'ext_cost_num_hess': 0, 'ext_fun_compile_flags': '-O3', 'fixed_hess': 0, 'full_step_dual': 0, 'globalization': 'FIXED_STEP', 'globalization_use_SOC': 0, 'hessian_approx': 'GAUSS_NEWTON', 'hpipm_mode': 'SPEED', 'initialize_t_slacks': 0, 'integrator_type': 'ERK', 'levenberg_marquardt': 0.0, 'line_search_use_sufficient_descent': 0, 'log_primal_step_norm': False, 'model_external_shared_lib_dir': None, 'model_external_shared_lib_name': None, 'nlp_solver_ext_qp_res': 0, 'nlp_solver_max_iter': 100, 'nlp_solver_step_length': 1.0, 'nlp_solver_tol_comp': 1e-06, 'nlp_solver_tol_eq': 1e-06, 'nlp_solver_tol_ineq': 1e-06, 'nlp_solver_tol_stat': 1e-06, 'nlp_solver_type': 'SQP', 'num_threads_in_batch_solve': 1, 'print_level': 0, 'qp_solver': 'PARTIAL_CONDENSING_HPIPM', 'qp_solver_cond_N': 5, 'qp_solver_cond_ric_alg': 1, 'qp_solver_iter_max': 50, 'qp_solver_ric_alg': 1, 'qp_solver_tol_comp': None, 'qp_solver_tol_eq': None, 'qp_solver_tol_ineq': None, 'qp_solver_tol_stat': None, 'qp_solver_warm_start': 0, 'reg_epsilon': 0.0001, 'regularize_method': 'NO_REGULARIZE', 'rti_log_residuals': 0, 'shooting_nodes': [0.0, 0.05, 0.1, 0.15000000000000002, 0.2, 0.25, 0.3, 0.35, 0.39999999999999997, 0.44999999999999996, 0.49999999999999994, 0.5499999999999999, 0.6, 0.65, 0.7000000000000001, 0.7500000000000001, 0.8000000000000002, 0.8500000000000002, 0.9000000000000002, 0.9500000000000003, 1.0000000000000002], 'sim_method_jac_reuse': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 'sim_method_newton_iter': 3, 'sim_method_newton_tol': 0.0, 'sim_method_num_stages': [4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4], 'sim_method_num_steps': [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], 'tf': 1, 'time_steps': [0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05], 'with_adaptive_levenberg_marquardt': False, 'with_solution_sens_wrt_params': False, 'with_value_sens_wrt_params': False}\n" ] } ], @@ -521,7 +509,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "total CPU time previous call : 0.002611\n", + "total CPU time previous call : 0.002203\n", "\n", "iter\tres_stat\tres_eq\t\tres_ineq\tres_comp\tqp_stat\tqp_iter\talpha\n", "0\t3.141593e+01\t7.208271e-17\t1.500000e+01\t0.000000e+00\t0\t0\t0.000000e+00\t\n", @@ -567,7 +555,7 @@ ], "source": [ "# see https://docs.acados.org/python_interface/index.html#acados_template.acados_ocp_solver.AcadosOcpSolver.get_stats\n", - "print(\"total CPU time previous call :\",ocp_solver.get_stats('time_tot'))\n", + "print(\"total CPU time previous call :\",ocp_solver.get_stats(\"time_tot\"))\n", "ocp_solver.print_statistics()" ] }, @@ -596,8 +584,8 @@ ], "source": [ "u_traj_acados = np.ndarray((K, nu))\n", - "for i in range(K):\n", - " u_traj_acados[i,:] = ocp_solver.get(i, \"u\")\n", + "for k in range(K):\n", + " u_traj_acados[k,:] = ocp_solver.get(k, \"u\")\n", "\n", "timestamp = np.array(range(K))*dt\n", "plt.plot(timestamp, u_traj_casadi,linewidth=3,label=\"casadi (chapter 5)\")\n", @@ -633,7 +621,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.13" + "version": "3.10.12" } }, "nbformat": 4, From 58a843fc208b0d98c017452a684b0c488b3eae6b Mon Sep 17 00:00:00 2001 From: "daisuke.aramaki" <92370011+da1996-04@users.noreply.github.com> Date: Mon, 27 May 2024 13:37:29 +0900 Subject: [PATCH 09/17] Update readme.md --- readme.md | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/readme.md b/readme.md index c6d4b92..38bb51e 100644 --- a/readme.md +++ b/readme.md @@ -1,16 +1,10 @@ # 書籍『PythonとCasADiで学ぶモデル予測制御』サポートサイト このページは書籍『PythonとCasADiで学ぶモデル予測制御』に関する情報を公開するページです。 -[](https://amzn.asia/d/8TwVTO3) - ### 書籍の購入はこちら: [Amazonで購入](https://amzn.asia/d/8TwVTO3) -## 目次 -- [Google Colabへのリンク](#google-colabへのリンク) -- [制御のアニメーション例](#制御のアニメーション例) -- [リンク集](#リンク集) -- [著者発信の情報](#著者発信の情報) +[](https://amzn.asia/d/8TwVTO3) ## Google Colabへのリンク ここでは、本書の各章に対応するGoogle Colabノートブックへのリンクを提供します。以下のリンクから直接実行可能です。 @@ -50,13 +44,13 @@ ## 制御のアニメーション例 本書では、以下のような制御のアニメーションを作成することができます。 -* **倒立振子** +### 倒立振子 -* **2次元ドローン** +### 2次元ドローン -* **ゴム紐** +### ゴム紐 ## リンク集 From 6804ad086512dc3ece9f41b35af0a9f413a5ed50 Mon Sep 17 00:00:00 2001 From: "daisuke.aramaki" <92370011+da1996-04@users.noreply.github.com> Date: Mon, 27 May 2024 14:30:16 +0900 Subject: [PATCH 10/17] Update readme.md --- readme.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/readme.md b/readme.md index 38bb51e..493ef7a 100644 --- a/readme.md +++ b/readme.md @@ -13,10 +13,10 @@ - [3章 CasADiの基本](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter3.ipynb) ### 4章 離散時間のモデル予測制御 -- [4章 ロトカ・ヴォルテラモデルに対するMPC](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter4.ipynb) +- [4章6節 ロトカ・ヴォルテラモデルに対するMPC](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter4.ipynb) ### 5章 連続時間のモデル予測制御 -- [5章 倒立振子に対するMPC](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter5.ipynb) +- [5章6節 倒立振子に対するMPC](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter5.ipynb) ### 6章 モデル予測制御の実装に向けて - [6章 直接的単一シューティング法と直接的多重シューティング法の比較](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter6_single_shooting.ipynb) @@ -26,19 +26,19 @@ - [6章 反復回数の制限](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter6_limit_iteration.ipynb) ### 7章 CasADiにおける最適化ソルバーの比較 -- [7章 マス・バネ・ダンバモデルを例に用いたIPOPTとOSQPの比較](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter7_mass_spring_damper.ipynb) -- [7章 2次元ドローンを例に用いたQPソルバーの比較](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter7_2d_quadrotor.ipynb) -- [7章 ゴム紐モデルを例に用いたNLPソルバーの比較](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter7_chain_of_masses.ipynb) +- [7章2節 マス・バネ・ダンバモデルを例に用いたIPOPTとOSQPの比較](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter7_mass_spring_damper.ipynb) +- [7章3節 2次元ドローンを例に用いたQPソルバーの比較](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter7_2d_quadrotor.ipynb) +- [7章4節 ゴム紐モデルを例に用いたNLPソルバーの比較](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter7_chain_of_masses.ipynb) ### 8章 状態推定問題と移動ホライズン推定 -- [8章 リチウムイオン電池に対するMHE](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter8_LIB.ipynb) -- [8章 CSTRに対するMPCxMHE](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter8_CSTR.ipynb) +- [8章4節 リチウムイオン電池に対するMHE](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter8_LIB.ipynb) +- [8章5節 CSTRに対するMPCxMHE](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter8_CSTR.ipynb) ### B章 CasADi中級 -- [B章 acados(* Google Colabでの動作は行えません。)](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapterB_acados_getting_started.ipynb) -- [B章 関数オブジェクトのCコード生成](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapterB_codegen_function_object.ipynb) -- [B章 ソルバーオブジェクトのCコード生成](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapterB_codegen_solver_interface.ipynb) -- [B章 ロトカ・ヴォルテラモデルに対する離散入力MPC](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapterB_discrete_actuator.ipynb) +- [B章4節 acados(* Google Colabでの動作は行えません。)](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapterB_acados_getting_started.ipynb) +- [B章2節2項 関数オブジェクトのCコード生成](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapterB_codegen_function_object.ipynb) +- [B章2節3項 ソルバーオブジェクトのCコード生成](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapterB_codegen_solver_interface.ipynb) +- [B章6節 ロトカ・ヴォルテラモデルに対する離散入力MPC](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapterB_discrete_actuator.ipynb) ## 制御のアニメーション例 From f686f2b6501997c6fcc0ee199a5fbd12144c2ae1 Mon Sep 17 00:00:00 2001 From: Toru Hishinuma <92719065+th1991-01@users.noreply.github.com> Date: Mon, 27 May 2024 17:03:34 +0900 Subject: [PATCH 11/17] Update readme.md --- readme.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/readme.md b/readme.md index 493ef7a..65b555a 100644 --- a/readme.md +++ b/readme.md @@ -19,11 +19,11 @@ - [5章6節 倒立振子に対するMPC](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter5.ipynb) ### 6章 モデル予測制御の実装に向けて -- [6章 直接的単一シューティング法と直接的多重シューティング法の比較](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter6_single_shooting.ipynb) -- [6章 直接的コロケーション法と直接的多重シューティング法の比較(計算速度)](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter6_collocation_cartpole.ipynb) -- [6章 直接的コロケーション法と直接的多重シューティング法の比較(硬い状態方程式モデル)](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter6_collocation_stiff.ipynb) -- [6章 ウォームスタート](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter6_warm_start_experiment_solution_time.ipynb) -- [6章 反復回数の制限](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter6_limit_iteration.ipynb) +- [6章2節2項 直接的単一シューティング法と直接的多重シューティング法の比較](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter6_single_shooting.ipynb) +- [6章2節3項 直接的コロケーション法と直接的多重シューティング法の比較(計算速度)](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter6_collocation_cartpole.ipynb) +- [6章2節3項 直接的コロケーション法と直接的多重シューティング法の比較(硬い状態方程式モデル)](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter6_collocation_stiff.ipynb) +- [6章4節1項 ウォームスタート](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter6_warm_start_experiment_solution_time.ipynb) +- [6章4節1項 反復回数の制限](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter6_limit_iteration.ipynb) ### 7章 CasADiにおける最適化ソルバーの比較 - [7章2節 マス・バネ・ダンバモデルを例に用いたIPOPTとOSQPの比較](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter7_mass_spring_damper.ipynb) From 3a0699c89ef14ad6c1b5a19cfde7b3cef6463400 Mon Sep 17 00:00:00 2001 From: "daisuke.aramaki" <92370011+da1996-04@users.noreply.github.com> Date: Mon, 27 May 2024 17:11:28 +0900 Subject: [PATCH 12/17] Update readme.md --- readme.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/readme.md b/readme.md index 65b555a..d33c23a 100644 --- a/readme.md +++ b/readme.md @@ -4,6 +4,8 @@ ### 書籍の購入はこちら: [Amazonで購入](https://amzn.asia/d/8TwVTO3) +[版元ドットコム](https://www.hanmoto.com/bd/isbn/9784065356111) + [](https://amzn.asia/d/8TwVTO3) ## Google Colabへのリンク @@ -58,6 +60,9 @@ ### Amazon [単行本](https://www.amazon.co.jp/Python%E3%81%A8CasADi%E3%81%A7%E5%AD%A6%E3%81%B6%E3%83%A2%E3%83%87%E3%83%AB%E4%BA%88%E6%B8%AC%E5%88%B6%E5%BE%A1-KS%E7%90%86%E5%B7%A5%E5%AD%A6%E5%B0%82%E9%96%80%E6%9B%B8-%E6%B7%B1%E6%B4%A5-%E5%8D%93%E5%BC%A5/dp/4065356113) +### 版元ドットコム +[版元ドットコム](https://www.hanmoto.com/bd/isbn/9784065356111) + ### 参考資料 [サポートサイト](https://github.com/proxima-technology/casadi_mpc_nyuumon) From 837403b00032df5d7b7c9e794392639d775a783e Mon Sep 17 00:00:00 2001 From: "daisuke.aramaki" <92370011+da1996-04@users.noreply.github.com> Date: Mon, 27 May 2024 17:16:07 +0900 Subject: [PATCH 13/17] Create _config.yaml --- _config.yaml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 _config.yaml diff --git a/_config.yaml b/_config.yaml new file mode 100644 index 0000000..3ee9ad1 --- /dev/null +++ b/_config.yaml @@ -0,0 +1,2 @@ +plugins: + - jekyll-sitemap From 603b97ee86497cb8c6e7bb23874f57da091232ed Mon Sep 17 00:00:00 2001 From: "daisuke.aramaki" <92370011+da1996-04@users.noreply.github.com> Date: Mon, 27 May 2024 17:16:44 +0900 Subject: [PATCH 14/17] Rename _config.yaml to _config.yml --- _config.yaml => _config.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename _config.yaml => _config.yml (100%) diff --git a/_config.yaml b/_config.yml similarity index 100% rename from _config.yaml rename to _config.yml From 8603f0ad184b67129ae022f417e93e3f30457c05 Mon Sep 17 00:00:00 2001 From: "daisuke.aramaki" <92370011+da1996-04@users.noreply.github.com> Date: Mon, 27 May 2024 17:19:29 +0900 Subject: [PATCH 15/17] Add files via upload --- google6c54bbb9fe6d9d62.html | 1 + 1 file changed, 1 insertion(+) create mode 100644 google6c54bbb9fe6d9d62.html diff --git a/google6c54bbb9fe6d9d62.html b/google6c54bbb9fe6d9d62.html new file mode 100644 index 0000000..d418707 --- /dev/null +++ b/google6c54bbb9fe6d9d62.html @@ -0,0 +1 @@ +google-site-verification: google6c54bbb9fe6d9d62.html \ No newline at end of file From a4eb2e40c425277f505b6dc8e12c9f835d65704b Mon Sep 17 00:00:00 2001 From: "daisuke.aramaki" <92370011+da1996-04@users.noreply.github.com> Date: Tue, 28 May 2024 23:29:54 +0900 Subject: [PATCH 16/17] Update readme.md --- readme.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/readme.md b/readme.md index d33c23a..a7e6a03 100644 --- a/readme.md +++ b/readme.md @@ -64,6 +64,8 @@ [版元ドットコム](https://www.hanmoto.com/bd/isbn/9784065356111) ### 参考資料 +[CasADi公式](https://web.casadi.org/) + [サポートサイト](https://github.com/proxima-technology/casadi_mpc_nyuumon) ### 著者発信の情報 From 87226bcf635f577595d0b5ff51bda84a02f52eef Mon Sep 17 00:00:00 2001 From: "daisuke.aramaki" <92370011+da1996-04@users.noreply.github.com> Date: Wed, 29 May 2024 13:04:53 +0900 Subject: [PATCH 17/17] Update readme.md --- readme.md | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/readme.md b/readme.md index a7e6a03..b0c842b 100644 --- a/readme.md +++ b/readme.md @@ -12,35 +12,35 @@ ここでは、本書の各章に対応するGoogle Colabノートブックへのリンクを提供します。以下のリンクから直接実行可能です。 ### 3章 CasADi入門 -- [3章 CasADiの基本](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter3.ipynb) +- **3.3~3.7** [CasADiの基本](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter3.ipynb) ### 4章 離散時間のモデル予測制御 -- [4章6節 ロトカ・ヴォルテラモデルに対するMPC](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter4.ipynb) +- **4.6** [ロトカ・ヴォルテラモデルに対するMPC](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter4.ipynb) ### 5章 連続時間のモデル予測制御 -- [5章6節 倒立振子に対するMPC](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter5.ipynb) +- **5.6** [倒立振子に対するMPC](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter5.ipynb) ### 6章 モデル予測制御の実装に向けて -- [6章2節2項 直接的単一シューティング法と直接的多重シューティング法の比較](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter6_single_shooting.ipynb) -- [6章2節3項 直接的コロケーション法と直接的多重シューティング法の比較(計算速度)](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter6_collocation_cartpole.ipynb) -- [6章2節3項 直接的コロケーション法と直接的多重シューティング法の比較(硬い状態方程式モデル)](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter6_collocation_stiff.ipynb) -- [6章4節1項 ウォームスタート](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter6_warm_start_experiment_solution_time.ipynb) -- [6章4節1項 反復回数の制限](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter6_limit_iteration.ipynb) +- **6.2.2** [直接的単一シューティング法と直接的多重シューティング法の比較](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter6_single_shooting.ipynb) +- **6.2.3** [直接的コロケーション法と直接的多重シューティング法の比較(計算速度)](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter6_collocation_cartpole.ipynb) +- **6.2.3** [直接的コロケーション法と直接的多重シューティング法の比較(硬い状態方程式モデル)](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter6_collocation_stiff.ipynb) +- **6.4.1** [ウォームスタート](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter6_warm_start_experiment_solution_time.ipynb) +- **6.4.1** [反復回数の制限](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter6_limit_iteration.ipynb) ### 7章 CasADiにおける最適化ソルバーの比較 -- [7章2節 マス・バネ・ダンバモデルを例に用いたIPOPTとOSQPの比較](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter7_mass_spring_damper.ipynb) -- [7章3節 2次元ドローンを例に用いたQPソルバーの比較](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter7_2d_quadrotor.ipynb) -- [7章4節 ゴム紐モデルを例に用いたNLPソルバーの比較](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter7_chain_of_masses.ipynb) +- **7.2** [マス・バネ・ダンバモデルを例に用いたIPOPTとOSQPの比較](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter7_mass_spring_damper.ipynb) +- **7.3** [2次元ドローンを例に用いたQPソルバーの比較](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter7_2d_quadrotor.ipynb) +- **7.4** [ゴム紐モデルを例に用いたNLPソルバーの比較](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter7_chain_of_masses.ipynb) ### 8章 状態推定問題と移動ホライズン推定 -- [8章4節 リチウムイオン電池に対するMHE](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter8_LIB.ipynb) -- [8章5節 CSTRに対するMPCxMHE](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter8_CSTR.ipynb) +- **8.4** [リチウムイオン電池に対するMHE](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter8_LIB.ipynb) +- **8.5** [CSTRに対するMPCxMHE](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapter8_CSTR.ipynb) ### B章 CasADi中級 -- [B章4節 acados(* Google Colabでの動作は行えません。)](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapterB_acados_getting_started.ipynb) -- [B章2節2項 関数オブジェクトのCコード生成](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapterB_codegen_function_object.ipynb) -- [B章2節3項 ソルバーオブジェクトのCコード生成](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapterB_codegen_solver_interface.ipynb) -- [B章6節 ロトカ・ヴォルテラモデルに対する離散入力MPC](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapterB_discrete_actuator.ipynb) +- **B.2.2** [関数オブジェクトのCコード生成](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapterB_codegen_function_object.ipynb) +- **B.2.3** [ソルバーオブジェクトのCコード生成](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapterB_codegen_solver_interface.ipynb) +- **B.4** [acados(* Google Colabでの動作は行えません。)](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapterB_acados_getting_started.ipynb) +- **B.6** [ロトカ・ヴォルテラモデルに対する離散入力MPC](https://colab.research.google.com/github/proxima-technology/casadi_mpc_nyuumon/blob/master/src/chapterB_discrete_actuator.ipynb) ## 制御のアニメーション例