##
Theory versus Practice?
- Download source code 3.6 MB
- Download sample of table function - 8.2 KB
- Download sample of numerical calculation - 5.5 KB
- Download Parametric Identification of Transfer Functions in the Frequency Domain - 6.9 KB
- Download Parametric Identification of Transfer Functions in the Frequency Domain (actual function) - 9 KB
- Download Artificial Earth Satellite sample - 1.5 MB
Useful links ## 1. Introduction
First stage of math education contains familiarization with numbers. Then unknown " - I am an engineer, so I do not need object oriented paradigm. (This engineer had used ALGOL at 1995, he used a lot of labels instead "begin ... end" construction.
- I do not have no time for theoretical study.
- I prefer simplicity. (This man is not familiar with code reuse).
- High quality contradicts rapid development.
Any good IT specialist can himself/herself extend this list of antipatterns. My own opinion is: "Theory is useful for practice". So I placed "?" at this article title. All my articles contain a lot of theory. Main accent of this article is usefulness of theory. Following story proves that application of theory is time saving. I was often condemned by my colleagues: “You are reading irrelevant books” One my colleague many years tried to find analytical solution of on engineering ordinary differential equation. I told him that existence of such solution is extraordinary event. I read the book I. Kaplansky, “Differential Algebra”, Hermann (1957). Roughly speaking this book explains the fact that existence of analytical solution is extraordinary event. The colleague answered me that the book is irrelevant. “We are not mathematicians but we are engineers” He did not find analytical solution. I am not sure that this solution would be useful because numerical solution takes part of one second. A lot of colleagues told me that they are very busy. So they do not read smart books. They told that I have a lot of time and so I read a lot of books. However I do not spend time for useless tasks. Maybe reading of smart books provides time-saving? ## 2. Background.Rigorous math has laconism, definiteness and context dependence. Meaning of below notation
is presented in following table
My friend thought that " is presented in following table:
Samples of applications of this theory is presented below. ## 3. Functions## 3.1 Base interface
Talk about /// <summary> /// Function of one variable /// </summary> public interface IOneVariableFunction : IObjectOperation { /// <summary> /// Type of variable /// </summary> object VariableType { get; } } /// <summary> /// Operation which returns an object /// </summary> public interface IObjectOperation { /// <summary> /// Types of input parameters /// </summary> object[] InputTypes { get; } /// <summary> /// Calculates result of this operation /// </summary> /// <param name="arguments">Array of arguments</param> /// <returns>Operation result</returns> object this[object[] arguments] { get; } /// <summary> /// Return type /// </summary> object ReturnType { get; } }
Above interface is specification of ## 3.2 Examples## 3.2.1 Explicit formulaA set functions can be represented by explicit formula. Samples of explicit expressions are presented below: These expressions represent the same function. However arguments of the functions are different. Moreover types of arguments p and t can be different.
## 3.2.2 TableA lot of functions used in science and engineering are defined by experiment. These functions are tabulated. Example of tabulated function is presented below:
Following picture represents sample of application of tabulated function:
The
Following picture represents user interface of these parameters:
Follownig picture presents demo application of tabulated functions:
Properties of objects
The
And at last
Following picture represents
Red and Blue curve are charts of ## 3.2.3 Numerical calculation
There are a lot of math functions which do not have explicit expression. A lot of differential equations do not have explicit solutions. For example second order linear differential equation
where
Greek delta means Dirac delta function,
The
Where variable . Following chart represents solution of differential equation system:
Red and blue curve represents
This component has following variables:
The
Variables of
Output of
- Download this sample
## 4. Practical ApplicationsAbove samples are rather artificial then practical. Here I would like to prove usefulness of theory for practice. ## 4.1 Parametric Identification of Transfer Functions in the Frequency DomainHere is a survey of Parametric Identification of Transfer Functions in the Frequency Domain. We would like identify parameters of following third order transfer function:
Assume that frequency response is defined by experiment. Following picture represents idea of identification is presented at following pictures.
We would like yield such values of constants
tan
The
Above formula is explicit expression of frequency response. Argument
So above formula represents theoretical frequency response. The
Number 0 correspond to both
First formula is frequency response. But argument of this formula is time variable
Theoretical function
The
## 4.2 Artificial Earth satelliteHere following tasks are considered - Determination of motion parameters;
- Generation of text document;
- Visualization;
- Audio support.
All these tasks use motion parameters as time functions in different context. Orbit determination uses vector values, visualization uses functions of time variable. However single set of parameters are being used for all this tasks. Roughly speaking actual ## 4.2.1 Motion modelMotion model of spacecraft is already described here. But I have copied text for easy reading. The motion model of an artificial satellite is a system of ordinary differential equations that describe the motion in a Greenwich reference frame:
where are the coordinates and components of velocity respectively, is angular velocity of Earth, and are components of the summary external acceleration. The current model contains gravitational force and the aerodynamic one. These accelerations can be defined by the following formulae: The following table contains meaning of these parameters: Component of ordinary differential equations is used for above equations. This component does not have a rich system of symbols and uses lower case variables only. However this component supports rich system of comments which is presented below:
These comments can contain mappings between variables and physical parameters. Independent variables of equations ( The component represents differential equations in the following way: Besides independent variables equations contain additional parameters. The following table contains mapping of these parameters: Some of these parameters are constants. Other parameters should be exported. Constants are checked and exported parameters are not checked below: Exported parameters concern with gravity and atmosphere models. These models are contained in external libraries. The following picture contains components of motion model.
The
This picture has the following meaning. Variables
Components
The above picture has the following meaning. The
This picture means that parameters ## 4.2.2 Orbit determinationThe following picture illustrates the problem of determination of the orbit. We have an artificial Earth's satellite. There are a set of ground stations which perform measurements. So we have measurements of distance and relative velocity between stations and the satellite. Processing of these measurements provides determination of orbit. ## 4.2.2.1 Input DataInput data contains measurements of distances and relative velocities. Special components are used for this purpose. These components are presented below:
Ordinates of The full list of input parameters is represented in the following table:
Let us comment on this table. We have two arrays of measurements. First array d, ... contains measurements of distance. Second one _{2}V, _{1}V ... contains measurements of velocity. First two rows of the above table correspond to these two arrays. Measurements _{2}d, _{1}d, ... are performed in different times. Third row of above table corresponds to array of times of these measurements. Similarly 4 - th row corresponds to array of times of _{2}V, _{1}V ... measurements. A set of ground stations is used for measurements. Suppose that _{2}d is obtained by ground station which has coordinates _{i}X, _{i}Y, _{i}Z. The 5, 6, 7 th rows of table correspond to _{i}X, _{i}Y, _{i}Z arrays. Similarly 8 - 10 rows correspond to coordinates of ground stations and
_{i}V measurements. Note that the different measurements have no equal accuracy. The General linear method requires to use different weights for such measurements. A new component
was developed for this purpose. It enables us to create weighted selections. In case of orbit determination, measurements have different variances. So we have weighted least squares situation. So variances of measurements are needed. Rows 11 and 12 contain arrays variances of _{i}d and _{i}V respectively. Components _{i}Distance Selection and Velocity Selection are "weighted selections" which contain measurements and their variances. Properties of Distance Selection are presented below:This picture has the following meaning: - Array of measurements is contained in ordinates of
**Distance**component. - Array of variances is contained in ordinates of
**Distance Sigma**component.
The ## 4.2.2.2 Nonlinear Regression
to multidimensional Nonlinear regression operates with selections. This software implements two methods of manipulation with selections. The first method loads selection iteratively, i.e., step by step. The second one loads selection at once. The architecture of nonlinear regression software that uses iterative regression is presented in the following scheme:
Let us describe the components of this scheme. The iterator provides data-in selections The architecture of the software with loading selection at once is presented in the following scheme:
The processor compares ## 4.2.2.3 Ingredients
The above picture contains general ingredients of nonlinear regression. Let us consider ingredients related to orbit determination of orbits. The
As it is already noted, parameters - Calculation of trajectory of satellite
- Calculation of time shifts
- Calculation of distances and velocities
The
According to these properties,
Output of this component is used by
This component calculates arrays of times of reflection of signals by the satellites. Component
The
This parameters are compared with selections. The
Left part of above window corresponds to
Middle part of above window contains ## 4.2.2.4 Resume
Orbit determination requires motion parameters as actual functions. Moreover shifted by time delay functions are required. However motion equations do not have explicit solution. So ## 4.2.3 Orbit determination containerAbove tasts are already described in my article. Here extended task is described. Orbit determination task is aggregated for more easy further development. Aggregation result is presented below:
Extended task is presented at following picture:
It contains also video, audio and document generation. ## 4.2.4 Video
Video task is rather "
The
The
This picture has following meaning. Motion of
Visual image of these frames is presented below:
Where
are latitude and longitude of the satellite respectively. Axes of
Variables
Following pictures and tables represent properties of .
Properties of
Properties of
## 4.2.5 AudioLet us consider following audio support which blows sounds when satellite intersects Equator.
Following sounds are included in audio support: - Blowing of "Up" word if satellite is moved from South hemisphere to North one;
- Blowing of "Down" word if satellite is moved from North hemisphere to South one.
This task is also rather "
The
z;_{n}
y_{n-1};
where z - coordinate of satellite at n^{th} step of calculation. Since z > 0 at North hemisphere and z < 0 at South we have following condition of Equator intersection.
The
## 4.2.6 Generation of document
In this sample actual function Besides calculation, any software needs generation of documents. Facilities generation of documents are exhibited on forecast problem. Forecast document contains parameters of satellite motion in times of equator intersections. The following picture explains the forecast problem:
Satellite moves along its orbit. Parameters of motion correspond to the time when it moves from South to North and intersects equator. Satellite intersects equator when its
The
The
The
The Meaning of parameters of this component is contained in comments:
And at last,
The 86 400 number is number of seconds in a day. The
And at last,
These properties have the following meaning. Output is performed when condition variable is ```
<Root>
<Parameters>
<Parameter Name="T" Value="Monday, June 28, 1999 11:17:05 PM.457" />
<Parameter Name="X" Value="-6595.47050815637" />
<Parameter Name="Y" Value="-2472.05799683873" />
<Parameter Name="Z" Value="0" />
<Parameter Name="Vx" Value="-0.541295154046453" />
<Parameter Name="Vy" Value="1.46945520971716" />
<Parameter Name="Vz" Value="7.45051367374592" />
</Parameters>
<Parameters>
<Parameter Name="T" Value="Tuesday, June 29, 1999 12:55:08 AM.068" />
<Parameter Name="X" Value="-7026.76544757067" />
<Parameter Name="Y" Value="487.053173194772" />
<Parameter Name="Z" Value="0" />
<Parameter Name="Vx" Value="0.117122882887633" />
<Parameter Name="Vy" Value="1.56173832654579" />
<Parameter Name="Vz" Value="7.45055871464937" />
</Parameters>
<Root>
```
The first parameter has ```
<xsl:stylesheet version="1.0" xmlns:xsl=http://www.w3.org/1999/XSL/Transform
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:user="urn:my-scripts">
<xsl:template match="/">
<html>
<body>
<p>
<h1>Forecast</h1>
</p>
<xsl:apply-templates />
</body>
</html>
</xsl:template>
<xsl:template match="Parameters">
<p></p>
<p>
<table border="1">
<xsl:apply-templates />
</table>
</p>
</xsl:template>
<xsl:template match="Parameter">
<xsl:apply-templates />
<tr>
<td>
<xsl:value-of select="@Name" />
</td>
<td>
<xsl:value-of select="@Value" />
</td>
</tr>
</xsl:template>
</xsl:stylesheet>
```
This XSLT code provides the following HTML document.
## 4.2.7 Short instruction## 4.2.7.1 Unpack following archive## 4.2.7.2 Installation of audio files
Installation of audio files includes following steps.
## 4.2.7.3 Installation of containes
Copy ## 4.2.7.4 Start animation
Start
## Points of InterestMy chief told me: "Do not read smart books. If you continue your reading then you shall have a lot of ill-wishers." Chief was quite right. Really a had a lot of ill-wishers. However I continued reading of smart books. |