Other useful resources:
Introduction
In my earlier articles I’ve said that every engineer can solve any task using Universal Framework for Science and Engineering. It is clear that the Framework should be extended by the way but it has no obstacles for extension. The Framework is rather a philosophy then a software. This philosophy is based on Category theory. The idea of The Framework is unification as well as idea of Category Theory. I had written an article devoted Category theory and the Framework. Now I understand that any engineering task is not the very purpose of the Framework. The purpose of the Framework is development of Grandiose Projects. This article explains how the philosophy of the Framework can be applied to Grandiose Projects. Lots of Grandiose projects are known in history. But many of them are in fact unknown. For example Pyramid of Khufu project is in fact unknown. According to the opinion of scientists any phenomena is known if and only if we can reproduce it. All present day speculations about this project technology are hypotheses only. Maybe the technology is much more brilliant than all these speculations. I was no close to any Grandiose Project. However I have had a lot of thoughts about construction of Space Rockets. This problem was outside my understanding. If any little element of Rocket can destroy it then how can you construct it. How can you construct a Rocket if you cannot catch physical properties of its elements. Answer of this question I had found in the book The Timeless Way of Building. Christopher Alexander proved that principles of The Timeless Way of Building do not depend of domain. I am sure that the creators of the Pyramid of Khufu and Space Rockets understand this fact. Even I can independently understand this fact. But there is a long distance between understanding and proving. Distance between understanding and description can be much longer. The Timeless Way of Building exists for several millennia but a clear description of this way was provided only in XX century. In fact I explain the same ideas. But my articles have source code and examples. According to my experience of explanation articles with code and examples are much easier to understand then articles without them. I find that CodeProject members are excellent candidates for Grandiose Projects' creators because of following reasons:
- CodeProject members can understand code written by another developers. Volume of code can be very large;
- CodeProject members are full of initiative.
Because of these reasons this article matches to CodeProject. And there is also another one. It is not easy to understand the Framework at once. So this article contains relatively simple samples of Framework extension.
Background
It is well known that Grandiose Projects are not a set of engineering tasks. These tasks are to interoperate with each other. And a project manager should understand all of them. It is clear that manager can not understand them all in details. But he/she is to have such understanding that the whole project can be implemented. Now there are lots of tools for projects managers, software developments, testers of software projects, which support them in their work. I think that the Framework is a prototype of such tool for any type of engineering projects. This article does not reflect all features of this matter. However me and my successors will write new articles about it.
1. Grandiose Project lifecycle
Essential feature of Grandiose Project is that this project cannot be implemented in principle. If a project can be implemented then it is not Grandiose. CodeProject is devoted to implemented code examples. However I think that despite this circumstance this article does not contradict to CodeProject. This article contains code(after its completion) Maybe some readers will try themselves in Grandiose Project. I do not advise my reader to tell to his chief: "I have a Grandiose Idea that cannot be implemented in principle". The reaction of the chief will be quite adequate. It is better try to find a sponsor for the idea. I have personal experience in ideas which cannot be implemented in principle. In principle present day math research requires full time engagement and math education. I do not have both of them. Despite this circumstance I am a researcher in math http://arxiv.org/abs/math/0604508 . So I would like to explain a lifecycle of idea that cannot be implemented in principle.
1.1 Stage 1
A youth has a Grandiose Idea and explain it to his/her chief. After chief’s adequate reaction he/she thinks that his/her chief is not quite right. In this case lifecycle of the idea ends.
Maybe I have received the first low estimates of this article from chiefs who rejected grandiose ideas. I think that these chiefs are quite right. I say: "Thanks" These estimates inspire me to write this text.
But if youth have enough self-critical he/she can to continue development of his/her Grandiose Idea.
Pause: I go to dinner.
This stage can be excluded. If you read this text then you would never introduce a Grandiose Idea to your chief and follow directly to Stage 2 instead.
1.2 Stage 2
This stage cannot be excluded. You should try to convince that the Idea is not pure fiction. It is very difficult task since even you do not know whether the Idea would be implemented.
Lots of people will estimate you as mad. If you cannot listen that you are mad then the Idea could not be implemented.
Grandiose Idea has a lot of paradoxes. It cannot be implemented if you are not self-critical. Otherwise it is "impossible in principle". You should be very accurate. But you should not be afraid of drafts with errors. If potential sponsor notice that you are not quite accurate then he/she would not believe you. Otherwise too much accuracy can stop the Idea.
However courage does not contradict to caution.
At this stage many people will say you that you are mad. You should take it easy.
1.3 Stage 3
This stage is an implementation of the Idea. Since the Idea is Grandiose there is no warranty. However you can obtain a lot of benefits even if the Idea would be failed. For example my engagement by math stimulates my brain. So I can write this article. Although the Framework is not yet a base of Grandiose Project but it contains a lot of useful code. It makes my articles interesting. It inspires people. I use my own biography for inspiration. And have found that it helps a lot of youths.
Pause: I will print text and correct it.
2. Deadlock
Grandiose Project has many invisible obstacles. It should be flexible enough to be able to avoid them. Every software developer knows that a project deadlock is caused by manager who is not familiar with technology. This manager cannot understand what exactly an invisible obstacle is. Every domain has an invisible obstacle. I know a lot of Simulink engineering developments which have had a deadlock. However the beginning of these developments was very successful. Military art knows a lot of deadlocks. Very accurate battle plan is source of defeat. Napoléon Bonaparte had used a several plans of one battle. Then he applied the one which has was most proper for the situation.
In general any domain uses a similar method of avoiding a deadlock. This method is a set of different variants. Software development uses abstraction. However abstraction enables us to provide very large number of variants. Napoléon Bonaparte doesn’t have such number of variants that software development abstraction do.
I’ll now explain how I avoid deadlock in the Framework. The Framework is based on Category Theory. This theory has higher level and generality in math. So the Framework is very stable to invisible obstacles. It was proved by lots of it’s applications. But I am looking for new applications to test Framework’s stability.
Potential deadlock was contained in Framework formula editor. This editor has a very slow interpreter. Since the very beginning I’ve had an understanding that a little performance of formula editor would occur a deadlock. But I know that I will avoid this deadlock in future.
In part 11 you can find this deadlock resolution by CodeDom Optimizing Compiler.
Another deadlock was found in an adoption of Parallel Computing in Quantum Chemistry project to the Framework. This project contains parallel computing by a set of processors. According my opinion parallel computation should have an abstract level. Now it can be implemented in multi core. But it is possible that next generations of computers will have other types of parallelization.
But recently I have found one potential deadlock in the Framework. The Framework itself is not accepted by domain specialists. Anyway I have found the following deadlock resolution: a conversion of Framework developments to the languages which are well known to domain specialists.
During the writing of this article I’ve decided to write one example the way to avoid a deadlock. I’ve had a lot of developments with high level of responsibility. But this text can estimate me as an adventurer. However it is very easy to avoid this deadlock. First of all I am very accurate in technical documentation. I am an initiator of several corporative standards. But my free articles contain a lot of practical jokes. I need clever pupils. And practical joke is very good test for my pupils. My previous CodeProject articles also have a lot of practical jokes. I would like my readers to notice them. And I do not afraid that I will be known as pure adventurer. This article can be interpreted as practical joke. I think that future creator of Grandiose Project should distinguish serious idea and practical joke. This article also contains a practical joke. I teach my pupils to avoid signing unfinished documents. Very interesting example of unfinished document signing has occurred in USSR. One chief had signed unfinished document. Then his worker wrote that his chief is a goat. The chief had obtained deadlock and he had been resigned. Now there is "To be continued..." at the end of this article. It means that this document is unfinished. But I already have two estimates of my article. So I have low right to compare persons who had marked my article with USSR chief. When the article will not contain text "To be continued" I lose a right on such practical jokes.
This example shows that if creator of Grandiose Project is credulous then a deadlock is provided. CodeProject is devoted to software development. Why I write about provocations in it? I have noticed that very excellent software developer has no success since he/she is too credulous. This fact makes his/her art to zero. So I do not teach my pupils technology only.
3. Project Manager
Project Manager is a key person of the project. Julius Caesar wrote that he hasn’t noticed one small detail once. As a result a lot of his soldiers were killed. It means that a manager has greater role than all of his soldiers. If Julius Caesar is ill or fatigue then small but very important detail can stay unnoticed. There is a contradiction. Manager cannot catch all details of Grandiose Project. Otherwise a small detail can fail the project. There are a lot of articles which say: "Project manager should not understand technology". I know a lot of projects that had been failed because managers did not knew the technology. This contradiction can be resolved in the following way: manager should rapidly find small important details. For example after his High School graduation Boris Yeltsin has tried himself in different building professions. One of these professions is crane operator. While being a crane operator he has averted one accident. When he became resident engineer he was himself able to estimate the work of crane operator. Some operators wish to overestimate their work for more money or for little work. However some operators can underestimate their work. These operators can provide an accident. I think that this experience of Yeltsin has helped him to prevent global accidents while being the President of the Russian Federation. Yeltsin have had a lot of mistakes. Some of them have been caused by his illness. But I think that replacement of President during his nomination would not avoid these mistakes. Frequent change of Country Leader is not a panacea.
Now I explain how the Framework philosophy can help a Project Manager. First of all the Framework provides language that is well known to Manager. Besides the Manager can easy explain tasks to members of his command.
For example Team Foundation Server and Rational Software have the same purpose in software development domain.
However Grandiose Project can include specialist in Quantum mechanics, Heat transfer, Materials science, Optics, Aerodynamics. All command members should explain their problem to Manager. And Manager should explain the task to command members.
It is well known that a pure vertical management is not effective. One member of command should explain his problem to another one. The Framework makes this process very easy. The key idea is well known. It is adopted from Formal language theory. There exists a set of languages. We also have an universal language. Translation is performed in the following way:
Language 1 -> Universal Language -> Language 2.
For example Language 1 is Language of Mechanics and Language 2 is a language of Control Theory.
Following text contains samples of communications between Project Manager and his command members.
OOne of the tasks of Project Manager is real time work. Now am writing this article in real time. I have noticed that during this day this article has a record number of views 447. It is not a Code Project record. It is my own record. I already have two votes for the article. It is also my own record. Also I have two estimates 1. It is also my own record. So I have following conclusions:
This article is more impressive then my former articles.
I should understand why I have two estimates 1.
Maybe I have obtained this estimate from Yeltsin. A lot of Russians has aversion to him. Maybe this estimates is caused by real time grammar. Indeed Grandiose Project do not accept bad grammar. But drafts allow them. However Project Manager should correct grammar in real time. Maybe I have obtained this estimate from managers who did not know technology. I take the opinion of these people easily.
But an opinion of people who found real error in my article is very important for me. According to my experience too quick estimates are not objective. Today I have written about 1/5 of the article. So I take these estimates easily as well. Moreover now I think that such quick estimates are very good because it mean that my article is impressive. But further analysis can change this opinion.
It is time to sleep. I shall correct grammar tomorrow morning. In fat I have written 3.3.2 Control theory today . But this text is related to real time Project Manager work. Project Manager should write a set of chapters at the same time. Julius Caesar was able to write, read and speak simultaneously. Good bye. Wait continuation tomorrow morning +3 GMT.
Hello everybody. I have got up and corrected grammar. Now I am writing chapter about Grandiose Project lifecycle.
4. Psychology
CodeProject is devoted to software. But I have found that it contains a lot of information about psychology. Many articles that are devoted to user interface have interesting psychological aspects. Moreover many articles contain information about psychology of software developers. I am rather an engineer and I wish to discuss a psychology of engineers. One I've told one aviation constructor that I will provide a 20g acceleration to an airplane. He cried: "Stop!!!" But airplane was virtual. Indeed I think that level of abstraction is more important than specialty. I call this higher level of abstraction There Is No Spoon.. This level enables you to do any intellectual work. I frequently find this level among pure mathematicians, software developers and extremal specialties’. According to my observation There Is No Spoon is very seldom among engineers and applied mathematicians. At the beginning of the Framework development I would like to improve abstract level of engineers. This task is outside my abilities. I recall to myself tragedy Motsart i Sal’eri by Alexander Pushkin. Motsart said: "Sal’eri, my friend, it is impossible that all the people would be music geniuses". I hope that Alexander Pushkin forgive me my translation from Russian. Since I cannot globalize There Is No Spoon level I've decided to develop converts from There Is No Spoon to languages which are well known to engineers and backward. I think that this idea is very fruitful for Grandiose Project.
There exists an opinion that a brain fatigue is a possible result of many hours of work. But I find that it is not quite right. I have had many years of brain excecises. As a result I have gained an ability of "brain afterburning". Two hours of "brain stress" make me very fatigue. I understand that if I have an ability of "brain stress" then I should adopt the Framework to people who have no such ability. A very natural way is a conversion from Framework language to languages of domain specialists and backward. The fact that clever developer develops software that is clear to himself only is well known. I think that we should not require him to make adopted software at once. If we do it then we can destroy a very fruitful language. However developer should have an ability to converse form his language to well known languages and backward.
When I have written the above text I have found that "brain stress" stimulates interesting ideas. I am writing this article in real time mode. I understand that a lot of people read it just now. This fact stimulates me. Of course I will correct the text later. But real time mode has a lot of benefits.
It is worth to mention one psychological aspect. If a book or an article is written about the author himself then it is very impressive. Julius Caesar and Boris Yeltsin wrote about themselves. Moreover they wrote in critical situation. Unfortunately creators of space rockets did not do it. I think that we shall never know how in fact space rockets had been constructed. I introduce to the future Grandiose Project creators: "Write about yourself. Write just now. If you do not write just now then grandiosity of your project would be never known"
Reader of this article can find chaos in it. It is one of paradoxes of Grandiose Project. The chaos and strong order exist at the same time. I found it in books written by Julius Caesar and Boris Yeltsin.
5. Integration
Key problem of Grandiose Projects is integration. We can observe similar situation at database domain. Grandiose database should integrate a lot of data sources which are represented in databases of different types. The Integration Services can resolve this task.
Now I would like to describe another sample of integration. All C# language objects has own C# function GetType()
.. But C++ objects doesn't have this function. Every good C++ project has an analogue of this function. Parallel Computing in Quantum Chemistry project has class DescribedClass
that has function ClassDesc* sc::DescribedClass::class_desc ( ).
In fact this function is C++ analogue of C# function GetType()
.. As a result we have a lot of very good C++ projects but it is not easy to merge them. Instead of one GetType()
we have lots of them. I am writing this since I really would like to integrate Parallel Computing in Quantum Chemistry into the Framework. Moreover I would like implement parallel computing using multi-core technology. But I would like that Framework can be easily integrated into other projects. Therefore I had selected C# instead C++.
But C# also has disadvantages. C# has now good standard library of matrix vector algebra. Every company develops it's own library. For example XNA Game Studio Express is excellent tool for 3D game development. Moreover I found that it is excellent tool for Aerospace simulators. However it contains own 3D Vectors. So developers of engineering software should adopt own n - vectors to 3D Vectors of XNA. Otherwise Framework have own n - vectors and other engineering software developers should adopt Framework vectors to their own vectors. If C# would have intrinsic vector matrix algebra than I would use it for better integration with third party software. However the Framework itself can be third party software. Good software can use third party and can be third party itself.
6 Sample of Grandiose Project construction
Here is a sample of construction of controlled spacecraft. The spacecraft is a mechanical aggregate with control system.
6.1. Step 1. Mechanics + Control System
Development of spacecrafts include the work of mechanics and control theory specialists. They understand their own language
6.1.1 Language of mechanics
Typical sample of language of mechanics is presented below:
At this pictures forces, velocities and masses are exposed. Now there exist a lot of mechanical software products. Maybe now there exists a software which can directly work with scheme exposed above.
6.1.2 Language of control theory
Typical samples of control theory language are exposed at following pictures:
The Simulink understands this language. You can find samples of Simulink applications to Control theory here.
6.1.3 Language of the Universal Framework
Universal Framework should understand mechanics and control system
6.1.3.1 Mechanics
Application of the framework to mechanics is described in part 9. I will repeat some citation of the part 9.
Let us consider the following example of usage of the framework for simulation of dynamics of aggregates. This example contains spacecraft with 5 connections C 1, ..., C 5. Flywheels F 1, F 2, F 3 and photovoltaics P 1, P 2, P 3 are connected to spacecraft (See picture below):
The Framework shows this aggregate in the following way:
It is easy to compare both pictures.
6.1.3.2 Control theory
You an find an application of the framework to control theory at part 3.. A sample of an application of the Framework language to control theory is presented below:
Now the Framework is not well known. And many specialists of control theory could not accept it. Therefore the converter from language of the Framework to language of Control Theory described at 2.2 should be developed. According to skeptic opinion the development of an additional software causes additional expenditure of time and capital inputs. However my own experience shows that it is easier to develop software than explain by hands and pictures.
Otherwise the Framework language has some features which are very convenient for control theory specialists. For example it contains an analytical indication of transfer functions:
Moreover the control system package contains Dirac delta function
This function is useful not for control theory only.
6.1.4 Union of mechanics and control theory
NNow we should control spacecraft that in fact is a mechanical aggregate:
Universality of the Framework makes this task much more easy.
6.2 Adding Magnetic Field
A lot of spacecrafts has magnetic control systems. So we should use the model of Earth's magnetic field. This situation is exhibited in following picture:
Actors of these picture are spacecraft, Earth's magnetic field, Elastic vibrations body, Flywheel stabilizer and Control magnets. All these actors interoperate with each other. This scenario is described at part 9. The Framework picture of this scenario is presented below:
6.3 Sensor. Mechanics once again
Classical control scheme is exhibited below:
OOne of its element is a sensor. A lot of spacecrafts use gyroscopes as sensors. But gyroscopes are mechanical aggregates.
6.4 More Sensors. Magnetic field once again
It is well known that gyroscopes have trend. To compensate it we should have another sensors. One type of reference sensors is magnetometer.
6.5 More Sensors once again. Star catalogue
Spacecrafts can have duplicate sensors. Their simulation requires star catalogue. Parts 2 and 7 show the work with star catalogue.
6.6 Virtual vibrostand. Control Theory and Mechanics once again
Nonlinear mechanical models are not convenient to control theory. To obtain control theory we can construct virtual vibrostand (part 9). It enables us to obtain linear model.
6.7 Real vibrostand
Virtual reality is different from real reality. Besides virtual vibostands there exist real ones. Using data processing from real vibrostand we can obtain more adequate model. Part 3 is devoted to data processing.
6.8 Observation. Star catalogue once again
A lot of spacecraft missions are star observation so we should have star catalogue once again.
6.9 Virtual Reality
IIf spacecraft is an inhabited space station then Grandiose Project include training of pilots. So we need virtual reality. But this virtual reality is not standalone. It should be linked with other aspects described above. Part 7 is devoted to virtual reality.
6.10 Virtual Reality with stars. Star catalogue once again
Spacecraft virtual reality contains images of stars. So we need star catalogues once again.
6.11 Spiral model
Now we have constructed spacecraft. But we should correct it. This operation is similar to spiral model of software development. If we have full single model in universal Framework then next iteration become much more easy.
7. Grandiose Project as whole. Integration once again. Project manager once again.
Hello everybody. Excuse me for pause. I was at my work and have a brain stress once again. It inspires me to continue writing.
I would like to explain why we need simulate Grandiose Project as whole. The following situation is well known. Grandiose project is as rule separated to different aggregates:
Both aggregates have objects which are exposed as circles. At this picture we have a high level of abstraction. Every circle can be a part of a device, ship, social group etc. We do not require that all circles have the same types. Lines between objects mean influence. Influence can be electrical, heat transformation, information etc.
Now we connect two aggregates:
WWe have additional links. Before the connection both aggregates are quite right but the whole construction is not. Now a lot of Grandiose Project computer models are models of their aggregates only. I think that we should have model of whole Project or close model.
Now let us consider the following situation:
At this picture red object is not right. But it is not wrong as itself. It is not right because of an influence of the blue object. Software development knows this fact as induced error. It is very difficult to find it in software. But it is much more difficult to find it in engineering device.
I had never been close to Grandiose Project. But I have constructed very complicated models. One of them is presented below:
I can not find errors in such models. The framework shows me red circle but I cannot find blue one. Then I have developed a lot of methods for finding a blue circle. I will describe them later. This example shows that we should develop whole Grandiose Project computer model or labour for it. The Framework is a labour for models of Grandiose Projects.
Its aim is potentially unlimited integration. I have already said in this article that small detal can destroy the whole Project. Computer model of the whole Project can help Project Manager find this small detail.
8. There Is No Spoon
There Is No A Spoon means high level of abstraction. Author is a researcher in Noncommutative geometry that is also named as non-geometry.. This geometry has no points. The geometry without points is a paradox. But how we can prove that real Universe has points. The question about existence of points was known at antiquity. The existence of points by Aristotle means that we can divide space infinitely many times. But this experiment is impossible in principle.
High abstraction level provides a lot of benefits. I will discuss them here.
II have had a lot of discussions about the Framework. Some people told me that it has very few component types. But using few component types I can resolve a lot of tasks. Every software developer knows that the best practice is reducing the number of component types. It is easy to explain what is abstract database to software developer. He/She understands that it is "There Is No Spoon". But it is very difficult to explain what is an "abstract physical field" to a radioman. According to my experience the "abstract physical field" is very useful. I have a dilemma. First way is an explanation of "abstract physical field" to a radioman. Second way is a renunciation of "There Is No Spoon". Both ways are not good. Then I have found standard solution of this dilemma. This solution is well known in design patterns where we develop a new version of software but we dot not wish to reject an old version. However now we have no old software. We have a high professional radioman who does not understand what "There Is No Spoon" is.
I think that readers forgive me the errors in this article. I shall correct them later. This article is being written in short pauses between another occupation. But this another work induces new ideas for me and I should write them right now. I have no offline version of CodeProject editor. Although unedited versions with errors were read by a lot of people full version will be ready much more quickly by using online CodeProject editor.
Pause to work.
At my work I have found new benefit of real time mode. My colleagues told me that there is a new problem related to SCADA.. I've answered that it is not new problem. It is a problem that resolved by the Framework long time ago. Now they have not enough "There is no spoon" understanding. But I also hadn't it several years ago. I should explain "There is no spoon" once again. This article is also such explanation. Text below is devoted to "There is no spoon" examples.
These samples are very different. But "There is no spoon" art includes finding parallel in different such as "Parallel Lives" by Plutarch. Framework philosophy also includes "parallel in different" as well as philosophy of any good software.
Hello everybody. I have got up. I found that I have received mark 5. It means that I should do my best on this article. I promise to improve my English later. Today I will explain the first sample of "There is no spoon"
8.1 Sample 1. Radioman once again
There exists an opinion that philosophy is not related to reality. For example "Old type specialist looks like C code" is metaphor only. But I have had a practical implementation of this metaphor. The adapter pattern can be used for adoption of C code. I use this pattern for adoption of radioman who does not understand "There is no spoon". Maybe a radioman will understand "There is no spoon" later. He/She is my friend and I will have a lot of discussions with him/her. But I would like to use him/her today. So Framework needs such an additional interface that he/she understands right now. Typical examples of software which provide additional interface are RSView and LabVIEW.. He/She is not a single radioman. There exist a lot of radiomen which do not understand what abstract physical field is. One version of "There is no spoon" means "There is no difference between C code and radioman". Plutarch had been criticized for his parallels. Author is also being criticized for my parallels between C code and radioman. Maybe following generations will write about live parallel between Plutarch and author.
8.2 Sample 2. Regression analysis
During writing this atrticle I understand why "There is no spoon" is clear for a lot of software developers. C# has a function Equals
.. Java has similar function. This function can be overloaded. As a result very different objects can be equal even when they have different (non inherited) type. A lot of developers use it. Following formula:
SQL Query = Bitmap + Digital Filter = 3D Shape + Virtual Camera + Bitmap + Digital Filter
is another "There is no spoon" version. I will prove this formula. All equal elements provides experimental data for regression analysis. Regression analysis is considered at part 2.
8.2.1 Experimental data
Regression operates with experimental data. This data is a set of real numbers. Framework structure enable us to set following equalities above, since all of them provides a set of real numbers. I repeat them here:
SQL Query = Bitmap + Digital Filter = 3D Shape + Virtual Camera + Bitmap + Digital Filter.
Let us consider every term of this equation.
8.2.1.1 SQL Query
It is easy to understand how SQL query provides a set of real numbers. Framework provides SQL Query:
Then we have following experimental data:
Real numbers are abscises and ordinates of this chart.
And at last using regression analysis we approximate this data:
Blue curve is result of approximation.
8.2.1.2 Bitmap + Digital Filter
Now we have following bitmap.
WWe would like to obtain a set of real numbers from it. To do this we have filtered the bitmap:
Coordinates of black points can be casted as real numbers. We certainly can implement selection interface to our image class selection interface. But it is not a good idea since the image will have a lot of interfaces by the time. Adapter pattern is much more effective in this case. Framework goes by adapter pattern way:
LLeft element is image, right one is a selection obtained from image. However it has properties of bridge pattern. It is a bridge from image to selection. It provides selection for regression. So Framework contains design patterns at user interface level. It is difficult to understand it by radioman. But it is very effective. One makes a selection of the image by setting the arrow from one block to another. Radioman will use another user interface that I will describe below. So we have a selection and we can approximate it. Approximation result is presented below:
8.2.1.3 3D Shape + Virtual Camera + Bitmap + Digital Filter
This sample is "There is no spoon too". We have a bitmap:
Also we have 3D Shape and virtual camera.
After filtration of presented below images we have following red and blue curves:
Red curve is obtained from bitmap, second one from camera and 3D shape. We would like approximate first curve by second one. Using another words we would like to find position and orientation of plane. Approximation result is presented below.
IIn this case we have a very interesting case of bridge pattern.. We have a selection from two objects: camera and image:
I've named it a two-way bridge. Selection is constructed from differences of blue and red contours. Red is provided by Image and blue one is provided by Camera. Selection result is used by Regression. Arrow means that object consumes image. Arrow means that Camera looks at Plane.. This language looks as exotic. However it is very natural and looks very similar to languages of modern IT. An advantage of this language is its laconism. It is well known that math formula is much more clear than text explanation. Similarly usage of icons is very clear. In XXI century text explanation looks like Babylonian mathematics.
8.2.2 Regression equation
Regression analysis do not include experimental data only. Another essential ingredient is regression equation. It is also "There is no spoon". Following text describes a set of regression equation versions.
8.2.2.1 Finite formula
Finite formula is very simple case of regression equation. In 8.2.1.1 and 8.2.1.2 a had used following formula:
Where a, b, c, d, f, g are unknown parameters and x is independent one.
8.2.2.2 Complicated ordinary differential equation
II have considered a complicated ordinary differential equation at part 6 devoted to determination of orbits of artificial satellites. Its unknown parameters are initial coordinates of satellite and 3D velocity. We have no explicit formula in this case.
Determination of orbits of artificial satellites methods are well known. There exist a lot of software devoted to these methods. But it was not known that it can be included into more universal framework.
8.2.2.3 3D Shape + Virtual Camera + Bitmap + Digital Filter once again
This version of regression equation is considered at 8.1.2.3. Unknown parametres are coordinates and 3D orientation parameters of plane. It is clear that we have no explicit formula once again. Regression equation includes 3D plane model, virtual camera, digital filter. It is not an equation. It is rather "Too the is no spoon" once again.
8.3 Sample 3. Change request. Battle obstacles. Napoléon Bonaparte once again
II've being asked: "Why do you study History? Why do you study military art?" I answered: "It is related to my work". The phrase "Napoléon Bonaparte had used a several plans for one battle" looks very easy. It has no "There is no spoon". But really it has "There is no spoon" implicity. Battle obstacles are invisible as well as change request. The "Napoléon Bonaparte had used a several plans of one battle" means that he can predict invisible battle obstacles. It is not easy. It is also "There is no spoon".
8.4 Sample 4. Moral Factor. Napoléon Bonaparte once again
Moral factor is also invisible. Napoléon Bonaparte had known it. But History knows another military talents who had little education. For example Vasily Chapayev and Gaius Marius were such military talents. Like Plutarch I have found live parallels between them. They also understood moral factor. Vasily Chapayev cited Napoléon Bonaparte for raisig moral factor of his soldiers. Napoléon Bonaparte citation raised authority of Vasily Chapayev. Grandiose Projects also have moral factor. Reader understand why author of this article is citing Vasily Chapayev.
8.5 Sample 5. Space rockets design
This article looks like chaos. But if you would like to describe a Grandiose Project in single document then you also find a chaos. Article is in fact a flat file. Any serious project is not flat. It conains a complicated combination of classes interfaces etc. But it is not spaghetti code.. It is well structured. These article is rather an inspiration than a Grandiose Project guide. Therefore it have historical names. This article contains code reuse.. For example Sample 1 is sample of "There is no spoon". But it can be used by project manager who would like to use a radioman. Therefore Sample 1 is related to chapter devoted to project manager. This article also contains recursion. Like Plutarch's this article has parallels and then we have a parallel between this article's author and Plutarch.
There exists an opinion that such methods are not related to space rockets design since it does not accept chaos. But space rocket design has a lot of code reuse and recursion. Moreover it has "There is no spoon". Space Rocket has a lot of interoperate subsystems. Some of these subsystems are designed simultaneously. Therefore one system doesn't have a full knowlege about another one. Another subsystem is "There is no spoon" for first one.
8.5 Sample 6. Complicated math
Complicated math contains problems which cannot be resolved or their solution is very difficult. But "There is no spoon" can solve these problems easily. Here are samples of such solutions.
8.5.1 Quantum chromodynamics
Quantum chromodynamics operates with values which we cannot calculate. But we can calculate the relation between these values. This fact can be used for experimental tests. "There is no spoon" means that we should not calculate values.
8.5.2 Known variants
Once I should to solve a task related to strength of materials. I should select on variant from following formulas:
Expressions 1, 2 and 3 were known for me but I do not remember them now. I had understood that formula is:
II had no attempt to calculate whole integral and even "...". I had found right result at once. I think that reader will also do so.
8.5.3 Little knowledge of math. Vasily Chapayev once again
Vasily Chapayev had very little knowledge of math. He was asked: "How much is 0.5 + 1/2" Chapayev answered: "I understand that it is 1 liter (Moonshine)), but I cannot prove it". In fact Chapayev had compensated his little knowledge by his imaginativeness. There are a lot jokes caused by the fact that Chapayev had extraordinary talent and little knowledge of math.
8.5.4 Numerical experiment
A lot of software developers has following problem. They should select between "+" and "-". Simple solution of this problem is setting "+" at first. If it is not right then we set "-".
8.6 Sample 6. Videoadapter as engineering calculator
There exists an opinion that present day IT is not related to engineering. Also a lot of people think that video adapter can be used as effective multimedia device. Present-day video adapters use modern technology and have high performance. They have their own memory and they can draw a virtual on it. These features may be used for essential improvement of the performance of engineering calculations. I provide examples devoted to physical optics and space aerodynamics below.
8.6.1 Physical optics
Physical optics is also the name of a high frequency approximation (short-wavelength approximation) commonly used in optics, electrical engineering and applied physics. In this context, it is an intermediate method between geometric optics, which ignores wave effects, and full wave electromagnetism, which is a precise theory. The word "physical" means that it is more physical than geometric or ray optics and not that it is an exact physical theory. Physical optics is effective for convex 3D shapes but it may be used for shapes which are not convex. If we would like to use physical optics we are to define visible parts of 3D shape. As rule this task requires a very large volume of calculations. However we can mark parts of shape by different colors and then define a set of colors which are presented on the following picture:
Using this method we can define visible parts much more quickly. If number of parts exceed number of colors then we can use more than one image.
8.6.2. Space aerodynamics
The key feature of space aerodynamics is that spacecraft interacts with molecules which do not collide with eah other. Therefore aerodynamic force depends on visible area and does not depend on other parameters of spacecraft shape. Visible area may be computed by calculation of the number of white pixels on the following figure:
It is also easy to define axis of aerodynamic force and then we may calculate aerodynamic momentum.
9. Getting Started
Usually the Getting Started is placed at the beginning. But beginning of this article contains prospects. I am being frequently ask "How can we use Framework?" My answer is: "Everybody can develop own components and add it to the Framework" This chapter contains examples of new components' development.
9.1 Example 1. IronPyhon component. Integration once again
IronPyhon is well a known programming language. A lot of sciense and engineering developments use IronPython. Since the Framework is universal it should include these developments. Here is a sample of such inclusion:
This sample requires Visual C# Express Edition and IronPyhon. You should add IronPython.dll
to IronPython.Library.csproj
as a reference. This IronPython component is in fact an adapter.. In this sample IronPython is used as a third party.
9.1.1 Sample of fuctionality
9.1.1.1 Pure Framework version
KKnown fuctionality makes explanation of the code easier. Let us consider a typical task of data transformation:
The solution of this task by Framework is presented below:
The Source is a source of data transformation. Properties of Source are presented below:
Source contains two formulas:
Formula 1 = t;
Formula 2 = t2..
Here t is time or any other independent variable. This fact is reflected by right-left combobox.
Transformer performs data transformation provided by Source. Properties of Transformer are presented below:
This picture means that Transformer performs following calculations
Formula 1 = sin(a);
Formula 2 = cos(b);
Formula 3 = cos(a) + 1.
Here a and b are provided by Source.. This fact is refleted by the left part of the above picture. Full transformation scheme is presented below:
Target indicates transformation result:
Red green and blue curves are sin(t), cos(t2) and cos(t) + 1 respectively.
9.1.1.2 IronPyhon + Framework version
This version uses IronPython component that has been developed for this article. Transformation picture is presented below:
Here Transformer has been replaced by its IronPyton version. IronPyhon version is presented below:
Left top table means following assignments:
a = Formula_1;
b = Formula_2.
Since we use the notation "Source.Formula_1" and "Source.Formula_2" both formulas are exported from Source.. Python code textbox contains IronPython code. Right top table contains the list of exported variables which are used by Target.
9.1.2 Development of IronPyhon component
Everyone can add their own components to Framework. It is possible to develop new components at separated Dynamic Link Libraries . IronPython comonent is conainend in two libraries. First one contains business logic. Second one contains user interface.
9.1.2.1 Business logic
Business logic is contained in IronPython.Library.csproj project. This project contains single public class IronPythonTransformer
.
As well as any class of Category Theory architecture it implements interface ICategoryObject. Here it is a subclass of CategoryObject
. Similarly every arrow object should implement IICategoryArrow
interface. Implementation of ISerializable enables us to serialize objects of this type. IPostSetArrow.PostSetArrow()
method performs additional operations that follow setting the arrows. This class also implemens interfaces IDataConsumer
and IMeasurements
. First interface means that component can consume data. In above example it consumes data from Source. The IMeasurements
can be named as IDataProvider
.. But I have named it IMeasurements
since it provides virtual measurements. In above example it provides virtual measurements for Target.
The key IronPython's feature is contained in following function:
void IMeasurements.UpdateMeasurements()
{
consumer.UpdateChildrenData();
foreach (string name in inputMeasurements.Keys)
{
parameters[name] = inputMeasurements[name].Parameter();
}
compiledCode.Execute(module, parameters);
}
This function executes compiled code. So we use IronPyhon for data transformation. Thus we have business object.
9.1.2.2 User interface
All versions of the Framework have a single style of user interface. This style is an implementation of IUIFactory
interface. The IUIFactory
match to abstract factory pattern.. Within many years I have developed a lot of IUIFactory
implementations. But I have had a long time for merging them. At last I have developed assembly of factories AssemblyFactory
that implements IUIFactory
.. Now we can extend functionality by adding a new factory to an assembly. I also have developed PythonFactory
for this article and added it to existing assembly factory. Let us consider single essential feature of PythonLibrary.
IObjectLabelUI IUIFactory.CreateObjectLabel(IPaletteButton button)
{
if (button.ReflectionType.Equals(typeof(IronPythonTransformer)))
{
if (button.Kind.Equals(""))
{
return UserControlLabel.CreateLabel(new Labels.PythonTransformerLabel(), button.ButtonImage);
}
}
return null;
}
This function creates desktop Label from selected palette Button. Following picture explains what it mean:
So we have necessary business logic and user interface. They are necessary ingredients for Framework extension.
9.2 Aviation Trainer Simulator
There exists a lot of game generators. I would like to show how they can be used as Aero Space simulators. Pilotage can be very difficult. Pilots of MiG-31 should have a lot of training before first flight. Even very experienced pilot George Beregovoy could not perform earth-orbital docking. First USSR eatrh-orbital dockings had been performed after development of trainer simulators. This sample requires Visual C# Express Edition and Microsoft XNA Game Studio 3.0.
9.2.1 Control systems design workstation
DDevelopment of aviation trainer simulator is joint work of many of different kinds specialists. It includes aerodynamics and mechanics research. Modern airplanes use autopilots. So control systems specialists should be included. The task of aircraft control is presented below:
Presented aircraft does not look realistic. It is imported from the samples of Microsoft XNA Game . Aircraft model that is presented below is not quite realistic. But it has a lot of qualitative ingredients. The above picture means that combination of Microsoft XNA Game Studio 3.0ame Studio 3.0 and realistic physics has a lot of benefits.
Here I'll shortly explain the work of real physics specialists. One version of the framework is named Aviation + Control Systems. It provides single design workstation for mechanics and control systems specialists. The desktop of this workstation is presented below:
Let us briefly describe components presented at this picture.
9.2.1.1 Rigid body dynamics
Aircraft motion is described by rigid body dynamics equations. Therefore Aviation + Control Systems version of the Framework contains rigid body dynamics component . Its properties are presented below:
Input propeties of ridid body dynamics include position, orientation, linear velocity components and angular velocity ones. Output parameters are force and torgue. Properties also contain mass and moment of inertia. The values of these parameters are exported from other components of desktop which are described below.
9.2.1.2 Aerodynamics
It is clear that this task should include aerodynamics. . In this sample I've considered transonic case. In this case aerodynamics strongly depends on Mach number. So one dimensional aerodynamics dependecies become two dimensional. Two dimensional dependency is presented below:
It is a dependency of drag coefficient on Mach number and angle of attack.
9.2.1.3 PID control
A lot of present day aircrafts have unstable unstable aerodynamics. These aircrafts need autopilots. There exist a lot of different kinds of control loops which are used for autopilots. One of them is PID control. One of its necessary ingredients is integrator . This element is used as a component with following properties:
9.2.1.4 Engineering indication
We have constructed an aircraft and its control system model. Now we would like to indicate its behavior. We use graphical indicators for this purpose:
For simplicity I have used two-channel autopilot. First channel controls tangage Second one controls velocity. Above plots indicate transient processes of these channels.
9.2.2 Simulator
So we have So we have math model and we would like use as third party in a simulator. First of all a model will be exported. I understand that my explanation is not clear enough but I hope that the reader will help me by asking questions.
9.2.2.1 Math model export
The model described in 9.2.2 has been saved in following file:
Now we export this file into simulator project in the following way:
First of all we develop user control for export. It contains component UserControlSimulation
. I have put. I've put component DesktopHolder
it. Then we edit Content property of DesktopHolder
. We download Aviation_ControlSystems_sample.cfa
:
Now we should use DesktopHolder
. Following picture shows objects which we would like to use:
Valuable components are Velocity diff, Tangage diff and Mea. Another objects can be regarded as internal (private). Velocity diff and Tangage diff enable us to set control signal. Mea provides motion parameters for visualization.
private IAliasName tangage;
private IAliasName velocity;
private IMeasurements output;
There is the following correspondece between objects:
Desktop object | Identifier |
Velocity diff | velocity |
Tangage diff | tangage |
Mea | output |
InitializatioInitialization of identifiers is performed in the following way:
9.2.2.2 Interoperability of math model and user interface
Now we would Now we would like to provide interopreability. User interface includes keyboard and screen. Following delegate was developed for interaction:
public delegate void MotionDelegate(GameTime gameTime, GamePadState gamePadState, KeyboardState keyboardState,
ref Vector3 position, ref Vector3 direction, ref Vector3 velocity, ref Vector3 up, ref Vector3 right);
Keyboard and Game time provide input by the following way:
float elapsed = (float)gameTime.ElapsedGameTime.TotalSeconds;
if (elapsed < last)
{
if (elapsed > 0)
{
last = elapsed;
}
}
time = oldTime + kt * (double)elapsed;
StaticDataPerformer.Strategy.Time = time;
double timeStep = time - oldTime;
if (oldTime > 0)
{
processor.Step(oldTime, time);
}
StaticDataPerformer.Strategy.UpdateAll(desktop);
step.Step = current;
++current;
oldTime = time;
if (keyboardState.IsKeyDown(Keys.Up))
{
if (angleCurr > -angleDiscr)
{
--angleCurr;
}
}
if (keyboardState.IsKeyDown(Keys.Down))
{
if (angleCurr < angleDiscr)
{
++angleCurr;
}
}
double angle = (double)angleCurr * angleStep;
tangage.Value = angle;
if (keyboardState.IsKeyDown(Keys.Space))
{
if (velCurr < velDiscr)
{
++velCurr;
}
}
if (keyboardState.IsKeyDown(Keys.Back))
{
if (velCurr > 0)
{
--velCurr;
}
}
double vel = (double)velCurr * velStep;
velocity.Value = vel;
Output motion parametes are used for screen indication in the following way:
position.X = -scale * (float)(double)coord[2].Parameter() + x0;
position.Y = scale * (float)(double)coord[1].Parameter() + y0;
position.Z = -scale * (float)(double)coord[0].Parameter() + z0;
double tan = 2 * Math.Atan2((double)quater[1].Parameter(), (double)quater[0].Parameter());
direction.X = 0;
direction.Y = (float)Math.Sin(tan);
direction.Z = -(float)Math.Cos(tan);
right.X = 1;
right.Y = 0;
right.Z = 0;
up.X = 0;
up.Y = -direction.Z;
up.Z = direction.Y;
In result we have following simulator:
9.3 Digital Image Processing Web Project
Every present day grandiose project should have Web interface. Here I would like to show how the Framework can be used as Web application. Grandiose project members have different specialties and levels of proficiency. Some of them can understand simple user interface only. In other hand, the Framework is very science intensive. However the complexity of the Framework does not contradict with simple user interface. I'm going to show it in this chapter.
9.3.1 Problem description
A lot of very useful information is contained in old reports or another documents which are written on the paper. For example we have following picture:
We would like to obtain math dependency from this image.
9.3.2 Preparing work
We have use DWe use Digital Image Processing project for preparation.
Using this project we develop the following:
Let us describe this picture in brief. The Sourceobject is the source image. The Transform is result of Source filtration. Boolean is key element of filtration. It contains following formula:
Parameters r, g, b of this formula are red, green and blue intensivity of colors respectively. Filtration result is presented below:
Now we would Now we would like approximate black points of the result by the following formula:
y 5 + bx 4 + cx 3 + dx 2 + fx + g;
It is contained in Regression component:
Processor performs approximation of Transform points. Graph indicates ap indicates approximation result. Development result is saved in the file DirtyChart.cfa
This file is used in Web application.
9.3.3 Web application development
Web application uses some dynamic link libraries of Digital Image Processing project and the file DirtyChart.cfa Development requires Visual Web Developer 2008 Express Edition
This application is very simple and I will not comment its code here, except one feature. Developer should replace parameter PortalDir
of Resource.resx by llocal directory of web project. Here I explain its user interface only. Work with Web applicacion contains three steps described below.
9.3.3.1 Upload picture
This step is very simple. You just need to upload the picture:
9.3.3.2 Filtration
This step is presented below:
It requires selection of red, green and blue diapasons for filtering chart.
9.3.3.3 Approximation
This step is presented below:
This step requires selection of X and Y diapasons. In a result we obtain coefficients of polynomial and chart of result polynomial.
10. Going Solo
30 years ago 30 years ago I thought that I will create Grandiose Project. However USSR rejected many people with initiative ideas. But I haven't abandoned the idea of a Grandiose Project. I've been creating it solo. My inspiration sir was Aleksandr Isayevich Solzhenitsyn. He has been writing his books during his imprisonment. Moreover the fat that he was writing was mortally dangerous for him. He has had a very little chance for publishing his books. He has had a much greater chance to die in imprisonment. But he have been going solo. As well as Aleksandr Isayevich Solzhenitsyn I've had no opportunities for creation a Grandiose Projects. In USSR it required Communist Party of the Soviet Union membership that contradicts to my nature. Moreover Soviet System has a lot of obstacles for publishing my ideas. Maybe an absence of these opportunities made me think about Grandiose Projects in abstract level. And this abstract understanding is much more useful than my attempts for creation a Grandiose Project. I will continue to promote my ideas and time will approve their fruitfulness. I would like to say for all future Grandiose Project's creators:"Going Solo is not a bad way. In future your successors will join you" coefficients of polynomial and chart of result polynomial.
11. Epilogue
The subject of this article shall be continued in my following articles. Wait.