## The incredible machine- Download Aviation project source code - 1.86 MB
- Download Aviation + Control Systems project source code - 2.03 MB
- Download Category Theory project source code - 983.44 KB
- Download Astronomy Express project source code - 2.52 MB
- Download Imported Trajectory project source code - 131.58 KB
- Download Dynamical Atmosphere project source code - 196.94 KB
- Download Gravity project source code - 185.89 KB
- Download Aggregate Library project source code - 855.44 KB
- Download Asrtoframe project user guide - 1.94 MB
- Download Category Theory project user guide - 467.03 KB
- Download installer of Hipparcos and Tycho catalogue of stars - 121.6 KB;
- Dowlload automation equipped working place source code - 770.03 KB
Other useful resources: - Universal Framework for Science and Engineering homepage
- Visual C# Express Edition
- Sql Server Express
## 1. IntroductionI have found that I can easy resolve very complicated science and engineering problems using my software. But it is very difficult to teach others. I am trying different methods of teaching. One of them is "live parallel" with well known software. Here I describe live parallel with The Incredible Machine. I do not need dithyrambs. I am looking for readers which have strong interest to my ideas. My ideas are not fast-food. My articles are also my excercises explanation of my ideas. And feedback of readers is are very helpful. So I am writing this article in real time mode ## 2. BackgroundI find that The Incredible Machine very useful game. When I was a child I did not have computer. But I had constructed Grandiose Projects in my mind. These projects were very close to The Incredible Machine tasks. These tasks were not realistic. Then I had learned math, physics and could solve realistic tasks. My software is realistic. But I also is being use unrealistic samples for teaching. Although The Incredible Machine is not realistic it is very useful for education. Here I will compare my software with The Incredible Machine. ## 3. Common features of Framework and The Incredible Machine## 3.1 Qualitative variety of phenomenaThe Incredible Machine contains a large qualitative variety of phenomena. It includes geometry, mechanics, electricity, pneumatic, explosions and even psychology of animals. A lot of advanced engineering software do not contains such variety. For example LabVIEW contains a lot of components, but LabVIEW do not have mechanical components. Similarly the Framework has mechanics, electricity et cetera. ## 3.2 Interaction of phenomenaThe Incredible Machine has interaction of phenomena. For example, if a ball is close to fan than air flow acts on the ball. Typical Framework example is an action of Earth's magnetic field on spacecraft motion. ## 3.3 Declarative approachFor simulation of air flow action on ball we need set ball position only. We do not need following imperative: "Flow, act on the ball". Action is provided implicitly. The same words we can say about action of Earth's magnetic field on spacecraft motion. ## 3.4 Relation to Grandiose ProjectsGrandiose Project has a lot of qualitatively different phenomena. For example if electrical device is near heat source then electrical processes depend of heat. So there is interaction between phenomena. Declarative approach makes software development robust and easy. ## 4. Difference between Framework and The Incredible MachineThe incredible machine devoted to unrealistic phenomena only. The Framework is used for complicated science and engineering problems. ## 5. Getting StartedThis article will become really interesting when I will fulfill it by samples. I am writing it mostly at weekends. And first sample will appear in next weekend. One objective of this article is research of popularity. This article does not contain any code yet. But current number of visits is my own record. I think that such popularity caused by article name. But I strictly comply following CodeProject rule: "Article should contain code". I think this rule do not contradicts my research. Moreover other members of CodeProject can enlarge their popularity by usage of good article name. I find that it is not interesting write article about soft that was developed later, since the Framework can resolve unpredictable tasks. So I will be thankful to reader who asks me to resolve unpredictable task. It would be a good test for the Framework. Maybe I will include some of suggested tasks into this article. If one of readers would construct a sample of incredible machine then it would be excellent. I shall include this sample into this article. I had constructed incredible machines many years and do not have very interest for this occupation. I would like that another developers be able construct incredible machines. ## 5.1 Kinematics## 5.1.1 Very simple sampleThis sample is "Hello world" of the Framework. It is presented in following picture:
We have a point Kinematics is defined by Math object. It has following
properties:
Derivation order is equal to 1 for calculation of relative velocity.
The
This means that
The Measurements object measures parameters of Red curve indicates relative distance and blue one indicates relative velocity ## 5.1.2 Sample with medium frameKinematic picture of this sample is presented below:
We have three frames. The frames are named as
The The Medium frame has following properties:
These properties mean that relative coordinates of
Properties of Motion are the same as in chapter 5.1.1. Arrows between
Red curve is relative distance and blue one is relative velocity. Note that differentiation of distance is implemented implicitly. We only put frames and automatically obtained distance derivation. The Framework performs symbolic differentiation. But differentiation is performed implicitly. Formulas do not contain functions which are presented in above charts. These charts are defined by relative positions of frames. But engineer have a lot of other problems which are outside calculation of explicit dependencies. ## 5.1.2 Sample with rotated frameReaders. Excuse me please during construction of next sample I has found a bug. The bag is fixed. If you have already downloaded Aviation project you should download it once again. The Framework is being continuously developed. Previous samples have been tested. Kinematics of this sample is presented below:
This sample contains four frames. Properties of their coordinat systems are presented below:
where
It means that
Following chart presents relative motion of
Writing temp of this article is very slow. But my experience tell me that understanding of my ideas is more slow. Readers which have strong interest to my ideas can download above samples and try to develop other. I will accept any questions and suggestions. Wait next weekend. ## 5.1.3 A complicated set of framesSet of frames can be more complicated. Complicated set of frame is presented below:
The framework diagram which correspond to this set of frames is presented below:
Now we can calculate relative distance and velocity between frame
This sample can be regarded as too artificial. But I know a lot of engineering problems with similar configuration. Reader can find these samples in my articles Virtual Reality at Once and "Control systems. Processing of signals" ## 5.1.4 Trajectory importToday (02/07/2008) I have received a message about lack of code. Thanks. Indeed this article is not interesting without code samples. So I have prepared a little code for this article. You can download it:
This code is used in framework for kinematics. Third party software is used by
/// <summary> /// Names of objects /// </summary> string[] IObjectFactory.Names { get { return new string[] {"Complicated Trajectory"}; } } /// <summary> /// Gets object by name /// </summary> /// <param name="name">Name of object</param> /// <returns>The object</returns> ICategoryObject IObjectFactory.this[string name] { get { return new ComplicatedTrajectory(); } }
The /// <summary> /// Calculates trajectory parameters /// </summary> /// <param name="input">Input parameters</param> /// <param name="output">Output parametres</param> void IObjectTransformer.Calculate(object[] input, object[] output) { // Input extraction double a = (double)input[0]; double b = (double)input[1]; double t = (double)input[2]; // Calculation double x = a * t; double y = x * t; double z = y * t; double phi = Math.Atan(b * t); double Q0 = Math.Cos(phi / 2); double Q1 = 0; double Q2 = 0; double Q3 = Math.Sin(phi / 2); // Output filling output[0] = x; output[1] = y; output[2] = z; output[3] = Q0; output[4] = Q1; output[5] = Q2; output[6] = Q3; }
This code calculates parameters of trajectory. The
The
One of properties is *.dll filename. Second one is object name. Note that *.dll
is saved in file *.cfa and then project does not depend on initial *.dll file
existence. Full diagram enable us to define
Red, blue and green curves a relative ## 5.2 DynamicsRealistic mechanics requires differential equations of dynamics. The framework has differential equatioins' component. This component can be used for mechanics. Here we consider a set of samples. ## 5.2.1 Mechanical oscillatorThis sample is classical. It is presented below:
This sample is described by following differential equations:
d
d
where x is coordinate and v is velocity. The "-b
Here the
We have damping oscillations as it have been expected. ## 5.2.2 JumpThe incredible machine contains jumps. Adequate realistic description of jumps provides Dirac delta function. The framework has it. Framework sample of oscillations with jump is presented below:
The Jump object contains Dirac delta function:
So we have jump at following charts:
At this chart red curve is a distance and blue curve is a velocity. The distance is a continuous function. But its derivation (distance) has a point of discontinuity (Jump) as it has been expected. ## 5.2.3 Realistic Sample. Earth artificial satelliteHello everybody. I have updated source code of Aviation project ad uploaded it. Let us consider realistic sample. Earth artificial satellite had already been considered in article 6 and atricle 12. Here I would like to compare imperative approach with declarative one. This sample requires import of third party software (external libraries). The Asrtoframe project user guide (1.94 MB) contains import instruction. Also reader can download source code of third patry software: The task is presented in following picture:
We have a ## 5.2.3.1 Imperative approachImperative picture is presented below:
The
The
Result of simulation is presented in following charts:
These charts show relative distance and relative velocity respectively. ## 5.2.3.2 Declarative approachThe picture of declarative approach is presented below:
This picture do not contain explicit formula of distance. Instead we have
reference frames. The
This coordinates are equal to coordinates of
Every chart contains two curves which correspond to
## 5.2.4 Mechanics and differentiability. Declarative approach once again
Differentiability has important role in mechanics. However engineer should not
be too overloaded by differentiability issue. A lot of work should be performed
declaratively. Let us consider following mechanical task. We have a moved object
and its coordinates are time functions
In these equations F, _{y}Fcan be discontinous. But _{z}
V, _{x} V,
_{y}Vare continuos with discontinous derivations. Functions
_{z} x(t), y(t), z(t) are twice differentiable with
discontinous second derivations. Let us consider how framework operates with
differentiability. Suppose that we would like to solve following system of
differential equations:
Here
Solution of this problem by framework is presented below:
Here
Now we would like consider
Here
If we try to define third derivation of x, then exception will be thrown. Test result is presented in following picture:
Red curve is x(t), green and blue curves are its first and second devivations respectively.
## 5.3 Physical fieldsPhysical fields are implemented abstractly. It enables us use them in radiophysics, magnetism, pneumatics. Moreover physical fields provides advantages of declarative approach. Development becomes more laconic. Let us consider some examples. ## 5.3.1 PneumaticLet us consider a "Fan and Ball" sample:
We have
This picture has three parts: ## 5.3.1.1 The FanFan has a reference frame (Field Frame) and physical field (3D
Field). The field is strongly linked with frame:
The 3D Field has following properties:
Field parameters can have different types. Here field parameters are Field
Result.Formula_1. It means that parameters are provided by Field
Result object. Formula_1 provides 3D vector. So we have vector
field. The field has "Covariant" flag. Following picture explains meaning of
this word.
If 3D vector is not covariant then its components depend on sensor position only. Covariant vector components depend on both orientation and position. Values of components are projections of geometric vector to sensor's axes of reference. The picture above presents two orientations of sensor: blue and green. Projections of field vector A are different for these
different orientations. Besides covariant vectors Framework supports covariant
tensors. Such
tensors can be used in Gravimetry. The Field Result object
properties are presented below:
Right pane shows that types of k and x are `Double`
and `Double[3]` respectively. So kx is scalar - vector
product. It this formula is used by 3D Field. The x is
relative vector and k is wind rose coefficient defined by formula
where phi is angle between reference line and
. ## 5.3.1.2 Bridge
Bridge contains common ## 5.3.1.3 The BallConfiguration of the Ball is presented below:
The ball has reference frame ( ## 5.3.1.4 Declarative approach
Declarative approach enables us simulate a lot of properties by changing of few
parameters. For example we can change orientation of
These orientations are defined by transformation matrix. Change of orientation results to following change of the Ball trajectory. You can compare two charts below:
These charts shows time evolution of ## 5.3.2 Dipole radiation + KinematicsHere we use kinematics picture which is considered in 4.1.2. Besides kinematics we will consider dipole radiation. Full picture is presented below:
We have three parts: Dipole, Bridge and Receiver. Let us describe them. ## 5.3.2.1 Dipole
Dipole uses kinematics which is used in 4.1.2. The
Here
The
These components are ## 5.3.2.2 Bridge
Bridge contains the ## 5.3.2.3 Receiver
Receiver contains
Here In result we have following receiver signal:
Let us provide its qualitative explanation. First of all we have amplitude peak. Also we have monotone decrease of frequency. These phenomena can be explained by motion. Motion chart is presented below:
Red curve is distance between field source and receiver. Blue curve is relative velocity. Amplitude peak is caused by distance extremum. Monotone decrease of frequency is caused by monotone increase of relative velocity. ## 5.3.3 Dipole radiation + Kinematics + Envelope detectorLet us add to previous situation envelope detector. The envelope detector can be implemented by following circuit:
This circuit is simulated by the following way:
The
where .
The
Following chart shows result of envelope detector:
Red curve is output of ## 5.3.4 Dipole radiation + Kinematics + Frequency detectorFrequency dectector can be implemeted by usage of high-pass filter. Scheme of filter is presented below:
Filter has following transfer function:. Frequency response and phase response of the filter are presented below:
Following scheme is used for amplitude variation compensation:
This scheme contains envelope detector (see 5.3.3). Result of scheme bottom branch is divided by output of envelope detector. The framework picture of frequency detector is presented below:
Left part contains envelope detector (see 5.3.4). Right part contains high-pass
filter (
Such behavoir of frequency can be easy explained by following chart of relative velocity:
Reader need Aviation + Control Systems project for this sample: ## 5.3.4 Dipole radiation + Kinematics + Phase detectorHere we consider application of phase detector. Situation is presened in following picture:
Dipole radiator (
where I, _{yy }Iare correlation integrals which can be calculated by the following way:_{xy }
where Calculation is divided on two steps. First step is simulation and recording of signals. Second step contains calculation by correlation method. ## 5.3.4.1 Simulation and recordingConfiguratiton of this step is very similar to configurations whis was considered in 5.3.2 and 5.3.3. But here we have two receivers istead one. Fragment of the situation is presented below:
Every receiver has own reference frame (
Red curve is signal of ## 5.3.4.2 Calculation by correlation methodCalculation scheme is presented below:
Left part squares contain recorded signals. Red/Blue curve is signal of first/second receiver. Recursive element calulates necessary integals. Right object calulates cosine of phase difference. In result we have following chart of the cosine:
It is clear that this chart corresponds to considered kinematics. If we multiply
This result is evident. ## 5.4 RegressionNonlinear regression in statistics is the problem of fitting a model:
to multidimensional
Top part of this picture contains selection. Left part contains 4-degree polynomial model, right part contains 5-degree one. The residuals of 5-degree model is less than 4-degree one. It is presented in following picture:
Blue curve is 4-degree polynomial approximation and red curve is 5-degree
polynomial approximation. The 0.383037446029811 of ## 5.5 Algebraic topologyAt the beginnig of XX century General relativity and Quantum mechanics had being factastic ideas reather reality. But these brunches of science are everyday engineering tools now. Present day theoretical physics operates with XX and XXI centuries math. This math includes algebraic topology. Scientist and futurist Dr. Michio Kaku told about making what was once considered impossible technology into reality. I had begun implement this idea. Category Theory project is devoted to this purpose. I know a lot of cases when General Relativity and Classical Mechanics had been used in the single project. So I think that kinematics, dynamics, field theory and algebraic topology should have universal software framework. Framework should be common for all branches of science. Algebraic topology could not be undrestood at once. This chapter is rather inspiration. Reader need Category Theory project and its user guide: - Download Category Theory project source code - 983.44 KB
- Download Category Theory project user guide - 467.03 KB
Here I would lilke define some invariants of space
## 5.5.1 Calculation of homologyHomology can be calculated by chain complexes. These complexes are presented below:
Chain complexes of projective space and Klein bottle are well known. We would like calculate it for direct product. Chain complex of Klein bottle is presented below:
Framework represents this chain complex by following way:
Chain complex of projective space is presented below:
Properties of objects and arrows of this diagram can be edited by right mouse
click on squares. So let us calculate homology groups of
Top complex is complex of Klein bottle. Bottom complex is complex of projective
space. Gray squares
Now we have chain complex of
Now we can calculate homology of
Top complex is chain complex of ## 5.5.2 Homology with coefficients in Z/2ZHomology with coefficients can be calculated by application of tensor product functor . Calculation scheme is prezented below:
Top complex is chain complex of ## 5.5.3 Calculation of cohomology
Cohomology
can be calculated by application of Hom(
Left square represensts ## 6. Advanced Sample. Controlled spacecraftA spacecraft is a very good example of the incredible machine. It has a lot of systems and aggregates. The picture belows presents Mir orbital station:
This station is a subject of History. But building blocks of the framework enable us construct new spacecrafts and orbital stations. The station is a very complicated mechanical object. It is not rigid body. It has solar cell panels. These panels are elastic. The station is stabilizied by gyros. Moreover station configuration is not constant. I had already considered mechanical aspects in article 9. This chapter contains interoperability of mechanics and other phenomena. ## 6.1 MechanicsWe will use aggregate designer for mechanics simulation. Why aggregate designer? Indeed mechanical equations are well known long time ago. But software development for simulation of complicated mechanical objects is not quite easy task. Aggregate designer make this task much easier. Aggregate designer is integrated into framework. This fact enables us provide interoperability of mechanics with physical fields. So it is easy to simulate action of magnetic fields on mechanical objects. I will consider this task below. Now we would like to create mechanical model of spacecraft from models of its modules. Typical spacecraft module is schematically presented below:
This module has own coordinat system - Radius vector
*r*; - Velocity
*V*; - Orientation quaternion
*Q*; - Angular velocity .
But module is not rigid in general. And these parameters are not parameters of
module. These parameters are rather parameters of one point of module. In this
article we suppose that these parametres are parameters of origin of i=
1,...,n). Instant state of module is defined by following parameters:
I will call them state variables. Parameters:
will be called accelerations. Mechanical equations define accelerations by state parameters. Accelerations near connecton can be defined by following way:
where
Both modules have equal acceleration near connection. First module acts to
second one by force
are well known. Mechanical equations of module can be represented by the following way:
In these expessions accelerations are independent variables. F i- h
connected module. Other vector and matrix parameters denend on state variables.
Adding following evident expressions:
results to linear by accelerations system of equations. This system enables us
to find all acceleratios. So we have mechanical equations. It is worth to note
that this system is redundant. If There are a lot of module types. Prorammatically all of them implement following interface: /// <summary> /// Aggregable Mechanical Object /// </summary> public interface IAggregableMechanicalObject { /// <summary> /// Number of degrees of freedom /// </summary> int Dimension { get; } /// <summary> /// Number of connections /// </summary> int NumberOfConnections { get; } /// <summary> /// State of object /// </summary> double[] State { get; } /// <summary> /// Internal acceleration /// </summary> double[] InternalAcceleration { get; } /// <summary> /// State of connection /// x[0] - position, x[1] - quaternion, /// x[2] - linear velocity, x[3] - angular velocity /// </summary> /// <param name="numOfConnection">Number of connection</param> /// <returns>State of connection</returns> double[] this[int numOfConnection] { get; set; } /// <summary> /// Calculates transformation matrix from genrealized coordinates to /// acceleration of connection /// </summary> /// <param name="numOfConnection">Number of connection</param> /// <returns>The transformation matrix</returns> double[,] GetAccelerationMatrix(int numOfConnection); /// <summary> /// Gets matrix of forces /// </summary> /// <param name="numOfConnection">Number of connection</param> /// <returns>The matrix of forces</returns> double[,] GetForcesMatrix(int numOfConnection); /// <summary> /// Gets internal acceleration /// </summary> /// <param name="numOfConnection">Number of connection</param> /// <returns>Internal accceleration</returns> double[] GetInternalAcceleration(int numOfConnection); /// <summary> /// Gets connection force /// <summary> /// <param name="numOfConnection">Number of connection</param> /// <returns>Connection force</returns> double[] GetConnectionForce(int numOfConnection); /// <summary> /// Children objects /// </summary> Dictionary<IAggregableMechanicalObject, int[]> Children { get; } /// <summary> /// The is constant sign /// </summary> bool IsConstant { get; } /// <summary> /// Parent object /// </summary> IAggregableMechanicalObject Parent { get; set; } } I will consider samples of modules below. Here I describe this interface. Meaning of this interface members is presented in following table:
So this interface reflects parameters of above formulas. These parameters
contains necessary information for aggregate construction. It is worth to note
that if matrix of linear equations is constant then we can invert it one time
and this fact enable us simplify solution Therefore this interface has ## 6.1.1 Aggregate libraryComplicated spacecraft a lot of aggregates. Software models of these aggregates should be developed by different specialists. These software models should also reflect phenomena which do not belong mechanic domain. I has developed simple aggregate library especially for this article. Here I describe it. ## 6.1.1.1 Rigid bodyEquations of rigid body are well known and I will not present them here. Rigid body of this library has variable number of connections. Its editor of properties is presented below:
We can change number of connections their positions and orientations. ## 6.1.1.2 Elastic consoleElastic console body is a mechanical system of infinite degrees of freedom. Usually math model of this object contains finite degrees of freedom with finite set of valuable harmonic oscillations. Every harmonic oscillation can be described by following second order system of ordinary differential equation:
We can edit number of harmonics and their properties. ## 5.1.1.3 AggregationWe have to types of objects. Let us aggregate them. This operation looks like:
Properties of
It means that first connection place of
## 6.1.1.4 Vibration testing. Regression once again
Technological processes have defects. So we need tests of our details for
identifiation of their properties. Here
vibration
testing of elastic console is presented. This is passive vibration testing.
We have a sensor which measures following value:. Here a is are unknown constants. These constants are called
nuisance variables. These variables should be also identified. Vibration
test proessing is presented below:_{i}
The
Left part means that we would like identify parameters
Now ## 6.1.1.5 Rigid body with vector interface"Rigid body with vector interface" component provides vector representation of external forces and momentums. This representation is more laconic. Here I show a sample of this representation. The sample is devoted to "Sputnik - 1" spacecraft. The "Sputnik - 1" mission is "it just works". Therefore it was unconrolled. It has own magnitic momenum caused by equipment currents and other factors. So it was forced by Earth's magnetic field:
Let us consider simulation of this satellite. Linear motion of artifical satellite nad already been considered in 4.2.3.1. The Greenwich reference frame had been used. Here I consider usage of inertial reference frame. It is more convenient for some tasks. Relation between these reference frames is shown at following picture:
The in inertial
reference frame has two features. Satellite coordinates with respect to gOXYZ
are not equal to coordinates with respect to OX'Y'Z'. Moreover
projections of on gOXYZ axes of coordinates
are different to projections on OX'Y'Z' axes of coordinates.
Declarative approach enables us to resolve both problems at once. Usage of
covariant fields provides solution of both problems (See 5.3.1.1). Simulation of
linear satellite motion is presented below:
Here Above picture is not convenient for further development since it contains a lot of squares. Some of squares should be encapsulated. Following picture shows container designer which provides encapsulation:
User checks public components on left panel and sets their positions on right panel. In result we have little black squares instead big squares. Only public components are visible and we can identify them by tooltip texts. Some of aerospase tasks require Earh's magnitic field. Let us develop new component that includes Earh's magnitic field. Design of this comopnent is presented below:
In this picture we have early developed model of spacecraft motion and model of
magnetic field (
Now we can simulalte motion action of magnetic field on uncontrolled spacecraft:
The
Here we have cross product of
This picture means that - Download this sample - 104.04 KB
- Download design of component of spacecraft motion model in inertial reference frame - 37.89 KB
- Download design of spacecraft with magnetic field component - 39.69 KB
## 6.1.1.6 FlywheelFlywheels are used in spin stabilization systems of spacecrafts. Following documents contain informaion devoted to spin stabilization systems: - http://www.freepatentsonline.com/3767139.html
- http://www.aiaa.org/content.cfm?pageid=406&gTable=mtgpaper&gID=58741
- http://adsabs.harvard.edu/abs/1966CosRe...4..173A
Flywheel is forced by reversible engine (See piture below).
Otherwise flywheel acts to engine by momentum M. Gyro momentum can be
calculated by following expression:_{gyro}
where M;
Gyro momentum is undesirable factor. Stabilization system should require
following condition |_{gyro} M| << |_{gyro}M|.
However since engine acts to flywheel value of
is being inreased by the time. Increasing of
compensated by other devices which acts to spcecraft. In this article
eletromagnetic devices will be considered. Previous components did not
essentially use function _{x} `GetConnectionForce` , since forces and
momentums was trivial. Return of this function was zero vector (array). But
return of this function in Flywheel component contains notrivial total momentum.
Whole stabilization system need know angular velicity of flywheel. So flywheel
component implements IMeasurements interface which provides measure of angular
veloity. Typical sample of flywheel usage is presented below:
In this example Flywheel. The angular velocity of Flywheel
is used by Output.
## 6.1.2 Mechanical model of controlled spacecraftIn this article spececraft with two consoles and three flywhells is considered. Its construction is presented below: Numbers 1 - 5 are numbers of connections places of spacecraft. Flywheels attached to 3, 4, 5 connection places realize angular stabilization of spaecraft with respect to axes X, Y, Z. Besides flywheels spacecraft containts three electromagnets for stabilization. Mehanical model of spacecraft is presented in following picture:
Nunmbers 1-5 of links are numbers of spaceraft connections. Components of this
model had been included into single container as well as components of linear
motion model (See 5.1.1.5):
## 6.1.3 Vibration test of spacecraftVibration tests provide identification of mechanical model. Let us consider following vibtration test:Hydraulic cylinders impact on spacecraft. In result spacecraft is forced by momentum. The PID control law of momentum has been used: Where M is mechanical momentum,
is X
- pojection of spacecraft angular veloctity, of spacecraft, is
rotation angle of spacectaft with respect to X - axis. Parameters _{x}K_{1},
K_{2}, K_{3} are constants.The test purpose is
definition of spaceraft transformation function. Its definition can be obtained
by response on harmonic input. The chirp input singnal has been used:
Followig scheme has been used for simulation of vibration test: Top squares of this scheme provide necessary formulas. The Recursive
component calculates integral for PID control. Response of consoles and
spacecraft is presented below:
Response of console has two strong resonance peaks. This situatioon is typical for space technology which use light weight constructions. However these resonances made control task very complicated. Resonances of consoles impact on spacecraft motion. Above pictures shows this impact. This sample requires usage of containers. ## 6.2 Space aerodynamicThe key feature of space aerodynamics is that spacecraft interacts with molecules which do not collide with each other. Therefore aerodynamic force depends on visible area and does not depend on other parameters of spacecraft shape. We can use digital image processing for space aerodynamic calculation. Digital image processing for science and engineering has been considered in my article 8. Let us consider it for space aerodynamic. I had bad feeling that this article contains photo of Mir station but the photo is not used. Now the photo is used for calculation of space aerodynamic by following way:
Reader can compare
Now we can obtain visible area by counting of white pictures on - Download Astronomy Express project source code- 2.52 MB
- Download Aerodynamic Image Processing sample - 566.49 KB
## 6.3 Celestial NavigationClassical feedback control scheme is presented below:
It requires sensor. We use astrosensor for spacecraft control. Asrtosensor enables to define orientation of spacecrafts. There are a lot of types of astrosensors. I provide one of possible shemes. Suppose that we have equipment that provides celestial images and star catalogues. Comparation of image and catalogue enable us to define orientation of equipment. So we can define orientation of spacecraft. Algorrithm of this sensor is presented below:
Left part of this scheme contains image processing. Right part represents usage of star catalogue. Brigde compares both of them and in result we have parameters of spacecraft orientation. Let us consider details. ## 6.3.1 Image processingSuppose that equipment provides following celestial image:
This image contains interfering information. We need filtration for its exclusion. Nonlocal digital image processing is being used for this purpose. Sheme of this prosessing is presented below:
This scheme contains
Following picture explains filtration algorithm:
If we have 9 closed white pixels then we replace it by one blak pixel. Every
other pixels are white. Result of filtration enables us to obtain X and Y
coorginates of black pixels. Then this numbers will be compared with star
catalogue. The ## 6.3.2 Star catalogue usageStar catalogue is stored in database. Necessary information can be extracted by Sql qurery:
Query statement is presented below: ++++++++++++++ SELECT RAdeg, DEdeg FROM hip_main WHERE RAdeg > @RAMIN AND RAdeg < @RAMAX AND DEdeg > @DEMIN AND DEDeg < @DEMAX AND BTmag > @BTMIN ORDER BY RAdeg ++++++++++++++ This statement has following meaning. First of all we consider limited area of sky. Declination and right ascension belong to small intervals. Secondly we consider only susch stars which magnitudes exceed defined constant (in this sample the constant is equal to 9). Qurey result provides following chart:
We would like compare this chart with filtered image. This operation requires a set of math transformations. Full scheme of these transformations is presented below:
Essential feature of these transformations is euclidean transformation:
Parameters a, b, and are unknown. Comparation of star catalogue and filtered image enable us to define these parameters. Using these parameters we can define orientationn of spacecraft. This sample requires Sql Server Express and Astronomy project. It also requires star Tyho and Hipparcos star catalogue that reader can download: - Download installer of Hipparcos and Tycho catalogue of stars - 121.6 KB
- Download this sample - 177.75 KB
## 6.4 Development of control system## 6.4.1 IdentificationDevelopment of control system requires math model of controlled object. This model will be obtained by processing of vibration test. Here nonparametric and parametric identification will be considered.## 6.4.1.1 Nonparametric identification. Envelope detector once again. Phase detector once againThe natural way for obtaining transfer function is usage of envelope detector and phase one. This theme has been considered in 5.3.4 and 5.3.3. You an download modifications of this detectors adopted to recorded singnals:Frequency responce and phase characteristics are presented below:
## 6.4.2.2 Parametric identification. Regression once againIn this section transfer function of object will be obtained. Control systems specialists use logarithmic scale for frequency resopnce. This function provides clear picture of control object. So we transform functions of previous sections to logarithmic scale. In result we have following charts:
The Y- axis of frequency resoponse is also logarithmic. Control system specialist that such chars correspond to following transfer function: Parameters k, a, b, d, f, g,
h, l, m can be defined by nonlinear regression.
Regression scheme is presented below:
Charts in the left part of this picture represents approximated functions (Frequeny responce, sine and cosine of phase). Other squares contain necessary math. In result we have following approximation of our charts:
## 6.4.2 Double-loop stabilization system
Stabilization system could not use flywheels only (See 6.1.1.6). Otherwise there
is an obstacle for constuction of stabilization system which uses electromagnets
only. Electromagnetic momentum is always perpendicular to magnetic induction
We use celestial navigation
for definition of orientation and
optical gyroscope for definition of angular velocity. In result we have
following parameters
. First three parameteres are angle deviations with respect to
desired axes Second loop scheme is presented below:
This loop purpose is limitation of flywheels' angular velocities. Sensor of this
loop are tachometers
of flywheels. Necessary momentum is provided by eletromangets
. It is possible to use different control laws for this loop.
But main idea of these laws is single In this article I have used following
control law. Let be H. But
electomagets are not always switched on. If |_{gyro}H| is too
small then electromagnets are switched of. Otherwise if angle between Earth's
magnetic induction Hgyro and _{gyro}H is too small then
electromagnets cannot provide substantionally large momentum that is opposite
_{gyro}H. Therefore if angle between _{gyro}H
and _{gyro}B is too small then electromagnets are also switched off. Since
action of electromagnets is not contionous I name this loop low frequency loop.
Here I explain how magnetic momentum reduces angular velocities of flywheels.
Magnetic momemtum causes deviation of spaceraft orientation. High frequency loop
tries to eliminate this deviatrion by changing of angular velocity of flywheels.
High frequency loop tries to eliminate this deviatrion by changing of angular
velocity of flywheels. Since electromagnetic momentum is opposite to
This picture corresponds to following situation:
In this picture we have complicated spacecraft with electromagnets which interact with Earth's magnetic field. Geometrical picture is presented below:
The X,Y,Z is Greenwich reference frame and X', Y', Z' is inertial
reference frame. Center of X', Y', Z' coinsides with center of Earth. We also
have X", Y", Z" reference frame. Center of this frame coincides with mass center
of spacecraft and axes X", Y", Z" are collinear to X', Y', Z'. We also have
desired reference frame of spacecraft X
Spacecraft body is instance of reference frame. It is X
The
The X
But we do not simply require it. This requirement should not contradict with
structure of
Components Q
Parameters
Flywheels are consumres of data. They are being use high frequency loop output by following way:
However flywheels are not data consumers only. They are data provides. Their output data are their (angular) velocities. This output is being used in low frequency loop by the following way:
This output and output of Sensor is used for geomagnetic control. Spacecraft body is not data provider. It is also data consumer. It is being use output of low frequency control loop by the following way:
Following picture shows mechanical momentums of high frequency and low frequency loops:
We have evident correlation between both momentums. Transition processes are presented below:
We also have correlation. ## 6.5 Spacecraft mission. Astronomical observationsTwo telescopes are bieng used for spacecraft mission. The telescopes are installed on spacecraft body:
Left part of this picture repesents simulation of spacecraft motion. Right part repesents mission components. Let us consider these components in details:
Sinse
These properties have following meaning. Star coordinates This sample is animated. Use "Control" pane for its animation. ## 7. GIS Satellite. Web based applicationHere we will consider sample of satellite which is used for Geographic Information System (GIS). Since we are interested in geographical coordinates we will use Greenwich reference frame as well as in 5.2.3. Full model of satellite is presented below:
We have added the
Red and blue curve represent longitude and latitude respectively. Simulation model has been saved in file SatelliteCoordinates.cfa and then this file can be used as resource in other applications. Here this file is used with GIS service. In this article the Environmental Systems Research Institute (ESRI) service has been used. ESRI provides GIS web services. Using these services I have developed following animated WPF demo application:
User can enter initial coordinates X, Y, Z and components of velocity V
## 8. Future. Calibration of optical gyroscopePrevious text is rather history. Now I would like exhibit one of future problems. This problem is described below ## 8.1 RationaleOptical gyroscope can have a lot of applications. For example it can be used in inertial navigation system (INS). Otherwise inertial navigation system can be used for Mars atmospheric reentry. During interplanetary flight to Mars parameters of can be essentially changed by unpredictable factors. Maybe we should calibrate parameters of optical gyroscope. We do not have laboratory at interplanetary spacecraft. So we are looking for other ways for calibration. These ways will be described below. ## 8.2 Research proposalFirst of all it worth to note that usage of optical gyroscope is not necessary right way. If we cannot calibrate optical gyroscope with accepted accuracy then it should be rejected. In this case we should use for example mechanical gyroscope. But mechanical gyroscope can have mass that exceeds mass of optical gyroscope. Power consumption and size of mechanical gyroscope also can exceed corresponding parameters of optical gyroscope. Maybe this research would have negative result. But a lot of venture research also have negative results. So we have proposed venture research and begun to perform it. ## 8.3 Method outlookAny calibration requires independent measurements. Spacecraft can have additional astrosensors. These astrosensors would not be used for gyroscope calibration only. However optical gyroscope defines angular velocity of spacecraft. Astrosensors define its orientation. In case of spacecraft rotation we have dependence between angular velocity and orientation. Qualitative picture of this dependence is presented below:
We have rotated spacecraft. Astrosensor defines its position. Measurements of astrosensor and optical gyroscope enable us to calibrate the gyroscope. ## 8.4 Document structurePresent day software is nonlinear. So it is not easy to undestand using linear documents only. Different types of UML diagrams help us to catch meanig of software structure. Similarly following diagram explains structure of this research.
Every green arrow means usage of theory. Blue arrow means data import. ## 8.5 Theory in brief## 8.5.1 Nonlinear regressionIn statistics, nonlinear regression is a form of regression analysis in which observational data are modeled by a function which is a nonlinear combination of the model parameters and depends on one or more independent variables. The data are fitted by a method of successive approximations. More theoretical details readers can find here. A lot of applications of nonlinear regression are described in following CodeProject articles: - Universal Framework for Science and Engineering - Part 2: Regression;
- Universal Framework for Science and Engineering - Part 4: Space elevator;
- Universal Framework for Science and Engineering - Part 6: Determination of orbits of artificial satellites;
- Universal Framework for Science and Engineering - Part 7: Virtual Reality at Once;
- Universal Framework for Science and Engineering - Part 8: Digital Image Processing;
- Universal Framework for Science and Engineering - Part 10: Research of epilepsy;
- Universal Framework for Science and Engineering - Part 12: Grandiose Projects.
It is clear that nonlinear regeression can be used for optical gyroscope calibration. ## 8.5.2 Sagnac effectSagnac effect is key physical principle of optical gyroscope. Following well known relation is used in this research: Where is angular velocity and U is output signal of optical
gyroscope. Parameters a and k depends on technological
properties of optical gyroscope. These parameters can be unstable and we should
calibrate them. Indeed inertial navigation system contains more than one
gyroscope. Typical inertial navigation system contains three gyroscopes which
are oriented along orthogonal axes X, Y, Z. So we
have three following equations:
Every subscript means axis of hyroscope. Above expressions have inverse ones:
These expressions enable us calculate components of angular velocity. ## 8.5.3 Qaternion applications for rigid body kinematicsFollowing referenes are useful for studying this subject:
A lot of information can be found in my CodeProject articles. If orientation is
described by following quaternion
## 8.5.4 Rigid body dynamicsDynamics of absolutely rigid body is described by Euler's equations. However spacecraft dynamics could not be always described as absolutely rigid body. This article contains a lot of relevant examples Different variants can be considered in single framework. Usage of bridge pattern for spacecraft dynamics is presented in following diagram:
This diagram explains usefulness of bridge pattern in space techonology simulation. We need 7 types of objects instead 12 ones. ## 8.5.5 Random processesSimulating a continuous-time random signal is only used in this research. Simulating a continuous-time random signal can be performed by usage of control theory transfer functions. Other applications of transfer functions are described in my article: "Universal Framework for Science and Engineering - Part 3: Control systems. Processing of signals". ## 8.6 Implementation## 8.6.1 Calibration algorithm## 8.6.1.1 Outlook
Calibration algorithm is based on nonlinear regreesion. Nonlinear regression
have input and output parameters. Input parameters contains output data of
optical gyroscopes and its calibraion parametes. Usage of these parameters
enable us to integrate kinematics equations. In result we have quaternion as
time functions t,
... , _{1}t. In our case dependences output data of optical
gyroscopes is considered as fixed data. Input paramaters for regression contains
calibtation parameters only. Output data contains _{n}q(t_{1}),
..., q(t)._{n}## 8.6.1.2 ImplementationSpacecrafts' design begins from design of payload. So this description begins from component which performs calibration. Later we describe subordinate components. Calibration is performed by regression component . These component has high level of absraction. So it provides high flexibility. Regression component support definition of very different parametres. Input parameters can be also very different. Calibration algorithm scheme implementaion is presented below:
In this scheme regression component is named as
Panels of this properties corresspond to terms of regression
. Left, middle and right panel corresponds to ## 8.6.1.2.1 First branch. Defined parameters
Branch
The framework do not contain Greek idetifiers. So Greek symbols are replaced by
Latin aliases. Mapping between equation symbols and identifiers is reflected in
following comments of
Parameters
Functions U,
_{y}U of Sagnac inverse formulas. Properties of _{z}
omega(x) are presented in following picture:
Properties of
U, _{y}U shall be considered below. First
branch is fully described now._{z}## 8.6.1.2.2 Second branch. Regression function calculation
Roughly speaking first branch is
The
Rougly spaking t. We will
perform following operaions for this purpuse. Indeed _{n}Vector
calculates values of 4D vector Q(t) for fixed time t.
We will transform this calculation to
set-theoretical function Q. The Accumulator
performs this transformation. Properties of Accumulator are
presented below:
These properies mean that time function is being calculated from time = 0 with
step = 0.01. Step count is equal to 1800. The .
In fact ## 8.6.1.2.3 Third branch. Seletions (Experimental data)
Selections data should be independent from first and second branches. In these
case selections are contained in ## 8.6.2 Definition of realistic angular velocityCalibration accuracy depends on partial derivatives of measured parameters with respect to calibration ones. It is clear that these derivatives depend on angular velocities as time functions. So we need do define realistic values of the angular velocities. We would like to separate definition of angular velocity from calibration algorithm. This separation is in fact a version of the bridge pattern.
This scheme enables us construct 9 combinations from 6 objects. Since there are a lot of spacecrafts' types and a lot of spacecrafts' systems and subsystems the bridge pattern usage provides tremendous effect. Here we will consider spacecraft which can be considered as rigid body and values of mechanical momentum can be discrete.
This table has following meaning. Mechanical momentum with respect to
Simultaneous force of engines 1 and 4 results to mechanical momentum with
respect to
Red, green and blue lines on this chart represent M respectively. Let us explain these scheme. The _{y}
and M_{z}Mx,
My and Mz components provide M,
_{x}M functions of time. These functions are
defined by following expression_{y} and M_{z}
This expression has C++ style. It reflects piecewise constant function.
Objects
These functions are being used in
The
Following chart presents time dependencies of angular velocities and measurements of optical gyroscopes
More bright curves on chart present angular velocities and more dark lines present optical gyroscopes' measurements ## 8.6.4 Simulation of random errors of optical gyroscopeWe need error model for estimation of accuracy of our method. Error model of optical gyroscopes will be considered here. In accordance to Bridge pattern error model we have independent error model. The scheme of error model is presented below: This scheme contains generator of random numbers ( Random)
normailizing element (Norm) and filter (Filter).
Normalizing element transforms interval of random numbers from (0,1) to (-1,1).
In result we have centalized sequence of random numbers. The Filter
implements following transformation function:
## 8.6.5 Analysis of errorsHe we develop automation equipped working place of analysis of errors. We have calibration algorithm described in 8.6.1 and algorithm of simulation of random errors (8.6.4). We would like to develop automation equipped working place which used both algorithms. Files Calibration_algorithm.cfa and Angular_Velocity_Error_Model.cfa correspond to calibration algorithm and error model respectively. We use this files as calculation resources. Foolowing picture presents usage of these files as resources.
Then this resources are use looded and are being used in project. Following code: // Loading of resources // Properties.Resources.Calibration_algorithm - file Calibration_algorithm // Properties.Resources.Angular_Velocity_Error_Model - file Angular_Velocity_Error_Model byte[][] bytes = new byte[][] { Properties.Resources.Calibration_algorithm, Properties.Resources.Angular_Velocity_Error_Model }; foreach (byte[] b in bytes) { PureDesktopPeer d = new PureDesktopPeer(); // Loading of resouces d.Load(b); ldesktops.Add(d); }presents loading of resources
Screenshots of automation equipped working place are presented below:
Input of these application contains statistical parameters of input errors an other parameters. Output contains covariance matrix and constant bias. This application is specially developed for this article only. I would like to show how the framework can be used as calculation resource. So I had finished this article since it is too large. But I will continue some themes in my following articles ## Points of interestsI think that my ideas are more important than my code. Otherwise ideas are useless without good explanation. This article is a milestone in explanation way.## HistoryI had written a series of articles about my ideas. Then I have understood that high rating is not objective criterion of my work. For example rating of my article about Category Theory is equal to 4.89. However I do not know even one reader which understands it. But I need understanding. So I had begun to test it. I had installed 5 propeller blades on Apace helicopter. All my articles contain a lot of similar tests. My work will be good only when my tests will be noticed. Then I have decided to inspire negative reaction to my work. This is standard way for better understanding. I wrote special article for this purpose. So "my vote of 1" looks a symphony for me. The best history is written in real time history. I am writing history of this article in real time. One of my readers told me that my example are very complicated for users which are not familiar with Framework. So I decided to include simple samples. Maybe text of this article will be very large. Then I will separate it into parts. Today (01/24/2009) one of my readers has proposed me include pneumatic effect similar to The incredible machine. I shall do it in this article. I also obtained very useful critique. I shall analyze it next week. Today (02/07/2009) I have received message about lack of code. Thanks. I have added relevant sample (part 4.1.4). Abu Mami encouraged me and today (02/19/2009) I had written chapter devoted algebraic topology. Yesterday (04/17/2009) is remarkable data of the framework. I repeated some errors which can cause damage of spacecraft. These errors were not special. They were my own errors. I have experience of damage prediction. But I did not predict such valuable damage as spacecraft destroying. I hope that I will predict very valuable damage. I am being asked: "How can you work so hard?" My standard answer is: "I am taking easy blame." My article have become too large and I have begun write new article. I would like to make refferences to new article. Today (09/07/2009) I have decided to finish this article. Latest editions will contain only bug fixing in code and grammar. ## ProspectsI intend to write a book about my ideas. My recent article "Top-down Paradigm in Engineering Software Integration" is in fact announcement of this book. The draft of book will be shared on my site for discussion. I also promised to write article about meteorology. But I do not know when I will implement my plans. Now I am engaged in obstacles of The Universe collapse.. |