STEM 隨筆︰古典力學︰動力學【五‧五‧丁】

Ccpenguin,_the_ancestor_of_Tux
Linus Torvalds’s
“favourite penguin picture”

220px-TheStoryBehindTux
The story behind Tux,
Canberra Zoo

220px-Tuz-logo.svg
Tuz, the Tasmanian devil

Tux 學堂的牆上, 掛著核心 kernel  Linus Torvalds 最喜歡的『吃著魚企鵝圖』︰

吃著魚釣魚─── 一個理念、一種方法、一門生活哲學

強調『理論』與『實務』並重之學習,同修的重要。在這個社會裡,教育是責任,學習是義務!從出生到死亡,所有十方之各族各種企鵝,一體適用 !!

還掛著一篇聖諭
Tux the Linux penguin

Even people who have never used Linux have probably seen Tux, the penguin mascot of this open-source operating system. Tux was the result of a competition held by the Open Source Software community to find a mascot for Linux. In the forums Linus Torvalds, Finnish creator of Linux, mentioned an encounter he had had with a penguin at Canberra’s National Zoo and Aquarium. Linus claims that he was bitten by a penguin and because of that he was supposedly infected with a disease called “Penguinitis”. This disease caused him to become fixated with penguins.

以及誓言支援拯救袋獾運動的 Tuz

這時小企鵝學堂上,嘰嘰喳喳 ,各地方言七嘴八舌!!萬邦符號亂七八糟,實在難以錄記 。原來這『聆老師』以有教無類聞名,通曉萬邦各地語言符號,此刻那些小企鵝們正熱烈議論著『論語讀法』的呢??

有的主張︰半部論語治天下,讀半部。

有的辯證︰就算讀了整部,可是連齊家都不能吔!

有的議論︰是該先誠心、正意 、修身的吧!!

有的搞笑︰『始』學而,『終』堯曰!不就兩篇嘛??

那你怎個讀法?

哦!唱給你聽︰孔子的中心思想是個,……

大概東西人世間只有在『愛情的世界』裡,可能

‧身高不是距離

‧膚色不是問題

‧語言沒有隔閡

□不○沒有的吧!!

即使再忙也要和你喝杯咖啡??

BabyTux

graphics-tux-638974

sonictux

starbucks_tux_linux_art-555px

─── 《TUX@RPI ︰ 《學而堯曰》

 

不管『理論』或『實務』都需要解讀『現象』也◎

知道『前提』以及『預設』之條件,不過起步爾!

system Module

classpytrajectory.system.ControlSystem(ff, a=0.0, b=1.0, xa=[], xb=[], ua=[], ub=[],constraints=None, **kwargs)
Bases: object

Base class of the PyTrajectory project.

Parameters:
  • ff (callable) – Vector field (rhs) of the control system.
  • a (float) – Left border of the considered time interval.
  • b (float) – Right border of the considered time interval.
  • xa (list) – Boundary values at the left border.
  • xb (list) – Boundary values at the right border.
  • ua (list) – Boundary values of the input variables at left border.
  • ub (list) – Boundary values of the input variables at right border.
  • constraints (dict) – Box-constraints of the state variables.
  • kwargs
    key default value meaning
    sx 10 Initial number of spline parts for the system variables
    su 10 Initial number of spline parts for the input variables
    kx 2 Factor for raising the number of spline parts
    maxIt 10 Maximum number of iteration steps
    eps 1e-2 Tolerance for the solution of the initial value problem
    ierr 1e-1 Tolerance for the error on the whole interval
    tol 1e-5 Tolerance for the solver of the equation system
    dt_sim 1e-2 Sample time for integration (initial value problem)
    use_chains True Whether or not to use integrator chains
    sol_steps 100 Maximum number of iteration steps for the eqs solver
    first_guess None to initiate free parameters (might be useful: {‘seed’: value})

……

plot()
Plot the calculated trajectories and show interval error functions.

This method calculates the error functions and then calls the visualisation.plotsimfunction.

───

 

然後觀『始』、『終』間之『變化』和/或『內插』合宜乎?

 

接著省察所謂應理而為,亦應當有所思夫??

‧  為何 x_2 可轉向 < 0

‧  為何 u_1-15 e^{-15 t} 那麼遠?

‧ 為何 『誤差』 H_1, H_2 得以近乎於零?

‧ …

 

遇惑自能務求其本,自生『樣條函數

Spline (mathematics)

In mathematics, a spline is a special function defined piecewise by polynomials. In interpolating problems, spline interpolation is often preferred to polynomial interpolation because it yields similar results, even when using low degree polynomials, while avoiding Runge’s phenomenon for higher degrees.

In the computer science subfields of computer-aided design and computer graphics, the term spline more frequently refers to a piecewise polynomial parametric curve[citation needed]. Splines are popular curves in these subfields because of the simplicity of their construction, their ease and accuracy of evaluation, and their capacity to approximate complex shapes through curve fitting and interactive curve design[citation needed].

The term spline comes from the flexible spline devices used by shipbuilders and draftsmen to draw smooth shapes.[1]

Single knots at 1/3 and 2/3 establish a spline of three cubic polynomials meeting with C2 continuity. Triple knots at both ends of the interval ensure that the curve interpolates the end points

Introduction

The term “spline” is used to refer to a wide class of functions that are used in applications requiring data interpolation and/or smoothing. The data may be either one-dimensional or multi-dimensional. Spline functions for interpolation are normally determined as the minimizers of suitable measures of roughness (for example integral squared curvature) subject to the interpolation constraints. Smoothing splines may be viewed as generalizations of interpolation splines where the functions are determined to minimize a weighted combination of the average squared approximation error over observed data and the roughness measure. For a number of meaningful definitions of the roughness measure, the spline functions are found to be finite dimensional in nature, which is the primary reason for their utility in computations and representation. For the rest of this section, we focus entirely on one-dimensional, polynomial splines and use the term “spline” in this restricted sense.

 

用於動力系統,真可一勞永逸也耶!!

自會反思恐尚有未知之『束縛』的呦?〒

Handling constraints

In practical situations it is often desired or necessary that the system state variables comply with certain limits. To achieve this PyTrajectory uses an approach similar to the one presented by K. Graichen and M. Zeitz in [Graichen06].

The basic idea is to transform the dynamical system into a new one that satisfies the constraints. This is done by projecting the constrained state variables on new unconstrained coordinates using socalled saturation functions.

Suppose the state x should be bounded by x_0,x_1 such that x_0 \leq x(t) \leq x_1 for all t \in [a,b]. To do so the following saturation function is introduced

that depends on the new unbounded variable y and satisfies the saturation limits y^-,y^+, i.e. y^- \leq \psi(y(t),y^{\pm}) \leq y^+ for all t. It is assumed that the limits are asymptotically and \psi(\cdot,y^{\pm}) is strictly increasing , that is \frac{\partial \psi}{\partial y} > 0. For the constraints x \in [x_0,x_1] to hold it is obvious that y^- = x_0 and y^+ = x_1. Thus the constrained variable x is projected on the new unconstrained varialbe y.

By differentiating the equation above one can replace \dot{x} in the vectorfield with a new term for \dot{y}.

Next, one has to calculate new boundary values y_a = y(a) and y_b = y(b) for the variable y from those, x_a = x(a) and x_b = x(b), of x. This is simply done by

Now, the transformed dynamical system can be solved where all state variables are unconstrained. At the end a solution for the original state variable x is obtained via a composition of the calculated solution y(t) and the saturation function \psi(\cdot,y^{\pm}).

There are some aspects to take into consideration when dealing with constraints:

  • The boundary values of a constrained variable have to be strictly within the saturation limits
  • It is not possible to make use of an integrator chain that contains a constrained variable

Choice of the saturation functions

As mentioned before the saturation functions should be continuously differentiable and strictly increasing. A possible approach for such functions is the following.

The parameter m affects the slope of the function at y = 0 and is chosen such that \frac{\partial}{\partial y}\psi(0,y^{\pm}) = 1, i.e.

 

自然自求自解跡證哩!〒

 

Etymology

The origin of the term ‘stiffness’ seems to be somewhat of a mystery. According to Joseph Oakland Hirschfelder, the term ‘stiff’ is used because such systems correspond to tight coupling between the driver and driven in servomechanisms.[3] According to Richard. L. Burden and J. Douglas Faires,

Significant difficulties can occur when standard numerical techniques are applied to approximate the solution of a differential equation when the exact solution contains terms of the form eλt, where λ is a complex number with negative real part.

Problems involving rapidly decaying transient solutions occur naturally in a wide variety of applications, including the study of spring and damping systems, the analysis of control systems, and problems in chemical kinetics. These are all examples of a class of problems called stiff (mathematical stiffness) systems of differential equations, due to their application in analyzing the motion of spring and mass systems having large spring constants (physical stiffness).[4]

For example, the initial value problem

\displaystyle m{\ddot {x}}+c{\dot {x}}+kx=0,\qquad x(0)=x_{0},\qquad {\dot {x}}(0)=0,
     
(10)

with m = 1, c = 1001, k = 1000, can be written in the form (5) with n = 2 and

\displaystyle {\mathbf {A} }=\left({\begin{array}{rr}0&1\\-1000&-1001\end{array}}\right),
     
(11)
\displaystyle {\mathbf {f} }(t)=\left({\begin{array}{c}0\\0\end{array}}\right),
     
(12)
\displaystyle {\mathbf {x} }(0)=\left({\begin{array}{c}x_{0}\\0\end{array}}\right),
     
(13)

and has eigenvalues \displaystyle {\overline {\lambda }}=-1000,{\underline {\lambda }}=-1. Both eigenvalues have negative real part and the stiffness ratio is

\displaystyle {\frac {|-1000|}{|-1|}}=1000,
     
(14)

which is fairly large. System (10) then certainly satisfies statements 1 and 3. Here the spring constant k is large and the damping constant c is even larger.[5] (Note that ‘large’ is a vague, subjective term, but the larger the above quantities are, the more pronounced will be the effect of stiffness.) The exact solution to (10) is

\displaystyle x(t)=x_{0}\left(-{\frac {1}{999}}e^{-1000t}+{\frac {1000}{999}}e^{-t}\right)\approx x_{0}e^{-t}.
     
(15)

Note that (15) behaves quite nearly as a simple exponential x0et, but the presence of the e−1000t term, even with a small coefficient is enough to make the numerical computation very sensitive to step size. Stable integration of (10) requires a very small step size until well into the smooth part of the solution curve, resulting in an error much smaller than required for accuracy. Thus the system also satisfies statement 2 and Lambert’s definition.