{"id":22399977,"url":"https://github.com/krproject-tech/parameter_estimation_demo_by_ukf","last_synced_at":"2026-03-07T08:02:28.795Z","repository":{"id":74020975,"uuid":"543926058","full_name":"KRproject-tech/Parameter_estimation_demo_by_UKF","owner":"KRproject-tech","description":"Parameter estimation Demo by UKF","archived":false,"fork":false,"pushed_at":"2024-09-15T14:01:03.000Z","size":490,"stargazers_count":4,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-31T16:37:17.383Z","etag":null,"topics":["kalman-filter","matlab","parameter-estimation"],"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/KRproject-tech.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":"2022-10-01T07:02:15.000Z","updated_at":"2025-05-26T11:46:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"d5a8e630-5f46-4113-af9c-535bb673e475","html_url":"https://github.com/KRproject-tech/Parameter_estimation_demo_by_UKF","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/KRproject-tech/Parameter_estimation_demo_by_UKF","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KRproject-tech%2FParameter_estimation_demo_by_UKF","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KRproject-tech%2FParameter_estimation_demo_by_UKF/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KRproject-tech%2FParameter_estimation_demo_by_UKF/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KRproject-tech%2FParameter_estimation_demo_by_UKF/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KRproject-tech","download_url":"https://codeload.github.com/KRproject-tech/Parameter_estimation_demo_by_UKF/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KRproject-tech%2FParameter_estimation_demo_by_UKF/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30209796,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T05:23:27.321Z","status":"ssl_error","status_checked_at":"2026-03-07T05:00:17.256Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["kalman-filter","matlab","parameter-estimation"],"created_at":"2024-12-05T08:10:48.875Z","updated_at":"2026-03-07T08:02:28.774Z","avatar_url":"https://github.com/KRproject-tech.png","language":"MATLAB","readme":"# Parameter_estimation_demo_by_UKF\n\n![License](https://img.shields.io/github/license/yuki-koyama/elasty)\n\u003cimg src=\"https://img.shields.io/badge/Matlab-%3E%3D%202007b%20-blue.svg\" alt=\"Matlab\"\u003e\n\u003cimg src=\"https://img.shields.io/badge/Windows-Pass-brightgreen.svg\" alt=\"Windows\"\u003e\n\n**Communication**\n\n\u003ca style=\"text-decoration: none\" href=\"https://twitter.com/hogelungfish_\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/twitter-%40hogelungfish_-1da1f2.svg\" alt=\"Twitter\"\u003e\n\u003c/a\u003e\n\u003cp\u003e\n\n**Language**\n\u003cp\u003e\n\u003cimg src=\"https://cdn.jsdelivr.net/gh/devicons/devicon/icons/matlab/matlab-original.svg\" width=\"60\"/\u003e\n\u003cp\u003e\n\n\nParameter estimation Demo by Unscented Kalman Filter (UKF) [^1][^2].\nExample of dynamics is for the 1 DoF arm with spring, damping, and frictional forces at a joint.\nJoint angle is measured, then, unknown damping and frictional coefficients are identified by UKF [^3][^4].\nIn spite of discontinuous model of frictional force, UKF can be applied dislike Extended Kalman Filter (EKF). \n\n\n## Publications\n\nThis code was employed to estimate unknown parameters for the following publication(s):\n\n* Optimal swimming locomotion of snake-like robot in viscous fluids, Journal of Fluids and Structures, Vol. 123 (2023).  \nhttps://doi.org/10.1016/j.jfluidstructs.2023.104007\n\n````\n@article{YAMANO2023104007,\ntitle = {Optimal swimming locomotion of snake-like robot in viscous fluids},\njournal = {Journal of Fluids and Structures},\nvolume = {123},\npages = {104007},\nyear = {2023},\nissn = {0889-9746},\ndoi = {https://doi.org/10.1016/j.jfluidstructs.2023.104007},\nauthor = {A. Yamano and T. Kimoto and Y. Inoue and M. Chiba}\n}\n````\n\n* Fluid force identification acting on snake-like robots swimming in viscous fluids, Journal of Fluids and Structures, Vol. 106 (2021).\nhttps://doi.org/10.1016/j.jfluidstructs.2021.103351\n\n````\n@article{YAMANO2021103351,\ntitle = {Fluid force identification acting on snake-like robots swimming in viscous fluids},\njournal = {Journal of Fluids and Structures},\nvolume = {106},\npages = {103351},\nyear = {2021},\nissn = {0889-9746},\ndoi = {https://doi.org/10.1016/j.jfluidstructs.2021.103351},\nauthor = {A. Yamano and K. Shimizu and M. Chiba and H. Ijima},\nkeywords = {Snake-like robot, Swimming motion, Highly viscous fluid, Unscented Kalman filter, Parameter estimation}\n}\n````\n\n\n\n## Overview\n\nDynamics for the 1 DoF arm with spring, damping, and frictional forces at a joint is denoted as follows,\n\n$$\nJ \\ddot{\\theta} + c \\dot{\\theta} + \\mu {\\rm sgn}{\\dot{\\theta}} + k \\theta = u,\n$$\n\nwhere damping and friction coefficients; $c$ and $\\mu$ are unknown variables.\nFrom measured time series of data $y_m := \\theta_m(t)$, these variables are identified by UKF.\n\nThen, state space representation is denoted as,\n\n$$\n\\begin{array}{c}\n{\\bf \\dot{x}} = f( {\\bf x}, {\\bf u}), \\\\\ny = {\\bf C} {\\bf x},\n\\end{array}\n$$\n\nwhere\n\n$$\n\\begin{array}{c}\n{\\bf x} =\n\\left[\n\\begin{array}{c}\nx_1 \\\\\nx_2 \\\\\n\\end{array}\n\\right] :=\n\\left[\n\\begin{array}{c}\n\\theta \\\\\n\\dot{\\theta} \\\\\n\\end{array}\n\\right], \\\\\nf( {\\bf x}, {\\bf u}) :=\n\\left[\n\\begin{array}{c}\nx_2 \\\\\n-J^{-1} c x_2 - J^{-1} \\mu {\\rm sgn} x_2 - J^{-1}k x_1 \\\\\n\\end{array}\n\\right] + {\\bf B} u, \\\\\n\\bf{B} := \n\\left[\n\\begin{array}{c}\n0 \\\\\nJ^{-1} \\\\\n\\end{array}\n\\right], \n{\\bf C} := \n\\left[\n\\begin{array}{c}\n1 \\\\\n0 \\\\\n\\end{array}\n\\right]^T.\n\\end{array}\n$$\n\nUnknown damping and frictional coefficients are added to the expanded state vector as\n\n$$\n{\\bf x_E} =\n\\left[\n\\begin{array}{c}\n{\\bf x} \\\\\nx_3 \\\\\nx_4 \\\\\n\\end{array}\n\\right] :=\n\\left[\n\\begin{array}{c}\n{\\bf x} \\\\\nc \\\\\n\\mu \\\\\n\\end{array}\n\\right].\n$$\n\nThen, the expanded state representation is obtained as\n\n$$\n\\begin{array}{c}\n{\\bf \\dot{x}_E} = f_E( {\\bf x_E}, {\\bf u}), \\\\\ny = {\\bf C_E} {\\bf x_E},\n\\end{array}\n$$\n\nwhere\n\n$$\n\\begin{array}{c}\nf_E( {\\bf x_E}, {\\bf u}) :=\n\\left[\n\\begin{array}{c}\nx_2 \\\\\n-J^{-1} c x_2 - J^{-1} \\mu {\\rm sgn} x_2 - J^{-1}k x_1 \\\\\n0 \\\\\n0 \\\\\n\\end{array}\n\\right] + {\\bf B_E} u, \\\\\n\\bf{B}_E := \n\\left[\n\\begin{array}{c}\n0 \\\\\nJ^{-1} \\\\\n0 \\\\\n0 \\\\\n\\end{array}\n\\right], \n{\\bf C}_E := \n\\left[\n\\begin{array}{c}\n1 \\\\\n0 \\\\\n0 \\\\\n0 \\\\\n\\end{array}\n\\right]^T.\n\\end{array}\n$$\n\n\nAfter that, the dynamics is discretized for time to apply UKF (\"./functions/c2d_func.m\" [3]).\n\n![図1](https://github.com/KRproject-tech/Parameter_estimation_demo_by_UKF/assets/114337358/c67f179f-8d55-4f0f-b6e1-c86732d4094c)\n\n\n\n\n\n## Usages\n\n__[Step 1] Edit parameters__\n\nEdit code in \"param_setting.m\".\n\nProcess model with the state-space representation ${\\bf \\dot{x}} = f( {\\bf x}, {\\bf u})$, observation model $y = {\\bf C} {\\bf x}$, and input $u(t)$ are defined in the \"param_setting.m\" as follows;\n\n````python\n%% system parameter\n%%[0] continuous time system\nJ = 1;\nk = 1;\nf =@( x)[ x(2);\n          -1/J*x(3)*x(2) - 1/J*x(4)*sign( x(2)) - 1/J*k*x(1);\n          0;\n          0];\nB = [ 0;\n      1/J;\n      0;\n      0];\nbd = [ 1;\n       1;\n       0;\n       0];\nC = [ 1 0 0 0];\nut = @( t)( 1.0);\n````\n\n__[Step 2] Start analysis__\n\nExecute \"demo.m\". \n\n\n## Images\n\n![time_series_angle](https://github.com/KRproject-tech/Parameter_estimation_demo_by_UKF/assets/114337358/01988d56-d82c-4541-b0d1-d81eeac080da)\n\nTime series of state $x_1 := \\theta (t)$.\n\n\n![untitled](https://user-images.githubusercontent.com/114337358/193397522-72f5e6e8-20ad-4821-932b-a2290c713a68.png)\n\nTime series of output $y(t) := x_1(t)$\n\n![identified_parameters](https://github.com/KRproject-tech/Parameter_estimation_demo_by_UKF/assets/114337358/44c5ceec-5d16-4fcb-8932-2e5c91548bbc)\n\nIdentified damping and friction coefficients; $c$ and $\\mu$, and deviations; $\\sigma_c$ and $\\sigma_\\mu$, respectively. \n\n\n\n### References\n[^1]: Julier, S.J., Uhlmann, J.K., 2004. Unscented filtering and nonlinear estimation. Proc. IEEE 92 (3), 401–422.\n\n[^2]: Julier, S.J., Uhlmann, J.K., Durrant-Whyte, H.F., 1995. A new approach for filtering nonlinear systems. In: Proceedings of 1995 American Control\nConference. ACC’95 3, pp. 1628–1632. http://dx.doi.org/10.1109/ACC.1995.529783.\n\n[^3]: 足立 修一，丸田 一郎，「カルマンフィルタの基礎」，東京電機大学出版局．\n\n[^4]: Fluid force identification acting on snake-like robots swimming in viscous fluids, Journal of Fluids and Structures, Vol. 106 (2021).  \nhttps://doi.org/10.1016/j.jfluidstructs.2021.103351\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrproject-tech%2Fparameter_estimation_demo_by_ukf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkrproject-tech%2Fparameter_estimation_demo_by_ukf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrproject-tech%2Fparameter_estimation_demo_by_ukf/lists"}