From 91450b7ab61944716342055ff7d176a6a625eb9d Mon Sep 17 00:00:00 2001 From: edxu96 Date: Tue, 17 Dec 2019 16:12:13 +0100 Subject: [PATCH] update --- examples/dynamic/project/README.tex.md | 36 +++++++++++++++++--------- src/dynamic/main.m | 10 +++---- src/dynamic/solve_chain.m | 2 +- 3 files changed, 30 insertions(+), 18 deletions(-) diff --git a/examples/dynamic/project/README.tex.md b/examples/dynamic/project/README.tex.md index f115216..7f0be9b 100644 --- a/examples/dynamic/project/README.tex.md +++ b/examples/dynamic/project/README.tex.md @@ -81,6 +81,30 @@ $$ \end{align} $$ +When $h = 6, L = 10, M = 14, N = 6$, the value of the costate vector at 0, $\left[ \lambda^{z}_{i}, \lambda^{y}_{i} \right]^{T}_{0}$, is $[-22.3645, 68.6700]$. + +When $h = 6, L = 10, M = 14, N = 100$, the value of the costate vector at 0, $\left[ \lambda^{z}_{i}, \lambda^{y}_{i} \right]^{T}_{0}$, is $[-22.4092, 68.6700]$. + +The two results can be visualized by the figure 1: + +![](/images/dynamic_1.png) + +### Vertical Force and Costate Vector + +Determine the vertical force in the origin (i = 0). Compare this with the costate at the origin. Discuss your observations. Give a qualified guess on the sign of horizontal force in the origin. + +The vertical forces at the left end and the right end are equal, and their sum equals the weight of the chain. So The vertical forces at the left end is $68.67$, which is the same value as $\lambda^{y}_{i}$. + +The horizontal forces at different joints are the same. We can get the force at the end of the 2nd $f_3$ sections by analyzing the balance of 3rd and 4th sections of the chain: + +$$ +2 f_3 \sin \left(\theta_{2} \right) = 2 m g +$$ + +So we can get $f_3 = 50.2457$, so the value of horizontal force is $44.7289$, which is two times of the value of $\lambda^{z}_{0}$. When $N = 100$, $f_{50} = 44.8394$, and the value of horizontal force is $44.8183$. So we can say that the vertical force at the left end equals $\lambda^{y}_{0}$, the horizontal force at the left end is two times of $\lambda^{z}_{0}$. + +### Pontryagins Maximum principle + If the original two-dimensional expressions are to be used, we can write the corresponding Hamiltonian function as: $$ @@ -99,18 +123,6 @@ $$ \end{align} $$ -When $h = 6, L = 10, M = 14, N = 6$, the value of the costate vector at 0, $\left[ \lambda^{z}_{i}, \lambda^{y}_{i} \right]^{T}_{0}$, is $[-22.3645, 68.6700]$. - -When $h = 6, L = 10, M = 14, N = 100$, the value of the costate vector at 0, $\left[ \lambda^{z}_{i}, \lambda^{y}_{i} \right]^{T}_{0}$, is $[-22.4092, 68.6700]$. - -The two results can be visualized by the figure 1: - -![](/images/dynamic_1.png) - -### Vertical Force and Costate Vector - -Determine the vertical force in the origin (i = 0). Compare this with the costate at the origin. Discuss your observations. Give a qualified guess on the sign of horizontal force in the origin. - ### Two Symmetric Half Chains For $i=0,1, \ldots N-1$, we have: diff --git a/src/dynamic/main.m b/src/dynamic/main.m index 75b860b..465854b 100644 --- a/src/dynamic/main.m +++ b/src/dynamic/main.m @@ -18,13 +18,13 @@ function solve_project() s_data_1 = get_data_chain(6); s_data_2 = get_data_chain(100); - [vec_guess_star_1, z_t_1, y_t_1, ~, ~] = solve_chain(s_data_1); + % [vec_guess_star_1, z_t_1, y_t_1, ~, ~] = solve_chain(s_data_1); [vec_guess_star_2, z_t_2, y_t_2, ~, ~] = solve_chain(s_data_2); - - vec_guess_star_1 + % + % vec_guess_star_1 vec_guess_star_2 - - plot_chain(z_t_1, y_t_1, z_t_2, y_t_2) + % + % plot_chain(z_t_1, y_t_1, z_t_2, y_t_2) end diff --git a/src/dynamic/solve_chain.m b/src/dynamic/solve_chain.m index d31d496..0cdc36d 100644 --- a/src/dynamic/solve_chain.m +++ b/src/dynamic/solve_chain.m @@ -12,7 +12,7 @@ % err_star % z_t % y_t - % theta_t + % theta_t(50:51) % lambda_z_t % lambda_y_t