tag:blogger.com,1999:blog-63525110230554539092024-03-12T20:27:54.737-07:00Stochastic Simulation and Lagrangian DynamicsThis is the blog-diary created to monitorize the evolution of Rabindranath Andujar's thesis on Stochastic Simulation and Lagrangian dynamics applied to Structural Design.
It is intended to extend collaboration with other people, allow the register of the studies, and force a discipline on recording references, lines of study, and whatever else appears.Unknownnoreply@blogger.comBlogger39125tag:blogger.com,1999:blog-6352511023055453909.post-66612831101408198072015-02-03T09:24:00.001-08:002015-02-03T09:24:08.832-08:00EXCELLENT CUM LAUDEI proudly announce the conclusion of this very important part of my academic career.<br />
The thesis passed with and Excellent Cum Laude today, 3rd February 2015, in the Universitat Politecnica de Catalunya.<br />
I would like to thank both my mentors Prof. Jaume Roset (UPC) and Prof. Vojko Kilar (University of Ljubjana), and all those that were with me all along...<br />
<br />
Following is the abstract of the thesis:<br />
<br />
<style type="text/css">H1 { margin-bottom: 0.08in; text-align: left; page-break-before: always; }H1.western { font-family: "Times New Roman",serif; font-size: 15pt; font-style: italic; }H1.cjk { font-family: "Microsoft YaHei"; font-size: 16pt; }H1.ctl { font-family: "Mangal"; font-size: 16pt; }P { margin-bottom: 0.08in; line-height: 150%; text-align: justify; }P.western { font-size: 11pt; }A:link { color: rgb(0, 0, 255); }</style>
<br />
<h1 class="western" lang="en-GB">
Abstract</h1>
<div class="western" lang="en-GB">
This thesis explores a very well
understood area of physics: computational structural dynamics. The
aim is to stretch its boundaries by merging it with another very well
established discipline such as structural design and optimization. In
the recent past both of them have made significant advances, often
unaware one of each other for different reasons. It is the aim of
this thesis to serve as a bridging tool between the realms of physics
and engineering.</div>
<div class="western" lang="en-GB">
The work in divided in three parts:
variational mechanics, structural optimization and implementation.</div>
<div class="western" lang="en-GB">
The initial part deals with
deterministic variational mechanics. Two chapters are dedicated to
probe the applicability of energy functionals in the structural
analysis. First, by mapping the state of the art regarding the vast
field of numerical methods for structural dynamics; second, by using
those functionals as a tool to compare the methods. It is shown how,
once the methods are grouped according to the kind of differential
equations they integrate, it is easy to establish a framework for
benchmarking. Moreover, if this comparison is made using balance of
energy the only parameter needed to observe is a relatively easy to
obtain scalar value.</div>
<div class="western" lang="en-GB">
The second part, where structural
optimization is treated, has also two chapters. In the first one the
non-deterministic tools employed by structural designers are
presented and examined. An important distinction between tools for
optimization and tools for analysis is highlighted. In the following
chapter, a framework for the objective characterization of structural
systems is developed. This characterization is made on the basis of
the thermodynamics and energetic characteristics of the system.
Finally, it is successfully applied to drive a sample simulated
annealing algorithm.</div>
<div class="western" lang="en-GB">
In the third part the resulting code
employed in the numerical experiments is shown and explained. This
code was developed by means of a visual programming environment and
allows for the fast implementation of programs within a consolidated
CAD application. It was used to interconnect simultaneously with
other applications to seamlessly share simulation data and process
it. Those applications were, respectively, a spreadsheet and a
general purpose finite element.</div>
Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-6352511023055453909.post-51635558359190807012013-07-31T02:24:00.002-07:002013-07-31T02:24:27.789-07:00Montecarlo method for matrix inversionOne of the countless applications of stochastic concepts to real life problems is the approximate solution of large systems of algebraic equations.<br />
After some research, I have accumulated some references on the topic and tried to implement their described algorithms in order to use them in my thesis. All the works are based on a 40's paper by Ulam and Neumann, later re-visited by Leibler and Forsythe in 1950 (<a href="http://www.cs.fsu.edu/~mascagni/Forsythe_Leibler_MTAC_1950.pdf" target="_blank">Matrix inversion by a Montecarlo method</a>). The most prominent contributions afterwards are (in my opinion) those by Halton, Dimov, Alexandrov and Mascagni, all of them available in the web.<br />
Unfortunately, these descriptions are not really suitable for the layman and in all cases come wrapped in the (allegedly) more precise "mathematical language". This has caused me an enormous amount of trouble just to get to the conclusion that<b> Montecarlo matrix inversion methods are not suitable for real time simulation or engineering purposes</b>.<br />
This assert is based on the fact that those methods are only directly applicable to <b>diagonally dominant matrices</b>. This means matrices whose diagonal values are <b>bigger than the sum</b> of all the other values in their respective rows. I made the mistake of assuming that, in FEM, as the diagonal always has the highest values, it should be equivalent, but no...<br />
<br />
Of course, different authors have developed and adapted the method to more general cases, but I believe that then the gain in computational velocity one achieves by simply approximating is lost in all the preparatives.<br />
<br />
As a conclusion, a much more simple and better documented algorithm to be used instead is <b>Conjugate Gradient</b>. Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-6352511023055453909.post-73443923624522247092012-09-07T06:00:00.002-07:002012-09-07T06:00:09.572-07:00Master thesis: VARIATIONAL MECHANICS AND NUMERICAL METHODS FOR STRUCTURAL ANALYSISThe past 25th June I had to present my (unexpected) master thesis in the UPC.<br />
I want to thank my mentors Prof. Jaume Roset and Prof Vojko Kilar for their support and tutoring during the whole process of writing that led to a mark of 8 over 10 at the UPC Physics Department.<br />
The following is an excerpt of the content of the document that will hopefully soon be published in the Physics department's webpage (<a href="http://fcia.masters.upc.edu/TFM/llista">http://fcia.masters.upc.edu/TFM/llista</a>):<br />
<br />
<b>VARIATIONAL MECHANICS AND NUMERICAL METHODS FOR STRUCTURAL ANALYSIS</b><br />
<br />
<b>Abstract</b><br />
<br />
This work focuses on the particular application of the variational principles of Lagrange and Hamilton for structural analysis. Different numerical methods are compared in their computation of the elastic energy through time.<br />
According to variational mechanics, the difference between the stored elastic energy and the applied work should be null on each time step, so by computing this difference we can account for the level of accuracy of each combination of numerical methods. Moreover, in some situations when numerical instabilities are difficult to perceive due to high complexities, this procedure allows for the control and straightforward visualization of them, being an excellent source of hindsight on the behaviour of the analysed system.<br />
The purpose of this dissertation is to present a scheme where the current numerical methods can be benchmarked in a qualitative as well as in a quantitative manner. It is shown how different combinations of methods, even for a simple model, can give very different results, particularly in the field of dynamics, where often also instabilites arise.<br />
The first half of the thesis is a thorough explanation of these concepts and their application in terms of structural analysis. In the second part, a review on the numerical methods in general and of those implemented for our experiments is provided, followed by the experimental results and their interpretation. The model of choice, for simplicity and availability of analytical results is one cantilever column. Bending elastic energy of the column is monitored under transient regimes of different shapes, computing the total action of the system as its integral through time.<br />
<b><br /> Introduction</b><br />
<br />
Targets and interest of our research<br />
<br />
Variational mechanics date back as far as the XVIII century, when Leibniz, Euler, Maupertuis and eventually Lagrange devised the calculus of variations and the principle of least action. This methodology of treating physical phenomena is based on the notion that everything in Nature tends to a state of minimal energy(1).<br />
In this work we will be focusing on its particular application in structural analysis, where one deals with “engineering scales” whose dimensions span between 100 times bigger or smaller than those of a human being. This is in contrast with other areas of applied physics like astronomy or molecular dynamics but will be shown how those variational principles still apply and even become powerful tools for the comprehension of the behaviour of our built environment.<br />
Numerical methods, on the other hand, have proliferated since the 1950s alongside with the ever increasing power of computers as a means to simulate physical phenomena. This ceaseless growth in number and terminology has given place to a cumbersome mix of mathematical, physics and computer science often difficult to grasp.<br />
Choosing one simple cantilever beam as our test model, we will utilize and compare different combinations of these methods to compute its elastic energy under transient loading regimes of different shapes. This will render useful in future research in nonlinear analysis of more complex structural systems.<br />
<br />
Variational mechanics <br />
<br />
According to the principles of variational mechanics (2) , the difference between the measured energy and the applied work should be minimal, so by accounting this difference in each time step of our simulations we should be able to infer the degree of accuracy provided by each combination and discuss the reasons that lead to differences in result using the energy as the natural norm for analysing the error(3).<br />
<br />
Numerical methods for structural analysis<br />
<br />
In a previous work by the authors (4)(5), it was shown how the vast amount of existing numerical methods can be grouped into three main sets according to the kind of physical phenomena they model and the type of differential equations they discretize: matter integration techniques (Partial Differential Equations), constraint integration techniques (Algebraic Differential Equations) and time integration techniques (Ordinary Differential Equations).<br />
According to this, we will particularize in the following matter integration implementations: Finite Element (FEM), Finite Differences (FDM) and Mass Spring Systems (MSS). For the constraint integration we will be comparing Penalty Method (PM) and Lagrange Multipliers (LM). And for the time integration techniques we will employ Newmark Beta (NB), Houbolt's (HBT), and the Linear Acceleration Method (LAM).<br />
Other combinations are also possible, as the proposed scheme is easily extensible, but for our current purposes it should suffice.<br />
<br /><b>Discussion and future work</b><br />
<br />
A numerical comparison of methods commonly employed in structural mechanics was presented.<br />
It was made on the basis of energy principles and eventually the total action of a system under transient loading has been computed for each possible combination of methods.<br />
It was shown how variational principles and an energetic norm can be employed in the benchmarking and assessment of the accuracy and stability of different implementations.<br />
The scheme provided, tested on a simple example, is easily extensible to more complex systems with more elements. The advantage of this approach is that it allows for the monitoring of the global behaviour by means of one simple scalar, whose value is to be compared against that of an analytical computed from external forces or accelerations.<br />
Also, a conceptual framework for the classification and treatment of numerical methods, grouping them into time, matter and constraint integrators, was used for the systematic analysis of the results.<br />
<br />
Future work aims at the application of the same methodology in nonlinear analysis and more complex structures.<br />
The combination with stochastic techniques for the integration of the action and the search of minimal energy states is one of the final targets of the current research.<br />
<br />
<b>References</b><br />
<br />
1) C. Lanczos, 1970, “The variational principles of mechanics”, University of Toronto Press, Canada<br />
2) W. Wunderlich, W Pilkey, 2002. “Mechanics of structures. Variational and computational methods”, CRC Press, pp.: 852-877<br />
3) G. Bugeda, 1991, “Estimacion y correccion del error en el analisis estructural por el MEF”, Monografia 9, CIMNE, Barcelona <br />
4) R. Andujar, J. Roset, V. Kilar, 2011. “Beyond Finite Element Method: An overview on physics simulation tools for structural engineers“, TTEM 3 / 2011. BiH.<br />
5) R. Andujar, J. Roset, V. Kilar, 2011. “Interdisciplinary approach to numerical methods for structural dynamics”, WASJ Vol 14 Num.8, 2011. Iran.<br />
6) J.H. Argyris, 1960, “Energy theorems and structural analysis”, Butterworths Scientific publications, London, UK.<br />
7) R. Aguiar, 2005, “Analisis estatico de estructuras”, Colegio de ingenieros civiles de Pichincha, Quito, Ecuador.<br />
8) H.P. Gavin, 2012, “Strain energy in linear elastic solids”, Duke University, Department of Civil and Enironmental Engineering, USA.<br />
9) A. Nealen, M. Müller, R. Keiser, E. Boxerman, M. Carlson, “Physically Based Deformable Models in Computer Graphics” in Computer Graphics Forum, Vol. 25, issue 4, 2005 <br />
10) T.M. Wasfy, A.K. Noor, “Computational strategies for flexible multibody systems” in Appl. Mech. Rev. vol 56, no 6, Nov 2003<br />
11) G.R. Liu, 2003, “Mesh free Methods: Moving Beyond Finite Element Methods”, CRC Press, USA.<br />
12) J. S. Przemieniecki, 1968, “Theory of matrix structural analysis”, McGraw-Hill. Inc, USA<br />
13) G.D. Smit, 1978, “Numerical Solution of Partial Differential Equations by Finite Difference Methods”, 2nd ed. Oxford Applied Mathematics and Computing Science Series, UK.<br />
14) M. Müller, 2008, “Real Time Physics course notes”, Siggraph USA.<br />
15) K.J Bathe, 1995, “Finite element procedures in engineering analysis”, Prentice Hall, USA.<br />
<br />
7. Key words<br />
Finite Element, Finite Differences, Variational mechanics, Euler-Bernoulli beamUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-6352511023055453909.post-79266652831341540652012-03-30T08:20:00.000-07:002012-03-30T08:20:07.819-07:00Nonlinearities in structural mechanicsTwo years have already gone in the preparation of this thesis and now it seems in order to pass to the next part: the study of stochasticity.<br />
Altogether with the preparation of our next article I am already summarizing and setting things up for the account for uncertainties in the structural design.<br />
For such purpose, and after so much research into elasticity, dynamics and numerical methods, I have done the following scheme where most of the nonlinearities (which not surprisingly are often associated to randomness) can be fit into.<br />
The scheme is based on the ubiquitous "Governing Equations" that serve as basis for every mechanician.<br />
<ul>
<li>System's internal balance equations (Statics or dynamics)</li>
<ul>
<li>Nonlinear damping </li>
</ul>
<li>Constitutive equations (Material)</li>
<ul>
<li>Plasticity</li>
<li>Viscosity</li>
<li>Creeping</li>
<li>Hiperelasticity</li>
</ul>
<li>Kinematic equations (Geometry)</li>
<ul>
<li>Large deformations with small strains</li>
<li>Large strains</li>
<li>Buckling</li>
<li>Instability</li>
</ul>
<li>Boundary conditions</li>
<ul>
<li>Forces</li>
<ul>
<li>Pressure</li>
<li>Loads</li>
<li>Wind</li>
<li>Waves</li>
<li>Friction</li>
</ul>
<li>Displacements</li>
<ul>
<li>Contact</li>
<li>Link rupture</li>
</ul>
</ul>
</ul>
In the following months I will try to expand this list at the same time as I will try to understand how these nonlinearities are tackled in a deterministic manner.<br />
<br />
The main point of my thesis is that stochastic methods are way more suitable for this purpose than deterministic ones...we will see...:)<br />
<br />
Soon I will be getting back to my loved Ljubljana for a while, far from noisy Barcelona...Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6352511023055453909.post-604390946901034282012-02-09T12:53:00.108-08:002012-02-20T06:39:46.384-08:00The Rayleigh-Ritz method explained for humans<div style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;">
</div>
<br />
<span style="font-size: large;"><b>Preliminaries</b></span> <br />
At last, I feel ready to explain the key concept needed to follow the steps in the Finite Element Method: the notion of STRAIN ENERGY!<br />
The problem with this concept is that is as simple as it looks, ergo all the attached complications must come from somewhere else...<br />
For the animation below I have chosen a classic spring to illustrate the concept (yes I know, is also a classic example...). Could have been anything else capable of storing energy, as a phone battery or a dam, but this seems more adequate given we are talking about structures.<br />
The graph (click on it to see it moving) represents the relation between the applied force to stretch the spring and the actual displacement of the spring. So far, this is pure Hooke's law from secondary school (F=Kx)...<br />
Also, the area that gets shadowed when the spring gets "tensioned" is, in mathematical terms, an integral of the drafted curve.<br />
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: left; text-align: left;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4tlw5xAbV8OU2Ank9zVuztDafyNcOhp_vhuYVCYCA9Pq_uo9F-p8T8eE008eWryzLyJuDmZ0vwtBt_YrrBZINyn6tMukkgwWR_0XggNgtFr7q_ejsXsR3-IAayybG9WUJMou7fu_dzXSi/s1600/Strain+energy.gif" imageanchor="1" style="clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" height="125" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4tlw5xAbV8OU2Ank9zVuztDafyNcOhp_vhuYVCYCA9Pq_uo9F-p8T8eE008eWryzLyJuDmZ0vwtBt_YrrBZINyn6tMukkgwWR_0XggNgtFr7q_ejsXsR3-IAayybG9WUJMou7fu_dzXSi/s200/Strain+energy.gif" width="200" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><div style="text-align: left;">
Displacement e vs Force F on a spring</div>
<div style="text-align: left;">
of elastic material. Shaded area represents</div>
<div style="text-align: left;">
stored strain energy. When pulled with</div>
<div style="text-align: left;">
a force F its tip deforms an amount e.</div>
<div style="text-align: left;">
When released it pulls back with the</div>
<div style="text-align: justify;">
same force F. </div>
</td></tr>
</tbody></table>
Given this particular, although very common case of a material (an elastic one), there is a straight tilted part in the curve that is called "elastic domain". If one keeps pulling the spring further then we still wouldn't break it, but instead we cannot expect it to recover its initial shape. The spring has plastified and we are in the horizontal part of the graph...but that is another story.<br />
So, this "triangle" underneath the tilted part has an area, an integral, a scalar value in squared centimeters. The value of such integral is, not in centimeters but in N per meter or Joules (we are comparing force vs displacement), so is an Energy!<br />
<br />
<br />
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGVE4yB29khlXrrWsgwciK6iXg7zheNDmlFT9avZBb9xce5LMe30ynbz18QcNGerDrDGUhbffVxBfnZsQC4bgInh_ribsAc0F01ZYXjU71Bxuzi4zzSRpjsT2hRmUYeto6uXmAzdbFK0E7/s1600/Strain+energy-vs-F.gif" imageanchor="1" style="clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" height="125" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGVE4yB29khlXrrWsgwciK6iXg7zheNDmlFT9avZBb9xce5LMe30ynbz18QcNGerDrDGUhbffVxBfnZsQC4bgInh_ribsAc0F01ZYXjU71Bxuzi4zzSRpjsT2hRmUYeto6uXmAzdbFK0E7/s200/Strain+energy-vs-F.gif" width="200" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Applied force on the tip F vs potential energy</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjY8Tz1wx-Y_7OuE3-hcOb8Q6Y3v_kmu-hpj49dYTbN3E-yiExScnXA3v6u6ErcAHmVNCeHn4k-QjynTUHaTiTBOSakVTtyAdMNrX7UjAU8gBiOouCNFV3IksnvJZWDvl9xK2bWimJXwCbd/s1600/Strain+energy-vs-e.gif" imageanchor="1" style="clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" height="125" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjY8Tz1wx-Y_7OuE3-hcOb8Q6Y3v_kmu-hpj49dYTbN3E-yiExScnXA3v6u6ErcAHmVNCeHn4k-QjynTUHaTiTBOSakVTtyAdMNrX7UjAU8gBiOouCNFV3IksnvJZWDvl9xK2bWimJXwCbd/s200/Strain+energy-vs-e.gif" width="200" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: left;">Displacement e vs potential energy</td><td class="tr-caption" style="text-align: left;"><br /></td><td class="tr-caption" style="text-align: left;"><br /></td><td class="tr-caption" style="text-align: left;"><br /></td></tr>
</tbody></table>
And the shape of its curve, against the same displacement e or force F (click the animations) happens to be that of a parable (wasn't it obvious?)...<br />
Well, and so far for the basics. Let's now think of a solid beam or column and put it in the place of our spring. When loaded, it would deform, would store elastic energy in its material ready to be released as soon as the applied force leaves. Normally things tend not to greedily accumulate energy but just the opposite. In Nature, a state of balance is that where things store a minimum amount of potential energy.<br />
This basic principle in general applies for almost everything in life, and always does in physics. A drop of water in a cloud that has absorbed thermal energy and stored some of it as potential energy would release this as soon as it can, becoming rain when there is a lot of them, a capacitor in a circuit or even the adapter of a laptop store a differential of potential that make them useful, etc. This is the famous <a href="http://en.wikipedia.org/wiki/Minimum_total_potential_energy_principle">principle of minimum total potential energy</a> (not to be mistaken with the <a href="http://en.wikipedia.org/wiki/Principle_of_minimum_energy">principle of minimum energy</a>, which also applies but in other fields).<br />
<br />
<span style="font-size: large;"><b>Relating strain energies and forces</b></span><br />
<br />
The way engineers have found a beam or column or piece of metal can store energy is by means of five types of loading: axial, bending, torsion, direct shear and traverse shear. Actually this is the way they have found they can stress things. As for every stress there should be associated a strain and hence some potential energy, this is tantamount as to say that they store energy. Though disputable, this is a convention and so we will accept it in the absence of a better one.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSIs6hx8GZA4B_2hc_8BvgTaSPS1QUpiIx21lWEri5gKttVp3Z4EW0nwoyTnZ3jMy5D-2ekvtqoWgAAMe4YZEfZ1jzuCRQV3YUKGTSUjBUDE48Jo_wg4pms3kQSg6efg_mhr9kBni6WF0j/s1600/Strain-energies.jpg" style="margin-left: auto; margin-right: auto;"><img border="0" height="203" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSIs6hx8GZA4B_2hc_8BvgTaSPS1QUpiIx21lWEri5gKttVp3Z4EW0nwoyTnZ3jMy5D-2ekvtqoWgAAMe4YZEfZ1jzuCRQV3YUKGTSUjBUDE48Jo_wg4pms3kQSg6efg_mhr9kBni6WF0j/s320/Strain-energies.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container">
<tbody>
<tr><td class="tr-caption" style="text-align: center;">Resume of the
strain energies associated to each type of applied force in engineering.
Traverse shear has been omitted as is generally neglected.</td></tr>
</tbody>
</table>
</td></tr>
</tbody></table>
The good thing about this convention is that the job of assimilating stored potential energies for each type has already been done for us and put up in the shape of a formula. The table above gives the relation for each one of them in relation to the applied force and in relation to the caused strain.<br />
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4vsiTULCdYXUb8m1hGmINtdTX7oHE_rNQGua00hktdYEMmTE9yypPgylPaCy-y9IVaWoFxUA_aE3fRmQaIkLoSDfs9S6WGKVkT_zwxwanmpprXiwAvRnVKkAnp3YJN2IVjPAEhsR65Mg5/s1600/Axial.gif" imageanchor="1" style="clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4vsiTULCdYXUb8m1hGmINtdTX7oHE_rNQGua00hktdYEMmTE9yypPgylPaCy-y9IVaWoFxUA_aE3fRmQaIkLoSDfs9S6WGKVkT_zwxwanmpprXiwAvRnVKkAnp3YJN2IVjPAEhsR65Mg5/s1600/Axial.gif" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The compressed beam under axial force F stores energy U of a value according to the formula.</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlPuE6tOrpVIH71SM31B8K1VQ5F1QBmwrUNuJH_-R0auRtQUemYAIB_FUyXCl4MsZJNf7g8VMWi2ZzHP4LKaPB_hQsBN1lCyB9XJqUrxyicQMJaoprcwsPzDH7cGbj4Of0yRzCa8feayrR/s1600/Bending.gif" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlPuE6tOrpVIH71SM31B8K1VQ5F1QBmwrUNuJH_-R0auRtQUemYAIB_FUyXCl4MsZJNf7g8VMWi2ZzHP4LKaPB_hQsBN1lCyB9XJqUrxyicQMJaoprcwsPzDH7cGbj4Of0yRzCa8feayrR/s1600/Bending.gif" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The same beam, under flexural bending moment.</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5jWZ_NKc44PKDR1SCQFOJr-L-V9CfCwlY9knLKY3vPGXVni_C5KwReKGmE0s-GH2-txkbvHudjjS3BFdJSyEBNQMSBuSl1fUx9uQSTQ1Rq2MHFSI2rwAsxJGQ1pjMg1L7aNBUerExsw7A/s1600/Shear.gif" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5jWZ_NKc44PKDR1SCQFOJr-L-V9CfCwlY9knLKY3vPGXVni_C5KwReKGmE0s-GH2-txkbvHudjjS3BFdJSyEBNQMSBuSl1fUx9uQSTQ1Rq2MHFSI2rwAsxJGQ1pjMg1L7aNBUerExsw7A/s1600/Shear.gif" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Similarly for shear</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcCVEByjy4ZwGmzXnH_nkuWnFK9XDfkb-HMSvX5QzpIcqDb2ZGLIfxl4WJK7K157c14FXX0bDOmFIVwnQJ6XCKISsNZeLvyjXzdSWRf2E7DC-l8VWXzKY3Yc3wCQg1zfecHSWkd_QFdjpR/s1600/Torsion.gif" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcCVEByjy4ZwGmzXnH_nkuWnFK9XDfkb-HMSvX5QzpIcqDb2ZGLIfxl4WJK7K157c14FXX0bDOmFIVwnQJ6XCKISsNZeLvyjXzdSWRf2E7DC-l8VWXzKY3Yc3wCQg1zfecHSWkd_QFdjpR/s1600/Torsion.gif" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">...and now for torsion</td></tr>
</tbody></table>
<span style="font-size: large;"><b>The Rayleigh-Ritz method</b></span><br />
<br />
And now we have all the concepts and are ready to work.<br />
The <b>Rayleigh–Ritz method</b> (after <a href="http://en.wikipedia.org/wiki/Walther_Ritz" title="Walther Ritz">Walther Ritz</a> and <a class="mw-redirect" href="http://en.wikipedia.org/wiki/Lord_Rayleigh" title="Lord Rayleigh">Lord Rayleigh</a>-Wikipedia), is considered a variational method. This is so because it is based in the calculus of variations. When applied to structural mechanics the varying value is the value of the strain potential energy, that is to be equilibrated against the work done by the external forces.<br />
What we will try to do is to find what is the configuration, the state of the beam or group of beams, where the total energy of the system "external forces + internal stresses" gives a lowest value for the value of the energy. <br />
<br />
It has eight fairly simple steps (this is also arguable, but this is how I understand it best) which I will try to picture as clearly as possible:<br />
<br />
<b>Step 1:</b> Define the internal stored energy function (always an integral from the table above or a combination of them) and the external (a function of the caused displacement times the applied force).<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><img alt="" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAARkAAAArCAIAAADDt2tSAAAG6klEQVR4nO2cX2hTVxzHz8OFPAh9EPJwRx4GhQnFVci2B6EPVy5UUNimEFhXWkTBsohKqSkKk9gVLVYUFNOVqNShRBqtoNBhshRhWhva+SBrjYUwZPnz0A288QZWuRzuHm6atun9c27uuX+Q3+etSdqc8/v9vuf8zu/8bpEMAAANkNsDAICPBNASANABtAQAdAAtAQAdQEsAQAfQEgDQAbQEAHQALQEAHUBLAEAH0BIA0AG0BAB0AC0BAB1ASwBAB3paEmKDLNoMy8ZzUv0DOHOLZza8Gwrn/qP27TWkSppvHMXmL8K5cOfGNztvPcW0R7EVTxjHkPzMQEuj8TbZp7I83qo5BVvwqkPVoLsvSWK2i0MIoU7uXm5F5QPVUmofhzr5dNFOHxQWzgcQQog7E30tqLyPX2UGWMSdixU/2DiKRjxiHCPExGgHgxDr73/w9L1KVOLi1dO7ff5TqUXnQtabDm2Eco6nLBLM4alXGobGuXDgeKZM91sbUZbPne3JtxpBWXkzFuRS/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6fkm8ghBDa2Tb0y/Bz8l2vMBe+/Dx1wOe7qJs7ySZ7iJowjkJl+ee2XbtaNmxBkpg9crTzU8ZY7bLZfjxcSCavcdx6Ht0buv0waZgYC7EIw5hoHjcV4s071GQvojW88CxgfmagxdZE1gyS+CISnnsnZUO+PTeNfFAt/n5lfQm3i3yaD9+9yzE9U4vKC2LiLH/ryVgrodFwITk89ZosuW2a+p6m/qTGljEtPh9+RPRJS5ha7KziAS0JsQjzuesN8zXERDiULstSeTKIetdi112EGM+n/82Gavsknp8MHoq+Xbjx5XavGK2GJC6d6GX1HipxGpyJs6xRAYkarmupsjzeSjPBs4LySJkjNR9i1ho3S9Fe1BctVYt3D3Rl36396JFqcB2lykJyinOCzac423FbSzhzc4/PG1cE1eI9LjiplNpWFkb8m8/6bpFPcVy0JMlCLMJ8Hbp9jjs7tyJjJ48BRkjC48hwXdUeyjIqy+OkaTAVXNYSzoU7UahvevYh6bWPTZTfJPa2HXtSOzrj+fvfb2+sQbuCmBhqjz/FsiwlL7Uipud25j2WxcTF3R5ZgGRZXvnjQv2B9nJurJ1hfiC+xLMTMTHymaNpsLtaWi1PBhH7bfvQY1cz7JcPun0Iodod14a+O1e3pg3/qKR36i/5ZbK9J1r4IGVDa6+2ekLtOHO569HSi/5anU3rXzI4ylpx2FkruZ3jAcDHAmgJAOgAWgIAOoCWAIAOoCUAoANoCQDoAFoCADr8D72j8MwrkgZHAAAAAElFTkSuQmCC" style="margin-left: auto; margin-right: auto;" /></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The internal strain energy is the sum of all the possible combinations of internal strains from the table above</td><td class="tr-caption" style="text-align: center;"><br /></td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><img alt="" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAH4AAAAeCAIAAABltT2FAAAEDklEQVRoge2aQWjTUBjHv0PAw6AHo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ef+OSWEGesV+TcwW7qDCdhFb9MHvK4d3ouLgz7tPrAInuE6nHxMNkZ6wuZ8FYUfy1mR+OnENV3J0O0L9mAxEWpHuZtYX5yILLD47/5xtGmoBJHrFcSl9sBAKi+sXOP85I489BaA2qfkFyovbQ53eP4NfGhs31BJY5YjzMTuz2diWVFO1P07nerzLHABKhjrPhLVVeX7geIznlsw6msf3uyHwEA8oYnON7o51yHKPUqAEH6emrOrdxTVbX1ZxAXaVnvGi3rXaNlvWu0rHeN3xbyUcUMPrC6AAAAAElFTkSuQmCC" style="margin-left: auto; margin-right: auto;" /></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The external applied energy is the result of multiplying the external forces by the displacement</td><td class="tr-caption" style="text-align: center;"><br /></td></tr>
</tbody></table>
<br />
<b>Step 2:</b> Arbitrarily and happily (well, almost...) choose one function where the dimensions of the beam and the variable in the internal stored energy function get related. Multiply it by a dummy parameter (we will call it u overlined). The function chosen v is an approximation, so we overline it also to denote this.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><img alt="" height="139" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAeEAAADSCAIAAADyse/uAAAgAElEQVR4nO2de3RTZb73t13BvrMQzjpiXcbBhTNZiqcLYaaOeJxTXMH6llFnwMtkBMEutKOdCR6YiOVUR4xYtVAEpKfBDhRlKILNQAtyr8EKhTZcCrbTEqrltTVJKRlamyaFtmFnv3/spM1lX559SfLs8Pv8pSXd2f3uZ3/3s5/ndyEoAAAAAFeIRJ8AAAAAwAp4NAAAAL6ARwMAAOALeDQ2kC0NH6SrCYIgsrU7bK5Enw4AADgAHo0J7gv/m6ndYfuR6rJtmKomntRZf0z0KQEAkHjAo9G56nJdk3gIf6/rip/pH0jLmnk1XcH/3pylSl11elDilwEAoHzAo1Hxd5e+UvmDxIP4GvJzz/Txfapx5/xU8GgAACjwaGScJ9+Yqbd5pR6mp3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52wdSU19bGuZqKaDg0VMR7N0VRytJc+YLjrDZ4NG50HH3jVsZ1sZEsANLl6onrKQ337JuR8hjut1kIrBqORpeT/S43zn+PsjRXuuBYqw0ejRtDruqHVAzRpiNZAFeshQeQMu5ko7elZNKYt45died3SoJNw5Hn3GVP/VrTDxjuD42gLM2VLjjWaoNHYwdp02eOW7cn4q0r2ErjZMf+KsQkXdmwHfzTbVPMHdgF97PDrGGgvYBO39peVRVV2B4vFKa5wgXHWm3waPwYrFw5Tl90OXy8R7SAiSfXd68bNwf3PZ8IGDUMWEa2dkMDb2H1BKM4zRUtON5qg0djSMfX+T+bVRvfNWd2/O2Gmbeuk95nMr7gpaFQFKi5ggXHXG3waAzxuQ9n3176T+5CYvHC5z782PgV9Uq7+bDSUChK1Fy5guOuNng0lvSZXv35p/VYPNftJ95In12H2gYFIzDSUCjK1FypguOuNng0nrTXzJxpdGAwKRmq/nBiYcWA8u48jDQUilI1V6bg2KsNHo0n5EDd8w9VdiR6o4UcOPn8z1djmX3FDyYaCkW5mitRcAWoDR6NK0PVKzM+PZHg8f7/vn4l0/AdSls7LMFCQ6EoWXPlCa4AtcGjseWq87PZz1ndCTwDv2PF9BdrOGu3Y07iNRSKwjVXmOCKUBs8GmMGqo2ViSzE5at/t+BbCe3ecSDRGgpF8ZorSnBFqA0ejTPk4GAik7P8g4PYZu8ik2ANhaJ8zZUkuCLUBo8GAADAF/BoAAAAfAGPBgAAwBfwaAAAAHwBjwYAAMAX8GgAAAB8+f9ly6kicbGFuQAAAABJRU5ErkJggg==" style="margin-left: auto; margin-right: auto;" width="320" /></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The "dummy function" we will introduce into the energy formula can be any from above. The more elaborated, the higher the precision.</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTrCE8BiUhH6Hnd6oQecSJw92X5JBAYimfES6k17uYa2WvUM5wS_C3RpINY0xiYhghF5Sz5OxxR6OJmsMVVCwG4riLXFLBl8GjCrKjOFeesyjmfcEb6n2UNUKtTTxAVz6B6N2VIb3qcI0V/s1600/Dummy+functions.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="202" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTrCE8BiUhH6Hnd6oQecSJw92X5JBAYimfES6k17uYa2WvUM5wS_C3RpINY0xiYhghF5Sz5OxxR6OJmsMVVCwG4riLXFLBl8GjCrKjOFeesyjmfcEb6n2UNUKtTTxAVz6B6N2VIb3qcI0V/s400/Dummy+functions.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Two possibilities of approximation functions (without the U parameter). It is known that beams deflect quadratically.</td></tr>
</tbody></table>
<br />
<b>Step 3: </b>Solve, by means of integral calculus, the integral in <b>step 1</b> with the chosen function in <b>step 2</b>. This will provide a relation between the dummy parameter and the internal energy. For the example below, where normally only bending moment is considered:<br />
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="clear: left; float: left; margin-bottom: 1em; text-align: left;"><tbody>
<tr><td style="text-align: center;"><a href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKMAAAE1CAIAAAAERsc9AAAKt0lEQVR4nO2d3YGrIBCF7YmerMM26MYC6Ml9wPiDaHSD56Bzvqd7N25mhk/AuBGaQdigYScgQMi0FWTaCjJtBZm2gkxbQaatINNWkGkryLQVZNoKMm0FmbaCTFtBpq0g01aQaSvItBVk2goybQWZtoJMW0GmrSDTVpBpK8i0FWTaCjJtBZm2gkxbQaatINNWkGkryLQVZNoKMm0FmbaCTFtBpq3wBtNN0zSN8yH+L3RNk/9JG769U/AuHtodHvo5bIpw8jUqrzE9epxczY0d2lT9LtNZ8sX0wWFTtO/nFZb3mI5NOzX0pHZyX66XyTSJhcnJwWRi7uRT0y/7/foMSEbv5MDpfZIo8883xx+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7czT0ev6cjv3s7dibJ42jKl52jRqLyvItBVk2goybQWZtoJMW0GmrSDTVpBpK8i0FWTaCn/hh4sWvLSKxAAAAABJRU5ErkJggg==" imageanchor="1" style="clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img alt="" border="0" height="200" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKMAAAE1CAIAAAAERsc9AAAKt0lEQVR4nO2d3YGrIBCF7YmerMM26MYC6Ml9wPiDaHSD56Bzvqd7N25mhk/AuBGaQdigYScgQMi0FWTaCjJtBZm2gkxbQaatINNWkGkryLQVZNoKMm0FmbaCTFtBpq0g01aQaSvItBVk2goybQWZtoJMW0GmrSDTVpBpK8i0FWTaCjJtBZm2gkxbQaatINNWkGkryLQVZNoKMm0FmbaCTFtBpq3wBtNN0zSN8yH+L3RNk/9JG769U/AuHtodHvo5bIpw8jUqrzE9epxczY0d2lT9LtNZ8sX0wWFTtO/nFZb3mI5NOzX0pHZyX66XyTSJhcnJwWRi7uRT0y/7/foMSEbv5MDpfZIo8883xx+PDVDeYHruYasenVgZG305lm+6+/Lg9SmyeGfn/Wy6XR7YBfXpW9n4zRFlrq1sO/HipEnOgvk3F6aTN3U+yPSdbAbNbjOMb67OPh4+PxidLUzvHbk0nZwuMn03uYk36ehtMnannDA9+5RpGqsenHbfWclCSt7D1dFbpuGsLpjG7rv9ZL06st1MscnHp9WR+SuynOnyH+rK8BLT2dsje90rN6+vX9n04yXOp/fBPoGSy7q6uvZbTJdnFDZ/Cq91WD6JTO+w+Ty2HrGfh0wfUPU9r6vItBVk2goybQWZtoJMW0GmrSDTVpBpKzzVtPfeOcfO4kk8z3R0HG9ZsXN5EtDG6vu+6zrnnHOu67q+7y/9+tKxTF8F11hd1zUb2rY987tbxzJ9FVBjte3ut/qOp9s9x/WAacDfQSTa9/1xY3nvt79Vv+N6OHNxijCdHbeXZMfwp5g+2QghkP/giTB9Rtje79bv+3wjcGXXbjry9CuyeJnCvQGAaKyDy7HIySZ46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CHq9Mg2CXq9Mg6DXK9Mg6PXKNAh6vTINgl6vTIOg1yvTIOj13hY+eJdbsUSmaQnc87bJEmOLeDLNSqD4OwbvmsZ538r0Enq9pcNPg3aQ6RX0eu+bp2V6Bb1emQZBr1emQdDrhZpOHqG2s8jJYMp013XNhnShqvfyXtNrtiucTNy31Al9XY0QwlTdZNo5RxnMEKb31r2YSBYbLIVzLg4b3nuW9bZt4/Ie0bT3nrWID8J0dtwGjOHR9HLw6LoOrDx267gQW0yJdc4hTCctngUZ1zkXO/odQbfEfhxPaOLyPbWYZtG2bc3pXeVgarhgus4WOajtIOE4ksOujOLoDRtFslww3SzG2Nr+nWVrmjJVR+g3D66N3jVIPS97Ms29/K6Ey/N0DVK/9uZI13XcAbMq/nNFVoPgk7JXbFeKH/+WbqKvv3meThm3f5g243rrJmx53jxPb4n7r0W37972Y8ub5+kcny+4eWOebc3TkTD/rcWQZ1vz9Mg4bL9y98wDbM3Tw8KzoYuxYRjMzdPj0O38R7gd16bm6fFyLE7PH9dWxnBD8/Tcnz8/MNWv7czT0ev6cjv3s7dibJ42jKl52jRqLyvItBVk2goybQWZtoJMW0GmrSDTVpBpK8i0FWTaCn/hh4sWvLSKxAAAAABJRU5ErkJggg==" width="105" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Laterally loaded beam</td></tr>
</tbody></table>
<img alt="" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMMAAABLCAIAAABC/qRIAAAJPElEQVR4nO2dT2gb2RnA32FAh4APAR1m8U2wAeFqwW0oWXSYMqCUlnbZZVXW7MYNThuD2rUxrl2ndKs1Zu3GxgvZVq7WjiFtgoxn7Z7q3VhR8MG7a61MDnZlyQGH/aM/h5QSyeOSXYbH9PBG/0YzmhlpJFnj73dK7In0NPq97733ve9NkAgAZoDa3QDAIoBJgDmASYA5gEmAOYBJgDmASeoI3JwDIc/yFm53SzoBMKkGQj7M2sYeZtvdjo4ATKrBUeTtbmbzP+1uRmcAJqkjcDdt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Yycza5zy9/aufn3gY6mmPPAKp29NuGU5Pdr+u02tIbiAZJJ8Vgeo0TKTjsLscCD3XXa1F/Wvf4ljK+xNjpf+Gm/C20WGaefkx1tktni8dV8KTrqzecQkxxwHIumjVSblAtdcXFzE+TBLsdP/mPtJX/SZKB5FRs43JQWVC3p9n1eMZVIZru6cW8bfb0ZN6tmhNSYJfPQtsgAWol6HtBLBfLSPacr5aCG/MTgkf1mtnKGkWqEWNOPv77DjAG2m+SaV9iAdTu4bMeN3ubg9fFw4H92yuYhKeUYRaWJEVMP5MEu5542XRZ9dLH9KqYjWXpWUVe9xcV9hfiPoNpT9A86OSZjk39ROMYiimD1cYRkSlq7M3zqoI21zpjkjJp2kVy/arq7Bg2ybx5kwqfAYpPaev7M4Z8AkfmPB9QsfjFZNxuom4b0H1y7C3LkFWNokvPfg171sWLZznn20BTsg5mNdk1Q0Orz3qve+5k5u4ahXsZwD0MKiJknPYFBCRy0UTvkHKJYNpzEf+vNLtXMHgIQlTSo8TUUJHVtp+cdBR6FarfzPQC0saVKDVDxgT4h6HVBbogMwqQqBm32h9NAFIep1wGO4dQAmVSFwN222Yvk2mKQTMKkaGN3qAUyqBmbc9QAmKYBT/gHqx97oM5y+NQ5ZAH2ASYoUz6PB/5+kFzAJMAcwCTAHMAkwBzAJMAcwCTAHMAkwBzAJMIf/Az/fXI7V5wfdAAAAAElFTkSuQmCC" /><br />
Internal strain energy due to the weight on the tip is given here as a function of the angle of rotation of the beam, but also is generally rounded as the second derivative of the displacement (v'').<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMqC8D7WcHkcrAAw_jv1v99RFe7I5s2bB3gohD6l3LUN_arWPP50BEQu-gJV-DfKOZqwrk35lIUwSC3uukcMe-yc2nx4hlGEQnTP4ChvBKHKrBfj7IzEEdTPOT0MmQqiakz-uKlTMT8aDa/s1600/Dummy-derivative.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="85" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMqC8D7WcHkcrAAw_jv1v99RFe7I5s2bB3gohD6l3LUN_arWPP50BEQu-gJV-DfKOZqwrk35lIUwSC3uukcMe-yc2nx4hlGEQnTP4ChvBKHKrBfj7IzEEdTPOT0MmQqiakz-uKlTMT8aDa/s400/Dummy-derivative.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Obtention of the second derivative of the "dummy" function</td></tr>
</tbody></table>
<br />
A very important remark: it is assumed from the beginning that the result will not be accurate!!<br />
<br />
<b>Step 4:</b> Do the same for the external applied energy.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPnLQvpE9RoX6ZISQOM-QUdZ745iWpnRRBY7rTP9Tc8BIyn52dwT_SUM4jXa4NDIECrvAiH3-jwRPpMePT1KB_PH20M1F-Rr-Ktkt3ld8PkWJBxlgCk6PRPmQ0HIXWNeykZ9NlAGccD4qA/s1600/integration.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPnLQvpE9RoX6ZISQOM-QUdZ745iWpnRRBY7rTP9Tc8BIyn52dwT_SUM4jXa4NDIECrvAiH3-jwRPpMePT1KB_PH20M1F-Rr-Ktkt3ld8PkWJBxlgCk6PRPmQ0HIXWNeykZ9NlAGccD4qA/s1600/integration.jpg" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The "dummy" function and its second derivative substituted into the potential strain (Ui) and the external (Ue) energies.</td></tr>
</tbody></table>
<b>Step 5:</b> Add the two energies in order to get the total energy of the system, V (column internal + external forces)<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZ-DDdVApM9uEUyeME9haiQaR_lIbc6Pzj-vs0IGTbL6Veqv1pialHp7tMOd6AoJNCmsea7VR8MFtfkpKM5VZpCkSsdtdSHscXs1KCS7exJ0BU7cR6uGcfk1DAgVe5sfNrobrxXC8Cs2LJ/s1600/Ve.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="53" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZ-DDdVApM9uEUyeME9haiQaR_lIbc6Pzj-vs0IGTbL6Veqv1pialHp7tMOd6AoJNCmsea7VR8MFtfkpKM5VZpCkSsdtdSHscXs1KCS7exJ0BU7cR6uGcfk1DAgVe5sfNrobrxXC8Cs2LJ/s200/Ve.jpg" width="200" /></a></div>
<br />
<b>Step 6:</b> Applying the theorem of minimum total potential energy, the derivative of the total energy with respect to the parameter must be 0.<br />
<br />
<img alt="" height="68" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAmQAAACGCAIAAAD8YAFLAAAgAElEQVR4nO3daVwT19oA8EkIhE0hIoqCooKivSgIFYFiXbFc16u9iksv1KXVVi2ILC0VrbZWrdSlFavS1kJ93Ypal16vG26oqCBaRVBEkbIoAgIGQgjJvB/O+zvv3AQmAyQzmeT5f2ozz8w8g3N4wpwz5xAkAAAAAGgRXCcAAAAAGDoolgAAAIAWUCwBAAAALaBYAgAAAFpAsQQAAAC0gGIJAAAAaAHFEgAAANACiiUAAACgBRRLAAAAQAsolgAAAIAWhl4slUplaWnp9evXDx06lJiYGBERMW3aNF9fXycnp/Lycq6zAwAAYBIMvVju3r3b2dm5b9++xH8bPnw4SZJ79uwhGFi3bp3mkevr6y0tLWn2iouLY/1yAQAAGCJDL5bYjz/+SK1kX3/9NfpcLpcXFBTEx8cLhUJqgFAoTEhIyM3Nra+vb+2YT58+3bBhg9qOEolk/fr1BQUFzc3NbF0cAPoSFxeHbuzVq1erbWLyRbNN8JEv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MgIDAzcvHkzjomMjMQxn376aXZ2tqenZ3l5uU4uGQCDdfHiRXznSyQShULBdUYAGDqWimVTU9PEiRM1K6W3t/edO3eokQkJCdRm7Orq2r6Hoh9++KHaubp06ZKWlkaNef/99/FWMzMzX1/fkpKSDl0nAHxA/Zo4d+5crtMBgAfYmxu2ubk5KSnJy8tLLBZLJJKQkJD9+/drjqYpKSnx8fERi8W+vr6JiYntXoe9rq5uwYIF9vb25ubmb7zxxsqVK1++fKkWk5WVNXDgQAsLiyFDhmzZsgWevgIT0adPH1wsDx06xHU6APAA24s/AwC4lZOTgytlRyb9AMCkQLEEwLSsWrUKF8t33nmH63QA4AcolgCYliFDhuBimZSUhD7ctWsXTIwMAA0olgCYkGfPnlFHvT179owkyaqqqp49e1In7gAAqIFiCYAJoU7U7O7ujj4MCwv79ddfuU0MAAMHxRIAExIeHo6L5ZtvvkmS5KZNm5KTk7nOCwBDB8USABMSEhJCfQzr7u5+8uRJrpMCgAegWAJgQjIzM729vS0tLQcOHLhq1SrNl48BAC2CYgkAAABoAcUSAAAA0AKKJQAAAKAFFEsAAABACyiWAAAAgBZQLAEAAAAtoFgCAAAAWkCxBAAAALSAYgkAAABoAcUSAAAA0AKKJQAAAKAFFEsAAABACyiWAAAAgBZQLAEAAAAtoFgCAAAAWkCxBAAAALT4X5yci0agQSKQAAAAAElFTkSuQmCC" width="320" /> <br />
<br />
<b>Step 7: </b>Get the value of the parameter from the equation above.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgq0wj5vTxBXdMUqVhRL3aMfVWyNypf4UF_HLLFtmG6aDwiHcRbZnyHIrSIoPYbI2nq6YR97rtpeSTqBtLFr2USxHmh1MurGYyYPQjOAq9kl3PHlSBIkI1S9wKfdElJl_zm1IPpKOx_jHwg/s1600/u1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="112" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgq0wj5vTxBXdMUqVhRL3aMfVWyNypf4UF_HLLFtmG6aDwiHcRbZnyHIrSIoPYbI2nq6YR97rtpeSTqBtLFr2USxHmh1MurGYyYPQjOAq9kl3PHlSBIkI1S9wKfdElJl_zm1IPpKOx_jHwg/s200/u1.jpg" width="200" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2pLqapimNvcb1jAJzXwnqCGd1c0snP3nMtSShaz4XK3zst97dJ3B4eCmdRESyxvYgSmSz9EtHgCXpc3xWVC69F9PoojyDluXhPIjSwrF9K7TAsZLFtwVn1nBYOTcSyqtQIzLDLLfqxl85/s1600/u1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><br /></a></div>
<b>Step 8:</b> Substitute its value in the step 2 to get the real function of the displacement.<br />
<br />
<img alt="" height="92" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAhgAAACeCAIAAAD/kOSrAAAgAElEQVR4nO2deUATR/vHh0BIIICAyCEIiIiCVrzFA49ab8UTr6pUSz2q9UCt9aJabT0rVV+tgqBWqq2KtYq31gutB/U+QEVAkUPuGwLJ/v6Y953fNkDYZGezmzifvzSZfebZ8N39JjszzwCKQCAQCAQWAL4TIBAIBIJ+Q4yEQCAQCKwgRkIgEAgEVhAjIRAIBAIriJEQCAQCgRXESAgEAoHACmIkBAKBQGAFMRICgS3v3r1btGiRt7e3mZmZmZmZj4/P4sWL3717x3deBML/Ex8fP3nyZFdXV7FYbGVl1bVr17CwsLKyMizBiZEQCKy4dOlSgwYNQA2sra1Pnz7Nd3YEAkVR1MaNG0UiUU2Vent7JyUlsY9PjIRA0J43b95YWVkFBgbGxcWVlZUVFhYePXrUw8MDXqUSieT+/ft850j40Pnjjz9MTU2XLFny9OlTuVyenp4eFhYmk8mgSj08PEpKSlh2QYyEQNCeOXPm/PDDDyovvn//3s3NDV6lQ4cO5SUxAgHRvn37y5cvq7wYFxcnFouhSj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UsMMCXOTVq1cvvhMh8ImQVSpYiRIjIeiO6urqZs2aeXh41KztKgSGDRsGGOwASDBshKxSwUqUGAlBp4SHhwMA9u/fz3ciqjx8+BAA0LdvX74TIfCPMFUqZIkSIyHoFLlc3qxZszVr1vCdiConT540MjK6c+cO34kQ+EeYKhWyRImREHRNTEyM0C5RiqJOnjw5c+ZMvrMgCAUBqlTIEiVGQuCBa9eu8Z2CKvHx8bi22yMYBkJTqZAlSoyEQCAQCKwgRkIgEAgEVhAjIRAIBAIriJEQCAQCgRXESAgEAoHACmIkBAKBQGAFMRICgUAgsIIYCYFAIBBYQYyEQCAQCKwgRkIgEAgEVhAjIRAIBAIriJEQCAQCgRXESAgEAoHACmIkBAKBQGAFMRICgUAgsIIYCYFAIBBYQYyEQCAQCKz4PyrltfFCfo9dAAAAAElFTkSuQmCC" width="320" /><br />
<br />
And that is it. For whatever value of x along the beam now we have a value of the deflection. Unfortunately the approximation chosen v(x)=u1(x/l)^2 is not very accurate, so a calculated displacement of the tip would diverge at least 25% from the analytical...but that is another story...<br />
The most difficult steps are actually 1 and 2, where one should memorize the functions in order to master the method. The rest is easy algebra and very simple first order derivatives.<br />
The Rayleigh-Ritz method eventually evolved into the nowadays ubiquitous Finite Element (did you recognize the shape function there?).<br />
<br />
Well, I really hope this helps anyone who reads it as much as it helped me to write it...<br />
<br />
Enjoy!Unknownnoreply@blogger.com6tag:blogger.com,1999:blog-6352511023055453909.post-46477231840456713492012-01-31T14:02:00.000-08:002012-01-31T14:02:05.350-08:00A brief summary on the stiffness method for structural engineeringWell, another year has gone by, and it has been a while since the last post. Life in Barcelona is being quite busy, so I am not dealing very well with my updates...This doesn't mean I am not researching, but apparently the topics I am getting to are deeper and deeper, so conclusions are getting harder to write...<br />
<br />
The following is a summary of what I found here: <a href="http://www.civil.iitb.ac.in/%7Esghosh/CE317/history-stiffness-method.pdf">www.civil.iitb.ac.in/~sghosh/CE317/history-stiffness-method.pdf</a><br />
<br />
It is authored by the famous Zienkiewicz, so it must be a warranty of rigor. Out of it I have written my own summary, on pure chronological order, that goes as follows:<br />
<br />
<br />
<ul>
<li>1862: Glebsch, Alfred wrote an algorithm for 3D trusses where no moments were involved. The models one would get out of it is as putting lots of springs connected by pins.</li>
<li>1883: Saint Venant, Andre wrote an article with comments on Glebsch's methodology.</li>
<li>1880: Manderla, Heinrich proposed an iterative method for the solution of the set of equations involved in pin-jointed trusses</li>
<li>1892: Mohr, Otto introduced the notion of "secondary stresses". He was referring to the moments. They were called secondary then as in steel and iron trusses the main ones were axial.</li>
<li>1910: Richardson provided the study of the stresses in a dam by means onf the Airy stress function.</li>
<li>1914: Bendixsen, Axel published a method similar to the slope deflection for structures with internal hyperstaticity.</li>
<li>1915: Wilson&Money proposed the slope deflection method, apparently unaware of Bendixsen's.</li>
<li>1922: Ĉaliŝev gave an iterative solution of successive approximations for frames without side-sway.</li>
<li>1930: Cross, Hardy published his famous method for redistributing unbalanced moments according to the internal stiffnesses of the composing bars. This provided the engineer with the necessary joint rotations.</li>
<li>1932: Grinter wrote a method for multi-story frames with side-sway called "method of successive corrections"</li>
<li>1935: Southwell tackled the problem of the constraints in a similar manner giving his famous method of "systematic relaxation of constraints", commonly known as dynamic relaxation.</li>
<li>1941: Courant, Richard explained his "variational methods for the solution of problems of equilibrium and vibrations". As he was a mathematician, the practical application of his work results still of some difficulty.</li>
<li>1943: McHenry in U.S. and Hrenikoff in Canada proposed a lattice analogy for the solution of stress problems so that continuum could be represented as a set of beams.</li>
<li>1944: Kron, Gabriel provided a complete algorithm in matrix form for 3D frames. In the 1930s it became fashionable to show the whole process of solving the linear equations in this systematic manner.</li>
<li>1954: Argyris wrote his "Energy theorems ans structural analysis", <i>a comprehensive presentation of both the force and the displacement method for complicated airplane structures</i>.</li>
<li>1967: Zienkiewicz presented his summary of the "Finite Element Method in structural Mechanics".<br /></li>
</ul>
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6352511023055453909.post-44586896351377796992011-11-26T09:26:00.001-08:002011-11-26T15:41:57.465-08:00Tetrahedra discretization of a beamIn this post I will introduce the advances of the last weeks regarding the discretization into tetrahedra of a beam with Grasshopper's VB component.<br />
<br />
<b>Rotations about an arbitrary axis</b> <br />
An important part of the research has been devoted to the topic of 3d rotation, as for locating the sub-nodes of the beam appropiately we need to transform the beam's local coordinates with respect of its axis into the actual world's coordinates for Rhino to interpret.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRCB7OP9SGjwzZuIKPipviHMwqJeKBcdC-mhyTb4oAHw5RVqGOiLDuNLIF0ZkXMmgnDURKIk2GdI3mWXoBrQACVrTIBOKpNeahIAfX_Uk2Uc8Ev-Atolpn_own6-uc27TIjaVAckky-Wo7/s1600/rotations.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="205" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRCB7OP9SGjwzZuIKPipviHMwqJeKBcdC-mhyTb4oAHw5RVqGOiLDuNLIF0ZkXMmgnDURKIk2GdI3mWXoBrQACVrTIBOKpNeahIAfX_Uk2Uc8Ev-Atolpn_own6-uc27TIjaVAckky-Wo7/s400/rotations.jpg" width="400" /></a></div>
The most popular way to make it are rotation matrices (<a href="http://www.siggraph.org/education/materials/HyperGraph/modeling/mod_tran/3drota.htm">here</a> there is a thorough explanation on how), but also quaternions have been contemplated and still not fully discarded. Apparently rotation matrices present some numerical drifting problems when utilized for many time steps, as well as other problems that quaternions solve quite easily (mentioned <a href="http://www.ogre3d.org/tikiwiki/Quaternion+and+Rotation+Primer">here</a>).<br />
<br />
<b>Tetrahedra subdivision</b><br />
The beam is defined by two points arbitrarily located in 3d space. These points define a director vector and also a distance.<br />
The remaining geometric properties (height h and width b) in the attached code have been assimilated to a percentage of the lenght. Also the number of segments s has been hardcoded to be proportional to the width but it could be anything else.<br />
The attached code uses two functions: one for coordinate transformation by means of transformation matrices and another for matrix multiplication. The rest of the subroutine simply locates points along the beam according to the width b, the height h and the segment separation s.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikxMK8IPNcRVL97yjnahvNbNeocXtnd3h5YofjMi0-Hb3I0dx9TMDmTrYfglxIkicvwFJdf-J6D6kBK8BTlmKb8tK14ZGTF_pgK8sGpMx2auFDO8rMsdH3Wqdhifo_Fhi08OJBaTNl7ANo/s1600/tetrahedra-2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="205" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikxMK8IPNcRVL97yjnahvNbNeocXtnd3h5YofjMi0-Hb3I0dx9TMDmTrYfglxIkicvwFJdf-J6D6kBK8BTlmKb8tK14ZGTF_pgK8sGpMx2auFDO8rMsdH3Wqdhifo_Fhi08OJBaTNl7ANo/s400/tetrahedra-2.jpg" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihj8WRH4cflRQgH02NLOuUyl_L1qBYT2uodKQOK4hFJWvBPgr21-Q09KLtromO3sftmE7zhGbHP2CoBGp02R1ki1Jh78pYjxOhvPZn4AcQ5dC2kjFXNn8ier9Uvr2zNULj1p9pqaLmRL_9/s1600/tetrahedra.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><br /></a></div>
<br />
The image above shows how the beam is discretized into nodes located at the edges. Each segment gives place to five embedded tetrahedron (right).<br />
Local axes of the beam will be later utilized for the matter integration.<br />
<br />
<b>Code</b><br />
<blockquote class="tr_bq">
<i><span style="font-size: x-small;">Private Sub RunScript(ByVal ni As Point3d, ByVal nj As Point3d, ByVal angle As Double, ByRef geom As Object) </span></i></blockquote>
<blockquote class="tr_bq">
<i><span style="font-size: x-small;"> 'This code was written by Rabindranath Andujar, Jordi Casabo, Jaume Roset, Vojko Kilar and Simon Petrovcic with the purposes<br /> 'of the development of Rabindranath Andujar's Phd Thesis "Stochastic Simulation and Lagrangian dynamics applied to Structural<br /> 'Design"<br /> 'Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License,<br /> 'Version 1.3 Or any later version published by the Free Software Foundation; With no Invariant Sections, no Front-Cover Texts,<br /> 'And no Back-Cover Texts.<br /><br /> 'This code is intended to facilitate a tetrahedric discretization of a beam provided two points (initial and final). It should<br /> 'serve to be inserted into a wider matter integration code (FEM/FVM/MSS, etc) for which nodal coordinates, topological table<br /> 'and material properties are eventually given.<br /><br /> Dim L As Double 'lenght of the beam<br /> Dim s As Double 'space between divisions<br /> Dim b As Double 'width of the beam<br /> Dim h As Double 'height of the beam<br /> Dim u,v,w As Double 'components of the director vector of the beam<br /> Dim lines As New list(Of rhino.geometry.line) 'geometric representation of the beam<br /> Dim Nodes As New List(Of rhino.geometry.point3d) 'geometric nodes of the beam, where matter will be integrated<br /> Dim n As Integer 'number of nodes<br /> Dim i As Integer 'auxiliar index<br /> Dim line As Rhino.Geometry.Line 'auxiliar instantiation variable<br /> Dim Node As rhino.geometry.point3d 'Auxiliar coordinates for the shape of the beam<br /><br /> 'The components of the director vector of the beam are the difference between the initial and the final points<br /> u = nj.X - ni.X<br /> v = nj.y - ni.y<br /> w = nj.z - ni.z<br /><br /> ' The lenght of the beam is the norm of the vector<br /> L = math.Sqrt(u * u + v * v + w * w)<br /> 'We have chosen arbitrarily here a height h=10% of the lenght, width b=60% of the height and spacing a portion of the width<br /> h = L * 0.1<br /> b = h * 0.6<br /> n = int(L / b)<br /> s = L / n<br /><br /> 'The nodes located in the vertices of the section are positioned along the beam by means of matrix<br /> 'transformations with respect to the director vector and the initial point of the beam.<br /> 'The function TransformCoordinates serves such purpose.<br /> 'u,v,w coordinates enter divided by the lenght of the beam in order to operate with a normalized vector.<br /> 'The angle parameter represents the rotation of the section around the longitudinal axis (local x)<br /><br /> ' local z axis<br /> ' |<br /> ' | angle of rotation along x local axis<br /> ' | /<br /> ' *---*<br /> ' h| |/|<br /> ' -|-+-|---local y axis<br /> ' | | |<br /> ' *---*<br /> ' b<br /> For i = 0 To n<br /> 'Top left corner of the beam section<br /> Node = TransformCoordinates(ni.X, ni.Y, ni.Z, -b / 2, h / 2, S * i, u / L, v / L, w / L, angle)<br /> 'Then we collect their values into Rhino Point3Ds<br /> Nodes.Add(Node)<br /> 'Top right corner of the beam section<br /> Node = TransformCoordinates(ni.X, ni.Y, ni.Z, b / 2, h / 2, S * i, u / L, v / L, w / L, angle)<br /> 'Then we collect their values into Rhino Point3Ds<br /> Nodes.Add(Node)<br /> 'Lower right corner of the beam section<br /> Node = TransformCoordinates(ni.X, ni.Y, ni.Z, b / 2, -h / 2, S * i, u / L, v / L, w / L, angle)<br /> 'Then we collect their values into Rhino Point3Ds<br /> Nodes.Add(Node)<br /> 'Lower left corner of the beam section<br /> Node = TransformCoordinates(ni.X, ni.Y, ni.Z, -b / 2, -h / 2, S * i, u / L, v / L, w / L, angle)<br /> 'Then we collect their values into Rhino Point3Ds<br /> Nodes.Add(Node)<br /> Next i<br /><br /> 'This loop repeats the cross section of the beam (a b x h rectangle) using the vertices previously collected<br /> 'along a beam defined by an initial and a final points.<br /> 'Also the longitudinal edges of the prism are iterated for every segment of beam.<br /> For i = 0 To nodes.Count - 8 Step 4<br /> 'Four sides of the section<br /> Line = New Rhino.Geometry.Line(nodes(i), nodes(i + 1))<br /> Lines.Add(Line)<br /> Line = New Rhino.Geometry.Line(nodes(i + 1), nodes(i + 2))<br /> Lines.Add(Line)<br /> Line = New Rhino.Geometry.Line(nodes(i + 2), nodes(i + 3))<br /> Lines.Add(Line)<br /> Line = New Rhino.Geometry.Line(nodes(i + 3), nodes(i))<br /> Lines.Add(Line)<br /> 'Longitudinal segments of the edges<br /> Line = New Rhino.Geometry.Line(nodes(i), nodes(i + 4))<br /> Lines.Add(Line)<br /> Line = New Rhino.Geometry.Line(nodes(i + 1), nodes(i + 5))<br /> Lines.Add(Line)<br /> Line = New Rhino.Geometry.Line(nodes(i + 2), nodes(i + 6))<br /> Lines.Add(Line)<br /> Line = New Rhino.Geometry.Line(nodes(i + 3), nodes(i + 7))<br /> Lines.Add(Line)<br /> Next i<br /><br /> 'Here we iterate in order to make the outer longitudinal diagonals and the inner cross sectional ones<br /> 'On each segment we have to change the direction, so they are alternated. It was carefully done, as the<br /> 'final purpose is to create the edges of tetrahedra that do not overlap.<br /> 'To such end, diagonals change every two segments in outer faces as in inner cross sectional connections.<br /> For i = 1 To nodes.Count - 4 Step 8<br /> 'Top faces<br /> Line = New Rhino.Geometry.Line(nodes(i), nodes(i + 5))<br /> Lines.Add(Line)<br /> Line = New Rhino.Geometry.Line(nodes(i + 5), nodes(i + 8))<br /> Lines.Add(Line)<br /> 'Right side faces<br /> Line = New Rhino.Geometry.Line(nodes(i + 2), nodes(i + 5))<br /> Lines.Add(Line)<br /> Line = New Rhino.Geometry.Line(nodes(i + 5), nodes(i + 10))<br /> Lines.Add(Line)<br /> 'Bottom faces<br /> Line = New Rhino.Geometry.Line(nodes(i + 2), nodes(i + 3))<br /> Lines.Add(Line)<br /> Line = New Rhino.Geometry.Line(nodes(i + 3), nodes(i + 10))<br /> Lines.Add(Line)<br /> 'Left side faces<br /> Line = New Rhino.Geometry.Line(nodes(i), nodes(i + 3))<br /> Lines.Add(Line)<br /> Line = New Rhino.Geometry.Line(nodes(i + 3), nodes(i + 8))<br /> Lines.Add(Line)<br /><br /> 'Sectional diagonals<br /> Line = New Rhino.Geometry.Line(nodes(i), nodes(i + 2))<br /> 'Lines.Add(Line)<br /> Line = New Rhino.Geometry.Line(nodes(i + 3), nodes(i + 5))<br /> 'Lines.Add(Line)<br /> Next i<br /> 'And the final section to close the prism: perimetral and diagonal lines<br /> Line = New Rhino.Geometry.Line(nodes(nodes.count - 4), nodes(nodes.count - 3))<br /> Lines.Add(Line)<br /> Line = New Rhino.Geometry.Line(nodes(nodes.count - 3), nodes(nodes.count - 2))<br /> Lines.Add(Line)<br /> Line = New Rhino.Geometry.Line(nodes(nodes.count - 2), nodes(nodes.count - 1))<br /> Lines.Add(Line)<br /> Line = New Rhino.Geometry.Line(nodes(nodes.count - 1), nodes(nodes.count - 4))<br /> Lines.Add(Line)<br /> 'Diagonal goes from the last node to the node in the opposite side of the section<br /> Line = New Rhino.Geometry.Line(nodes(nodes.count - 1), nodes(nodes.count - 3))<br /> Lines.Add(Line)<br /> 'Finally everything is delivered to Rhino for visualization<br /> Geom = Lines<br /> End Sub </span></i></blockquote>
<blockquote class="tr_bq">
<i> <span style="font-size: x-small;"> Function TransformCoordinates(a As Double, b As Double, c As Double, x As Double, y As Double, z As Double, u As Double, v As Double, w As Double, Alpha As Double) As rhino.Geometry.Point3d<br /> 'This function returns a Rhino.Geometry.Point3d rotated around an arbitrary axis.<br /> 'The initial point of the beam is defined by a,b and c coordinates<br /> 'Point's coordinates to be transformed are x,y,z<br /> 'The axis is defined by the u,v,w coordinates, which should be normalized<br /> 'Angle is provided in the Alpha parameter<br /> Dim CAlpha As Double 'Auxiliar variable for storing the cosine of the rotation around the axial axis<br /> Dim SAlpha As Double 'Auxiliar variable for storing the sine of the rotation around the axial axis<br /> Dim d As Double 'Auxiliar variable for storing the sine of the rotation around the y axis<br /> Dim Vector(3) As Double 'Auxiliar Vector to store and make the neccessary operations<br /> Dim Point As rhino.Geometry.Point3d 'The returned instance of a modified Point3d<br /><br /> 'Initialize variables<br /> Vector(0) = x<br /> Vector(1) = y<br /> Vector(2) = z<br /> Vector(3) = 1<br /> d = math.Sqrt(v ^ 2 + w ^ 2)<br /> CAlpha = math.Cos(Alpha)<br /> SAlpha = math.Sin(Alpha)<br /><br /> 'The translation matrix moves the point to the a,b,c coordinates<br /> Dim Transl(,) As Double = { _<br /> {1, 0, 0, a}, _<br /> {0, 1, 0, b}, _<br /> {0, 0, 1, c}, _<br /> {0, 0, 0, 1}}<br /> 'Rotation matrix along the world's x axis<br /> Dim Rotx(,) As Double = { _<br /> {1, 0, 0, 0}, _<br /> {0, w/d, v/d, 0}, _<br /> {0, -v/d, w/d, 0}, _<br /> {0, 0, 0, 1}}<br /> 'Rotation matrix along the beam's y axis<br /> Dim Roty(,) As Double = { _<br /> {d, 0, u, 0}, _<br /> {0,1, 0, 0}, _<br /> {-u, 0, d, 0}, _<br /> {0, 0, 0, 1}}<br /> 'Rotation matrix along the world's z axis<br /> Dim Rotz(,) As Double = { _<br /> {CAlpha, -SAlpha, 0, 0}, _<br /> {SAlpha, CAlpha, 0, 0}, _<br /> {0, 0, 1, 0}, _<br /> {0, 0, 0, 1}}<br /><br /> 'Each transformation is made sequentially as a matrix-vector product<br /> Vector = MultiplyMatrixVector(Rotz, Vector)<br /> Vector = MultiplyMatrixVector(Roty, Vector)<br /> Vector = MultiplyMatrixVector(Rotx, Vector)<br /> Vector = MultiplyMatrixVector(Transl, Vector)<br /><br /> 'And eventually data is returned into the auxiliar point3d<br /> Point.X = Vector(0)<br /> Point.y = Vector(1)<br /> Point.z = Vector(2)<br /> Return point<br /> End Function</span></i> </blockquote>
<blockquote class="tr_bq">
<i><span style="font-size: x-small;"> Function MultiplyMatrixVector(Matrix(,) As Double, Vector() As Double) As Double()</span></i><br />
<i><span style="font-size: x-small;">
'This function returns the product of a matrix times a vector.</span></i><br />
<i><span style="font-size: x-small;">
'Matrix column number must be the same as vector's components number:</span></i><br />
<i><span style="font-size: x-small;">
'</span></i><br />
<i><span style="font-size: x-small;">
</span></i><br />
<i><span style="font-size: x-small;">
' | | | |</span></i><br />
<i><span style="font-size: x-small;">
' | | | | | |</span></i><br />
<i><span style="font-size: x-small;">
'M=| mxn | , V=|n| ===> M·V=|n|</span></i><br />
<i><span style="font-size: x-small;">
' | | | | | |</span></i><br />
<i><span style="font-size: x-small;">
' | | | |</span></i><br />
<i><span style="font-size: x-small;">
'</span></i><br />
<i><span style="font-size: x-small;">
Dim i,j As Integer 'Auxiliar indexes</span></i><br />
<i><span style="font-size: x-small;">
Dim n As Integer 'Matrix's column number</span></i><br />
<i><span style="font-size: x-small;">
Dim VAux() As Double 'Auxiliar temporary vector</span></i><br />
<i><span style="font-size: x-small;">
</span></i><br />
<i><span style="font-size: x-small;">
'Vector's size is reset to the number of matrix's columns</span></i><br />
<i><span style="font-size: x-small;">
n = Ubound(Matrix, 1)</span></i><br />
<i><span style="font-size: x-small;">
ReDim VAux(n)</span></i><br />
<i><span style="font-size: x-small;">
'In this loop we proceed to the summation of the products of the matrix terms times the</span></i><br />
<i><span style="font-size: x-small;">
'corresponding vector terms.</span></i><br />
<i><span style="font-size: x-small;">
'First we iterate by the columns</span></i><br />
<i><span style="font-size: x-small;">
For i = 0 To n</span></i><br />
<i><span style="font-size: x-small;">
'And then by each term of the vector</span></i><br />
<i><span style="font-size: x-small;">
For j = 0 To n</span></i><br />
<i><span style="font-size: x-small;">
'Auxiliar vector accumulates the products in the corresponding index</span></i><br />
<i><span style="font-size: x-small;">
Vaux(i) = Vaux(i) + Matrix(i, j) * Vector(j)</span></i><br />
<i><span style="font-size: x-small;">
Next j</span></i><br />
<i><span style="font-size: x-small;">
Next</span></i><br />
<i><span style="font-size: x-small;">
'And then we return the resulting vector</span></i><br />
<i><span style="font-size: x-small;">
Return Vaux</span></i><br />
<i><span style="font-size: x-small;">
End Function</span></i> </blockquote>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6352511023055453909.post-15279631131422281682011-10-31T14:42:00.000-07:002011-10-31T14:42:02.317-07:00Yet one more article...And another article published!<br />
This once in the journal Iranian journal WASJ (World Applied Science Journal).<br />
This is the link: <a href="http://www.idosi.org/wasj/wasj14%288%2911/21.pdf"><cite>www.idosi.org/wasj/wasj14(8)11/21.pdf. </cite></a><br />
<br />
<cite><b>Abstract</b>: Structural dynamics is a rather complex field of research that concerns to a broad range of disciplines, from structural engineering to graphics animation, robotics or aeronautics. A primary consequence of this is an overwhelming amount of literature on the topic, apparently disconnected, as each author focuses on his / her particular field. To complicate things further, the daunting list of numerical methods severely blurs the scope of the researcher, making it very difficult to understand what their purpose is in each case and even if these are applicable to the analysis of structural behavior. This paper presents a reference framework where researchers and developers from diverse disciplines can assess the main methods currently used in structural dynamics simulation. A direct correlation is made between methods to solve Ordinary, Partial and Algebraic Differential Equations and their physical counterparts Time, Matter and Constraints. It is also discussed their application in different industries.</cite><br />
<cite></cite><br />
<cite><br />
</cite><br />
<cite>Thanks to my mentors, Jaume and Vojko</cite><br /><cite> </cite>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6352511023055453909.post-13402300217880947592011-10-09T09:44:00.000-07:002011-10-09T16:34:51.768-07:00My first SCI Indexed Article!<div style="text-align: justify;">
Here it is! A whole achievement! </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
After some while working hard in collaboration with the Faculty of Architecture of the University of Ljubljana the result of our research appears published in a scientific Journal: <a href="http://www.ttem-bih.org/ttem_3_2011.html">http://www.ttem-bih.org/ttem_3_2011.html</a>.<br />
As a computational dynamics rookie myself I find it very hard to understand the whole complexity of the topic. For that reason, we decided to make an introductory overview of what is needed to start scouting through such a steepy and accidented path. I hope it serves to somebody else...</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
However, from all the article my favourite part is at the beginning: </div>
<div style="text-align: justify;">
<blockquote>
<i>“Structural engineering is the art of molding materials we don’t wholly understand, into shapes we can’t fully analyze, so as to withstand forces we can’t really assess, in such a way that the community at large has no reason to suspect the extent of our ignorance.”</i></blockquote>
Which I found as a quote from James E. Amrhein of the Masonry Institute of America...<br />
<br />
Well, happy autumn!</div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6352511023055453909.post-54718758803419210252011-09-25T06:30:00.000-07:002011-09-25T06:30:17.072-07:00First FEM + Lagrange multipliers program in GrasshopperGood, good...summer is about to finish and here I am, back in Ljubljana!<br />
<br />
The last post was created two months ago and a shift in the researching techinques was announced: from C++ under Code:Blocks, Visual Studio or any other IDE (never found the one that fitted my needs), to Visual Basic under Grasshopper...<br />
<br />
What a change! It really has boosted productivity...debugging is now as easy as dragging a panel and linking it to a component, results of the changes in the program can be viewed on real time and also with a bit of tweaking its consequences in a CAD model can be represented...wow..absolutely good...<br />
<br />
In concrete means, during the summer I have been able to produce the whole Grasshopper definition shown below:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0P2cRd2c2iUw0dKvT47QUNIDhl8NC_zjWaEcdBkuuI5IlXgCfS8eil6b9t0qZe-vJ6v2AsLXu_E-DiH4g-KO82KWnfS08DIP8jxGIuewBn30aO-l-vB5GFP5pO7QrbgFIs-f1ozgWDtcb/s1600/GH-FEM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="126" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0P2cRd2c2iUw0dKvT47QUNIDhl8NC_zjWaEcdBkuuI5IlXgCfS8eil6b9t0qZe-vJ6v2AsLXu_E-DiH4g-KO82KWnfS08DIP8jxGIuewBn30aO-l-vB5GFP5pO7QrbgFIs-f1ozgWDtcb/s400/GH-FEM.png" width="400" /></a></div>
<br />
The initial part simply parses data from three files that I chose to be in .txt format, but anyone else could have chosen any other way (i.e. Excel or OpenOffice): Constraints.txt, Nodes.txt and ExternalForces.txt.<br />
The heavy programming components are FEM, LM and LUPD, and I provide their contents here:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjaJOVj0f9ctbPRTNlOSjcJs91woSofpbLgw1V9PaCnd9c6vp1Y1OkYrE-0BUy-qjt6fezJ6JBbMqSQPjGI_-N4npORLCAZUctEKu8ZmlxNzyG25PfUyYqL7QnwgnF4qOr0ZWCRTJHDNFLg/s1600/FEM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="185" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjaJOVj0f9ctbPRTNlOSjcJs91woSofpbLgw1V9PaCnd9c6vp1Y1OkYrE-0BUy-qjt6fezJ6JBbMqSQPjGI_-N4npORLCAZUctEKu8ZmlxNzyG25PfUyYqL7QnwgnF4qOr0ZWCRTJHDNFLg/s200/FEM.png" width="200" /></a></div>
<div style="text-align: justify;">
<b>FEM Component:</b> <br />
<textarea cols="55" name="textfield" rows="20">Private Sub RunScript(ByVal Constraints As List(Of String), ByVal Nodes As List(Of String), ByVal Forces As List(Of String), ByRef Kg As Object, ByRef u As Object, ByRef F As Object, ByRef Geom As Object)
'your code goes here…
Dim Lenght As Double
Dim Lxy As Double
Dim ni As Int16
Dim nj As int16
Dim EModulus As Double
Dim GModulus As Double
Dim Area As Double
Dim Theta As Double
Dim InertiaY As Double
Dim InertiaZ As Double
Dim JModulus As Double
Dim PosNi(2) As Double
Dim PosNj(2) As Double
Dim i As Int16
Dim j As Int16
Dim k As Int16
Dim m As int16
Dim n As Int16
Dim ConstraintType As int32
Dim lines As New list(Of rhino.geometry.line)
Dim KgAux(,) As Double
ReDim KgAux(6 * (nodes.count - 1), 6 * (nodes.count - 1))
For i = 1 To Constraints.Count - 1
ConstraintType = CInt(constraints(i).split(",")(0))
If ConstraintType = 0 Then
ni = CInt(constraints(i).split(",")(1))
nj = CInt(constraints(i).split(",")(2))
Emodulus = CDbl(constraints(i).split(",")(3))
GModulus = CDbl(constraints(i).split(",")(4))
Area = CDbl(constraints(i).split(",")(5))
InertiaY = CDbl(constraints(i).split(",")(6))
InertiaZ = CDbl(constraints(i).split(",")(7))
JModulus = CDbl(constraints(i).split(",")(8))
Theta = CDbl(constraints(i).split(",")(9))
posni(0) = CDbl(nodes(ni).split(",")(0))
posni(1) = CDbl(nodes(ni).split(",")(1))
posni(2) = CDbl(nodes(ni).split(",")(2))
posnj(0) = CDbl(nodes(nj).split(",")(0))
posnj(1) = CDbl(nodes(nj).split(",")(1))
posnj(2) = CDbl(nodes(nj).split(",")(2))
Dim Line As New Rhino.Geometry.Line(posni(0), posni(1), posni(2), posnj(0), posnj(1), posnj(2))
Lines.Add(Line)
Lenght = math.Sqrt((posnj(0) - posni(0)) ^ 2 + (posnj(1) - posni(1)) ^ 2 + (posnj(2) - posni(2)) ^ 2)
Lxy = math.Sqrt((posnj(0) - posni(0)) ^ 2 + (posnj(1) - posni(1)) ^ 2)
'Lets compose the element's matrix first
Dim Ke(11,11) As Double
For j = 0 To 5
For k = 0 To 5
Ke(j, k) = kenini(Lenght, Emodulus, GModulus, Area, InertiaY, InertiaZ, JModulus)(j, k)
Ke(j, 6 + k) = keninj(Lenght, Emodulus, GModulus, Area, InertiaY, InertiaZ, JModulus)(j, k)
Ke(6 + j, k) = kenjni(Lenght, Emodulus, GModulus, Area, InertiaY, InertiaZ, JModulus)(j, k)
Ke(6 + j, 6 + k) = kenjnj(Lenght, Emodulus, GModulus, Area, InertiaY, InertiaZ, JModulus)(j, k)
Next k
Next j
'Then create the transformation matrix components
Dim s1,s2,s3 As Double
Dim c1,c2,c3 As Double
Dim Tinv(11,11) As Double
Dim T(11,11) As Double
If Lxy > 0.0001 Then
s1 = (posnj(1) - posni(1)) / Lxy
c1 = (posnj(0) - posni(0)) / Lxy
Else
s1 = 0.0
c1 = 1.0
End If
s2 = (posnj(2) - posni(2)) / Lenght
c2 = Lxy / Lenght
s3 = math.sin(theta)
c3 = math.cos(theta)
T = Transformatrix(c1 * c2, s1 * c2, s2, -c1 * s2 * s3 - s1 * c3, -s1 * s2 * s3 + c1 * c3, s3 * c2, -c1 * s2 * c3 - s1 * s3, -s1 * s2 * c3 - c1 * s3, c3 * c2)
Tinv = TransformatrixT(c1 * c2, s1 * c2, s2, -c1 * s2 * s3 - s1 * c3, -s1 * s2 * s3 + c1 * c3, s3 * c2, -c1 * s2 * c3 - s1 * s3, -s1 * s2 * c3 - c1 * s3, c3 * c2)
'And proceed to transform the element's matrix into global coordinates
Dim KeAux(11,11) As Double
KeAux = multiply2DMatrices(Ke, Tinv)
Ke = multiply2DMatrices(T, KeAux)
For j = 0 To 11
print(ke(j, 0) & "," & ke(j, 1) & "," & ke(j, 2) & "," & ke(j, 3) & "," & ke(j, 4) & "," & ke(j, 5) & "," & ke(j, 6) & "," & ke(j, 7) & "," & ke(j, 8) & "," & ke(j, 9) & "," & ke(j, 10) & "," & ke(j, 11))
Next
print("****************")
'Once translated into global coordinates, we can assemble the element in the temporary global matrix
For j = 0 To 5
For k = 0 To 5
KgAux(6 * (ni - 1) + j, 6 * (ni - 1) + k) = KgAux(6 * (ni - 1) + j, 6 * (ni - 1) + k) + Ke(j, k)
KgAux(6 * (ni - 1) + j, 6 * (nj - 1) + k) = KgAux(6 * (ni - 1) + j, 6 * (nj - 1) + k) + Ke(j, 6 + k)
KgAux(6 * (nj - 1) + j, 6 * (ni - 1) + k) = KgAux(6 * (nj - 1) + j, 6 * (ni - 1) + k) + Ke(6 + j, k)
KgAux(6 * (nj - 1) + j, 6 * (nj - 1) + k) = KgAux(6 * (nj - 1) + j, 6 * (nj - 1) + k) + Ke(6 + j, 6 + k)
Next k
Next j
End If
Next i
'And parse it into a tree structure for management into Grasshopper
Dim Tree As New DataTree(Of Double)
For m = 0 To ubound(KgAux) - 1
'Iterate over the second dimension of the array
For n = 0 To ubound(KgAux) - 1
'Insert the current value into the DataTree.
'The first dimension ends up as the Path,
'the second dimension ends up as the index.
tree.Insert(KgAux(m, n), New GH_Path(m), n)
Next n
Next m
Kg = tree
F = ReadForces(Forces)
u = InitializeDisplacements(Nodes)
Geom = Lines
End Sub
'<Custom additional code>
Function KeNiNi(L As Double, E As Double, G As Double, A As Double, Iy As Double, Iz As Double, J As Double) As Double(,)
Dim Kaux(,) As Double = { _
{A * E / L, 0, 0, 0, 0, 0}, _
{0, 12 * E * Iz / (L * L * L), 0, 0, 0, 6*E*Iz/(L * L)}, _
{0, 0, 12 * E * Iy / (L * L * L), 0, -6*E*Iy/(L * L), 0}, _
{0, 0, 0, G * J / L, 0, 0}, _
{0, 0, -6*E*Iy/(L * L), 0, 4*E*Iy/L, 0}, _
{0, 6*E*Iz/(L * L), 0, 0, 0, 4*E*Iz/L} _
}
Return Kaux
End Function
Function KeNiNj(L As Double, E As Double, G As Double, A As Double, Iy As Double, Iz As Double, J As Double) As Double(,)
Dim Kaux(,) As Double = { _
{-A*E/L, 0, 0, 0, 0, 0}, _
{0, -12*E*Iy/(L*L*L), 0, 0, 0, 6*E*Iz/(L*L)}, _
{0, 0, -12*E*Iz/(L*L*L), 0, -6*E*Iy/(L*L),0}, _
{0, 0, 0,-G*J/L, 0, 0}, _
{0, 0, 6*E*Iy/(L*L), 0, 2*E*Iy/L, 0}, _
{0, -6*E*Iz/(L*L), 0, 0, 0, 2*E*Iz/L} _
}
Return Kaux
End Function
Function KeNjNi(L As Double, E As Double, G As Double, A As Double, Iy As Double, Iz As Double, J As Double) As Double(,)
Dim Kaux(,) As Double = { _
{-A*E/L, 0, 0, 0, 0, 0}, _
{0, -12 * E * Iz / (L * L * L), 0, 0, 0, -6*E*Iz/(L * L)}, _
{0, 0, -12 * E * Iy / (L * L * L), 0, 6*E*Iy/(L * L), 0}, _
{0, 0, 0, -G * J / L, 0, 0}, _
{0, 0, -6*E*Iy/(L * L), 0, 2*E*Iy/L, 0}, _
{0, 6*E*Iz/(L * L), 0, 0, 0, 2*E*Iz/L} _
}
Return Kaux
End Function
Function KeNjNj(L As Double, E As Double, G As Double, A As Double, Iy As Double, Iz As Double, J As Double) As Double(,)
Dim Kaux(,) As Double = { _
{A*E/L, 0, 0, 0, 0, 0}, _
{0, 12 * E * Iz / (L * L * L), 0, 0, 0, -6*E*Iz/(L * L)}, _
{0, 0, 12 * E * Iy / (L * L * L), 0, 6*E*Iy/(L * L), 0}, _
{0, 0, 0, G * J / L, 0, 0}, _
{0, 0, 6*E*Iy/(L * L), 0, 4*E*Iy/L, 0}, _
{0, -6*E*Iz/(L * L), 0, 0, 0, 4*E*Iz/L} _
}
Return Kaux
End Function
Function Transformatrix(lx As Double, mx As Double, nx As Double, ly As Double, my As Double, ny As Double, lz As Double, mz As Double, nz As Double) As Double(,)
Dim Kaux(,) As Double = { _
{lx, mx, nx, 0, 0, 0, 0, 0, 0, 0, 0, 0}, _
{ly, my, ny, 0, 0, 0, 0, 0, 0, 0, 0, 0}, _
{lz, mz, nz, 0, 0, 0, 0, 0, 0, 0, 0, 0}, _
{0, 0, 0, lx, mx, nx, 0, 0, 0, 0, 0, 0}, _
{0, 0, 0, ly, my, ny, 0, 0, 0, 0, 0, 0}, _
{0, 0, 0, lz, mz, nz, 0, 0, 0, 0, 0, 0}, _
{0, 0, 0, 0, 0, 0, lx, mx, nx, 0, 0, 0}, _
{0, 0, 0, 0, 0, 0, ly, my, ny, 0, 0, 0}, _
{0, 0, 0, 0, 0, 0, lz, mz, nz, 0, 0, 0}, _
{0, 0, 0, 0, 0, 0, 0, 0, 0, lx, mx, nx}, _
{0, 0, 0, 0, 0, 0, 0, 0, 0, ly, my, ny}, _
{0, 0, 0, 0, 0, 0, 0, 0, 0, lz, mz, nz} _
}
Return Kaux
End Function
Function TransformatrixT(lx As Double, mx As Double, nx As Double, ly As Double, my As Double, ny As Double, lz As Double, mz As Double, nz As Double) As Double(,)
Dim Kaux(,) As Double = { _
{lx, ly, lz, 0, 0, 0, 0, 0, 0, 0, 0, 0}, _
{mx, my, mz, 0, 0, 0, 0, 0, 0, 0, 0, 0}, _
{nx, ny, nz, 0, 0, 0, 0, 0, 0, 0, 0, 0}, _
{0, 0, 0, lx, ly, lz, 0, 0, 0, 0, 0, 0}, _
{0, 0, 0, mx, my, mz, 0, 0, 0, 0, 0, 0}, _
{0, 0, 0, nx, ny, nz, 0, 0, 0, 0, 0, 0}, _
{0, 0, 0, 0, 0, 0, lx, ly, lz, 0, 0, 0}, _
{0, 0, 0, 0, 0, 0, mx, my, mz, 0, 0, 0}, _
{0, 0, 0, 0, 0, 0, nx, ny, nz, 0, 0, 0}, _
{0, 0, 0, 0, 0, 0, 0, 0, 0, lx, ly, lz}, _
{0, 0, 0, 0, 0, 0, 0, 0, 0, mx, my, mz}, _
{0, 0, 0, 0, 0, 0, 0, 0, 0, nx, ny, nz} _
}
Return Kaux
End Function
Function Multiply2DMatrices(A(,) As Double, B(,) As Double) As Double(,)
Dim i As int32
Dim j As int32
Dim k As int32
Dim MAux(,) As Double
ReDim MAux(ubound(A, 1), ubound(B, 2))
For i = 0 To ubound(A, 1)
For j = 0 To ubound(B, 1)
For k = 0 To ubound(B, 2)
MAux(i, j) = MAux(i, j) + A(i, k) * B(k, j)
Next k
Next
Next
Return MAux
End Function
Function ReadForces(F As list(Of String)) As datatree(Of Double)
Dim i As Integer
Dim FAux As New datatree(Of Double)
For i = 1 To F.count - 1
FAux.insert(CDbl(F(i).split(",")(1)), New GH_Path(i), 0)
FAux.insert(CDbl(F(i).split(",")(2)), New GH_Path(i), 1)
FAux.insert(CDbl(F(i).split(",")(3)), New GH_Path(i), 2)
FAux.insert(CDbl(F(i).split(",")(4)), New GH_Path(i), 3)
FAux.insert(CDbl(F(i).split(",")(5)), New GH_Path(i), 4)
FAux.insert(CDbl(F(i).split(",")(6)), New GH_Path(i), 5)
Next
Return FAux
End Function
Function InitializeDisplacements(N As list(Of String)) As datatree(Of Double)
Dim i As Integer
Dim NAux As New datatree(Of Double)
For i = 1 To N.count - 1
NAux.insert(0, New GH_Path(i), 0)
NAux.insert(0, New GH_Path(i), 1)
NAux.insert(0, New GH_Path(i), 2)
NAux.insert(0, New GH_Path(i), 3)
NAux.insert(0, New GH_Path(i), 4)
NAux.insert(0, New GH_Path(i), 5)
Next
Return NAux
End Function
</textarea>
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJ1LRnv_sb8kgUKpXzFd0Jg2KRDbicRc7ZNOicBteYQu-qSCFp1bG4HKzMGdzq7sqzE78v2328f2v5EsEwWYKwShuOP-Rp3m6EPAvK61tNTpI14g7Weaty5mxAlKT2ABW-CHbyxBUZ3Ofi/s1600/LM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="178" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJ1LRnv_sb8kgUKpXzFd0Jg2KRDbicRc7ZNOicBteYQu-qSCFp1bG4HKzMGdzq7sqzE78v2328f2v5EsEwWYKwShuOP-Rp3m6EPAvK61tNTpI14g7Weaty5mxAlKT2ABW-CHbyxBUZ3Ofi/s200/LM.png" width="200" /></a></div>
<div style="text-align: justify;">
<b>LM Component:</b> <br />
<textarea cols="55" name="textfield" rows="20">Private Sub RunScript(ByVal Constraints As List(Of String), ByVal Kg As DataTree(Of Double), ByVal u As DataTree(Of Double), ByVal F As DataTree(Of Double), ByRef KgExt As Object, ByRef uExt As Object, ByRef FExt As Object)
'your code goes here…
Dim ConstraintType As Int16
Dim RotationX As Double
Dim RotationY As Double
Dim RotationZ As Double
Dim DisplacementX As Double
Dim DisplacementY As Double
Dim DisplacementZ As Double
Dim i As int32
Dim j As int32
Dim k As int32
Dim ExtraRow As int32
Dim ExtraCol As int32
Dim ni As int32
Dim KgAux As New DataTree(Of Double)(Kg)
For i = 1 To Constraints.Count - 1
ConstraintType = CInt(constraints(i).split(",")(0))
ni = CInt(constraints(i).split(",")(1))
If ConstraintType = 1 Then
RotationX = CDbl(constraints(i).split(",")(3))
RotationY = CDbl(constraints(i).split(",")(4))
RotationZ = CDbl(constraints(i).split(",")(5))
DisplacementX = CDbl(constraints(i).split(",")(6))
DisplacementY = CDbl(constraints(i).split(",")(7))
DisplacementZ = CDbl(constraints(i).split(",")(8))
InsertConstraint(DisplacementX, KgAux, 6 * (ni - 1))
InsertConstraint(DisplacementY, KgAux, 6 * (ni - 1) + 1)
InsertConstraint(DisplacementZ, KgAux, 6 * (ni - 1) + 2)
InsertConstraint(RotationX, KgAux, 6 * (ni - 1) + 3)
InsertConstraint(RotationY, KgAux, 6 * (ni - 1) + 4)
InsertConstraint(RotationZ, KgAux, 6 * (ni - 1) + 5)
End If
Next i
ExtraCol = KgAux.BranchCount
ExtraRow = KgAux.BranchCount
For i = Kg.BranchCount To ExtraRow - 1
For j = Kg.BranchCount To ExtraCol - 1
KgAux.Insert(0, New GH_Path(i), j)
Next j
Next i
j = F.BranchCount + 1
k = 0
FExt = New DataTree(Of Double)(F)
For i = Kg.BranchCount To ExtraRow - 1
FExt.insert(0, New GH_Path(j), k)
k = k + 1
Next
uExt = New DataTree(Of Double)(u)
KgExt = New DataTree(Of Double)(KgAux)
'Dim Txt As New System.IO.StreamWriter("C:\Users\John\Desktop\Matrix1.csv")
'For i = 0 To KgAux.BranchCount - 1
'For j = 0 To KgAux.BranchCount - 1
' print(i & "," & j)
' Txt.Write(KgAux.Branch(i).item(j) & ",")
' Next
' txt.WriteLine()
'Next
'txt.Flush()
End Sub
'<Custom additional code>
Sub InsertConstraint(Value As Double, ByRef K As datatree(Of Double), n As int32)
Dim i As int32
Dim ExtraCol As int32
Dim ExtraRow As int32
ExtraCol = K.BranchCount
ExtraRow = K.BranchCount
For i = 0 To n - 1
K.Insert(0, New GH_Path(ExtraRow), i)
K.Insert(0, New GH_Path(i), ExtraCol)
Next i
K.Insert(Value, New GH_Path(ExtraRow), n)
K.Insert(Value, New GH_Path(n), ExtraCol)
For i = n + 1 To K.BranchCount - 1
K.Insert(0, New GH_Path(ExtraRow), i)
K.Insert(0, New GH_Path(i), ExtraCol)
Next i
End Sub
</textarea>
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7QBp_LarmPxwieBToJvPxR8R6Zq_xyvuCPCiNjxoQJbni2bTwizBCrtxxekrS8tF0-__YHpz3yKYxM3nKd7MtINXagmikv39y2fc_0sPfSE6CcIff1zD3DNTVhxTmjvCgSWFcx7ifudtg/s1600/LUPD.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="177" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7QBp_LarmPxwieBToJvPxR8R6Zq_xyvuCPCiNjxoQJbni2bTwizBCrtxxekrS8tF0-__YHpz3yKYxM3nKd7MtINXagmikv39y2fc_0sPfSE6CcIff1zD3DNTVhxTmjvCgSWFcx7ifudtg/s200/LUPD.png" width="200" /></a></div>
<div style="text-align: justify;">
<b>LUPD Component:</b> <br />
<textarea cols="55" name="textfield" rows="20">Private Sub RunScript(ByVal A As DataTree(Of Double), ByVal X As DataTree(Of Double), ByVal B As DataTree(Of Double), ByRef Xsol As Object)
'your code goes here…
Dim n As Int32
Dim er As Int32
Dim i As Int32
Dim j As Int32
Dim m As int32
Dim BAux() As Double
Dim XAux() As Double
Dim tol As Double
Dim AAux(,) As Double
n = A.BranchCount - 1
ReDim Aaux(n, n)
ReDim Baux(n)
ReDim Xaux(n)
For i = 0 To n
For j = 0 To n
AAux(i, j) = A.Branch(i).item(j)
Next j
Next i
For i = 0 To B.BranchCount - 1
For j = 0 To b.Branch(i).Count - 1
BAux(m) = B.Branch(i).item(j)
m = m + 1
Next j
Next i
tol = 1E-17
LUD(AAux, BAux, n, XAux, tol, er)
Xsol = XAux
End Sub
'<Custom additional code>
Sub LUD(a(,) As Double, b() As Double, n As Integer, x() As Double, tol As Double, er As Int32)
Dim o() As Double
Dim s() As Double
ReDim o(n)
ReDim s(n)
Call Decompose(a, n, tol, o, s, er)
If er = 0 Then
Call Substitute(a, o, n, b, x)
Else
MsgBox("ill-conditioned system")
Exit Sub
End If
End Sub
Sub Decompose(a(,) As Double, n As int32, tol As Double, o() As Double, s() As Double, er As int32)
Dim i As Integer
Dim j As Integer
Dim k As Integer
Dim factor As Double
For i = 0 To n
o(i) = i
s(i) = Math.Abs(a(i, 0))
For j = 2 To n
If Math.Abs(a(i, j)) > s(i) Then
s(i) = Math.Abs(a(i, j))
End If
Next j
Next i
For k = 0 To n - 1
Call Pivot(a, o, s, n, k)
If Math.Abs(a(o(k), k) / s(o(k))) < tol Then
er = -1
Exit For
End If
For i = k + 1 To n
factor = a(o(i), k) / a(o(k), k)
a(o(i), k) = factor
For j = k + 1 To n
a(o(i), j) = a(o(i), j) - factor * a(o(k), j)
Next j
Next i
Next k
If (Math.Abs(a(o(k), k) / s(o(k))) < tol) Then er = -1
End Sub
Sub Pivot(a(,) As Double, o() As Double, s() As Double, n As int32, k As int32)
Dim ii As Integer
Dim p As Integer
Dim big As Double
Dim dummy As Double
p = k
big = Math.Abs(a(o(k), k) / s(o(k)))
For ii = k + 1 To n
dummy = Math.Abs(a(o(ii), k) / s(o(ii)))
If dummy > big Then
big = dummy
p = ii
End If
Next ii
dummy = o(p)
o(p) = o(k)
o(k) = dummy
End Sub
Sub Substitute(a(,) As Double, o() As Double, n As int32, b() As Double, x() As Double)
Dim k As Integer
Dim i As Integer
Dim j As Integer
Dim sum As Double
Dim factor As Double
For k = 0 To n - 1
For i = k + 1 To n
factor = a(o(i), k)
b(o(i)) = b(o(i)) - factor * b(o(k))
Next i
Next k
x(n) = b(o(n)) / a(o(n), n)
For i = n - 1 To 0 Step -1
sum = 0
For j = i + 1 To n
sum = sum + a(o(i), j) * x(j)
Next j
x(i) = (b(o(i)) - sum) / a(o(i), i)
Next i
End Sub
</textarea>
</div>
<br />
Consistently with the hipothesis that numerical methods for structural can be classifed into Time integrators, Matter Integrators, and Constraint Integrators, I have so far distinguished between LM (Lagrange Multipliers) and FEM (Finite Element Method), remaining for a near future the implemementation of a Newmark-Beta component.<br />
The code provided above simply serves to calculate statics of structures, as the time is yet to be integrated.<br />
<br />
I have made the convenient comparisons with a SAP2000 model to verify the exactness of the implementation, with very satisfactory results.<br />
<br />
Well...more to come in future editions!Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6352511023055453909.post-88965756751696649172011-07-17T09:04:00.000-07:002011-08-01T11:36:20.926-07:00Programming FEM with Grasshopper(R) for Rhino(R)In the past year a powerful design tool called Rhinoceros has come into my sphere of activity.<br />
After several attempts of programming the necessary code to experiment with numerical methods using OGRE and C++, I have come to the conclusion that I need some more productive tools. The problem with C++ is that is good for final products and optimized code, but the available libraries for my purposes are normally too specific and complicated, and even simple debugging processes become a nightmare of libraries and strange variables.<br />
<br />
Rhinoceros has an IDE plugin called Grasshopper that allows for visually programming with an object-oriented approach, which is very close to what we are intending now.<br />
The next step in the research is to study the differences that appear when combining different methods in order to assess an optimum path for different applications. When studied with object-oriented mind, the numerical methods can easily be composed into GH components that afterwards we just need to link.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuhrV9uI8fpfji4Q7Ntlr8nlzophVMpYh8X4hd3cunrlbBtzl6wk5KmZwpblHU00k5Meu6n8oTDuLKQwYzCtKOEiyVy1DJwDkq7-tLgcJO2di0haggj1IttOVgzsh70qX11_Anfc1Jmbas/s1600/GH-Methods.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="317" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuhrV9uI8fpfji4Q7Ntlr8nlzophVMpYh8X4hd3cunrlbBtzl6wk5KmZwpblHU00k5Meu6n8oTDuLKQwYzCtKOEiyVy1DJwDkq7-tLgcJO2di0haggj1IttOVgzsh70qX11_Anfc1Jmbas/s400/GH-Methods.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Arrangement of possible components with different integration concepts</td></tr>
</tbody></table>
<br />
One of my main concerns when developing with proprietary non-opensource IDEs and codes comes with the fact that there is always the chance of having to pay fees at some point, not to mention that they are opaque and not always supported by a community willing to help when there is trouble.<br />
However, the case of Grasshopper seems quite strange as there is a strong and dynamic community of researchers and developers also often supported by excellent professionals (at least as far as I have researched, we'll see..).<br />
<br />
Well, lets hope I have made the right decision and GH boosts my research results in the near future.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6352511023055453909.post-13864694218728090312011-07-17T08:05:00.000-07:002011-09-25T05:36:30.555-07:00WHAT DOES SHAPE FUNCTION MEAN IN FINITE ELEMENT FORMULATION?<div class="separator" style="clear: both; text-align: center;">
</div>
Finite Element Analysis is a mathematical tool very extended among engineers. However, after more than a year researching on the topic of computer simulation, where FEA plays such an important role, I haven't yet found a satisfactory explanation on how they really really work...<br />
Hopefully by means of this post I get to clarify some of the topics, trying to remove excessive algebraic and mathematical verbosity that is so annoyingly present everywhere.<br />
<br />
The main background of FEM is that of structural engineering in the 60s. Engineers are very practical people, so initially they devised a system which allowed them to set algebraic equations where the relations between different points or "nodes" of their structures could be set.<br />
These algebraic relations were further proven to be of many different types, not only structural, so also thermal relations could be formulated and many others: all one needed to analyze was a proper discretizacion of the space in the form of a mesh with nodes to relate to each other.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
For our particular case of structural engineering (the one that matters for my PhD thesis), I have tried to illustrate the procedure in its three main steps, so the main ideas come up in a graphic taste:<br />
<br />
<b><u>STEP 1: Discretization</u></b><br />
In this basic yet classic example, I have chosen to divide my sample structure in only 5 elements where nodes are clearly identifiable in the meetings between beams. There are four nodes.<br />
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: left; margin-right: 1em; text-align: left;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAiszdvU6zGiC4LtLP_tARO6qz6eBCo5R__MbfoKJxGQHH2r6tZ2uSHny1VRpOd6rjB9w3qjRjhXSlmCcqP6qEiPYRYNPBq1CPBN1eEuxxPTZSgTcypSQJnHiB9gK8nFOe-ky3ZBO98kmF/s1600/DOFs.jpg" imageanchor="1" style="clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAiszdvU6zGiC4LtLP_tARO6qz6eBCo5R__MbfoKJxGQHH2r6tZ2uSHny1VRpOd6rjB9w3qjRjhXSlmCcqP6qEiPYRYNPBq1CPBN1eEuxxPTZSgTcypSQJnHiB9gK8nFOe-ky3ZBO98kmF/s200/DOFs.jpg" width="200" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Degrees of Freedom</td></tr>
</tbody></table>
Each node will have 6DOF (Degrees Of Freedom): three for linear displacement on each axis (X,Y,Z) and three for rotational around each axis (X,Y,Z), because we are working on 3D. Many examples available provide the more "simple" 2D situation, but in my opinion this only complicates things further.<br />
<br />
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: left; margin-right: 1em; text-align: left;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi71fy_KhCYDTZOIwEFVdCpu5Whj0qBwqh2VxHyq-gHKQVnPtM1Bb7-1b2pkKFW2rBtwp24n9SvZ3GusFq_Xox15R_xQSHza-SaL_Hau_JPE9LZwZEM-x4VisB-7MRDT_6iY86VdfTyr0cm/s1600/Structure.jpg" imageanchor="1" style="clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" height="285" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi71fy_KhCYDTZOIwEFVdCpu5Whj0qBwqh2VxHyq-gHKQVnPtM1Bb7-1b2pkKFW2rBtwp24n9SvZ3GusFq_Xox15R_xQSHza-SaL_Hau_JPE9LZwZEM-x4VisB-7MRDT_6iY86VdfTyr0cm/s400/Structure.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">A sample structure (mesh) and its topology table</td></tr>
</tbody></table>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
Once the nodes are located and there is a network of how they relate to each other, we can consider we have a mesh. In our example, the correlation is depicted in the table: The elements serve to "link" nodes to each other. The table establishes a "topology" for the nodes.<br />
<br />
<b><u>STEP 2: Element characterization and shape functions</u></b><br />
In this step is where FEM formulation and literature get really really awkward and nasty. In fact, this is the core of everything and where FEM differenciates from other ways of solving PDEs.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXt5AVr1e0ubM4jN47PzZpG_8CoQC5apxcc1fU7t7mJ1zWwyUPzvxujqZBjyAwsn4SOE2atVcrFly0NsZYjCX0sSfNk-_Rus5gkgntmWVVRLEWs3H6KB8KTjbGsevHeKke3EjX8eaNp0QX/s1600/TimoshenkoBeam-2.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><br /></a></div>
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: right; margin-left: 1em; text-align: right;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuf2fVOcL1jvbQcLUFWhtuoeB86TdPhQNCDCkDkB8pQAptw44UtMF86VPEDX0Oclk7SGWOO59w3Xmwuf4SWms9Qq7XdEmG0wU3699XqKuHLXczH0jbNzePrwe4LAa4JEqCEGNLF8tVFzbO/s1600/FEMShapes.gif" imageanchor="1" style="clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" height="151" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuf2fVOcL1jvbQcLUFWhtuoeB86TdPhQNCDCkDkB8pQAptw44UtMF86VPEDX0Oclk7SGWOO59w3Xmwuf4SWms9Qq7XdEmG0wU3699XqKuHLXczH0jbNzePrwe4LAa4JEqCEGNLF8tVFzbO/s400/FEMShapes.gif" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Different types of Finite Elements</td></tr>
</tbody></table>
In reality, and despite its mathematical complexity (also unneccesary to be explained so much in detail in my opinion), what we are looking for is a way of characterizing the material properties of the element. For such purpose, the method requires that the behavior of those links among nodes obeys some formula. This formula is the actual <b>Shape Function</b>. In fact, the shape function can be any mathematical formula that helps us to interpolate what happens wherever there are no points to define the mesh. This "ghost" entity that appears between nodes is in fact the <b>Finite Element</b>. <i><b>In practical terms, as engineers we are more interested in the implementation of the FEM, not so much on its formulation, so what is important to understand is that for different shape functions we obtain different element matrices</b></i>.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjn5wjc4kOBiKL3dsEFsx3NvrrLT61eudR-E-zJQc08_qiXZrsh4K9An0JgNle3vJ9aTFg3j0PnwEw9kad4SsZxGQQHATRWfrIAsxMSbkph2pwO1CqpvJWRoVxwEH49Yop6Vs8jO2ImuVrh/s1600/beamKe.jpg" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjn5wjc4kOBiKL3dsEFsx3NvrrLT61eudR-E-zJQc08_qiXZrsh4K9An0JgNle3vJ9aTFg3j0PnwEw9kad4SsZxGQQHATRWfrIAsxMSbkph2pwO1CqpvJWRoVxwEH49Yop6Vs8jO2ImuVrh/s1600/beamKe.jpg" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">2DOF Beam element matrix</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuzBg4h9TG_LfY1uE6vs0x2BH7NMXW9nf0g-C9eJ_uTBfK1DlJFc0w-eDndOBM8ILWUAtEC89SD_uhoz27Ox_gwu0EgsnSg6iPscXGZM6sTLaHs9fyr7FeJLKuCK7ADnPeGWZDvcQKdnB3/s1600/3DBeamKe.jpg" style="margin-left: auto; margin-right: auto;"><img border="0" height="226" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuzBg4h9TG_LfY1uE6vs0x2BH7NMXW9nf0g-C9eJ_uTBfK1DlJFc0w-eDndOBM8ILWUAtEC89SD_uhoz27Ox_gwu0EgsnSg6iPscXGZM6sTLaHs9fyr7FeJLKuCK7ADnPeGWZDvcQKdnB3/s320/3DBeamKe.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">3DOF Beam Element matrix</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXt5AVr1e0ubM4jN47PzZpG_8CoQC5apxcc1fU7t7mJ1zWwyUPzvxujqZBjyAwsn4SOE2atVcrFly0NsZYjCX0sSfNk-_Rus5gkgntmWVVRLEWs3H6KB8KTjbGsevHeKke3EjX8eaNp0QX/s1600/TimoshenkoBeam-2.gif" style="margin-left: auto; margin-right: auto;"><img border="0" height="151" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXt5AVr1e0ubM4jN47PzZpG_8CoQC5apxcc1fU7t7mJ1zWwyUPzvxujqZBjyAwsn4SOE2atVcrFly0NsZYjCX0sSfNk-_Rus5gkgntmWVVRLEWs3H6KB8KTjbGsevHeKke3EjX8eaNp0QX/s400/TimoshenkoBeam-2.gif" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">3DOF Timoshenko Beam element matrix<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEP5igSyyXV0ziB4AqqOWesyy-RDncF55A3KgahvSnOzNYClh8KsadGE1fxYHjZXwDvoyl9aXjchMmg-2Bqy8aG87TzVIDycx3o4S-BkdX8w60UGA8omdAeXrKiSBeVBn6NLcL-YnSAgXw/s1600/Sin+nombre.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="163" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEP5igSyyXV0ziB4AqqOWesyy-RDncF55A3KgahvSnOzNYClh8KsadGE1fxYHjZXwDvoyl9aXjchMmg-2Bqy8aG87TzVIDycx3o4S-BkdX8w60UGA8omdAeXrKiSBeVBn6NLcL-YnSAgXw/s400/Sin+nombre.jpg" width="400" /></a></div>
6DOF Timoshenko Beam element matrix</td></tr>
</tbody></table>
Depending on the chosen formulation we have different degrees of interpolation and hence presumably higher or lower degrees of precision. Also depending on the chosen formulation we might have different ways of locating and relating our nodes to each other.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbHEKlm662jr4wpQlIwj_HlAmp0CETS9qiLQciNxjS9KFBeUqy_CfWco9_Bl3G3mZBJTC7l5OzOaNHLLvY1uJlJpCUUTpvB1sSfqmEQ7pFEwIqwY8kM6QLVbHCgtwSS_GatCakpZvGVqs4/s1600/Matrix.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="263" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbHEKlm662jr4wpQlIwj_HlAmp0CETS9qiLQciNxjS9KFBeUqy_CfWco9_Bl3G3mZBJTC7l5OzOaNHLLvY1uJlJpCUUTpvB1sSfqmEQ7pFEwIqwY8kM6QLVbHCgtwSS_GatCakpZvGVqs4/s400/Matrix.jpg" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: left;">
For our example we can choose any of the formulations provided in literature (above are the most common used in structural engineering). It is important to note the internal structure of these element matrices, which are symmetrical and clearly divided into parts each corresponding to the nodes that reside on the element's boundaries (2 nodes in the case of a beam - 4 quadrants in the matrix).</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<u><b>STEP 3: Matrix assembly and solution</b></u> </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Because the relations between nodes need to be accomplished all at the same time, we have to set all the equations in such a manner that they compose an algebraic system of equations. The matrix equation we want to solve (at least in statics) is as follows: </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<b>[F]= [Kg]·[u]</b></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Where <b>[F]</b> is the vector of applied external forces, <b>[Kg]</b> is the system's global stiffness matrix and <b>[u]</b> is the vector of displacements resulting from the application of the forces. The size of<b> [Kg]</b>, <b>[F]</b> and <b>[u]</b> is that of the number of DOFs times the number of nodes, being <b>[Kg]</b> squared and <b>[F]</b> and <b>[u]</b> unidimensional.</div>
<div class="separator" style="clear: both; text-align: left;">
In order to generate the Force vector, all we need to do is collect the applied forces (linear and moment forces) and sort them according to the index of the node they are applied to.</div>
<div class="separator" style="clear: both; text-align: left;">
For the global stiffness matrix, it is necessary a bit more laborious procedure by means of which we iterate throughout each element's particular stiffness matrix. Out of each one of those, we get only the part that corresponds to the position of the node we are storing in the matrix, and add it to the possible concurrent data that comes from other elements. Warning: before entering in the global stiffness matrix, we must convert local coordinates to global coordinates!</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
To get the displacement vector, it is needed to first enforce the constraints and then solve the resulting algebraic system of equations. To do this there are two classical approaches: Penalty Method and Lagrange Multipliers method, but we wont enter into this here...</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSYPi_qWtB9giT-c1CBsrWaQVxFobAZ_U5KtUHMMOSoiTiDjUDAAxkLA-a8bZ-sUn06t7OSKRMFUJSfB9B0wy1l8H7LLk_6j-GLd1D3vbFBq1BfIGbFsn1Boh2H85JPWdnQmBizf37daTl/s1600/Assembly.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="205" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSYPi_qWtB9giT-c1CBsrWaQVxFobAZ_U5KtUHMMOSoiTiDjUDAAxkLA-a8bZ-sUn06t7OSKRMFUJSfB9B0wy1l8H7LLk_6j-GLd1D3vbFBq1BfIGbFsn1Boh2H85JPWdnQmBizf37daTl/s400/Assembly.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Global Matrix Assembly</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: left;">
Afterwards, all we need to do is use any available algebraic equation solver (LU decomposition is one of the most extended), and obtain the solution of the system.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: left;">
<br /></div>Unknownnoreply@blogger.com18tag:blogger.com,1999:blog-6352511023055453909.post-56918210225529055482011-05-09T09:20:00.000-07:002011-08-01T11:38:02.635-07:00Impulses, FEM and VerletAfter some time struggling with formulations of many diverse categories, I have eventually managed to implement a computer program where the scheme explained in the november entry (
<a href="http://stochasticandlagrangian.blogspot.com/2010/11/proposal-on-course-on-real-time.html">
A proposal on a course on Real-Time Structural Dynamics</a>) becomes clear and useful.
<span style="font-size: small;">
The main point here is to explain how, by organizing the numerical methods according to what they really discretize, it is possible to grasp and understand such an entangled area of knowledge.
One of the main difficulties that I am encountering through this research period is not just that of the thick mathematical language employed but mainly that of mixed concepts when authors come to explain each of the endless methods available in literature.
The following is an step by step procedure where time, constraints and material properties are respectively integrated by means of Verlet, Impulse formulation and Finite Elements numerical methods.
The software framework for development and visualization is that presented in April 2010 (one year already uuf!):</span><span style="font-size: small;"><a href="http://stochasticandlagrangian.blogspot.com/2010/04/first-ogreverletgauss-seidel-simulation.html"> First Ogre+Verlet+Gauss-Seidel simulation.</a>
On top of it I have made the necessary modifications and also the adaptation from Linux to Windows so it is easier to make further comparisons with commercial codes.
The first that is needed is a set of nodes with their
coordinates and their masses, along with the list of constraints that
topologically relate one to another and to the environment:
</span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgu4-X4WtSwF1Mu_qXb1gR3FgkemFSzz5mNkNXgRoaQH_kk7sjSV80Tt9Zuhw0bFwBap0tSYe5L4iMU1KF_F8HsO3lrKkSMzyh4f_D7CnTGD9IOlCpoCxV7VKiwY8i85R9Ybw6dKdlsX8oP/s1600/Model.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="205" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgu4-X4WtSwF1Mu_qXb1gR3FgkemFSzz5mNkNXgRoaQH_kk7sjSV80Tt9Zuhw0bFwBap0tSYe5L4iMU1KF_F8HsO3lrKkSMzyh4f_D7CnTGD9IOlCpoCxV7VKiwY8i85R9Ybw6dKdlsX8oP/s400/Model.jpg" width="400" /></a>
</div>
<span style="font-size: small;">
<b>Time integration:</b> Verlet ODE integration method is known to have certain stability but not a big deal of accuracy. However, is fairly easy to implement. An exhaustive explanation on how it works can be found here: <a href="http://en.wikipedia.org/wiki/Verlet_integration">http://en.wikipedia.org/wiki/Verlet_integration</a>. In our implementation, it is divided into functions: AccumulateAccelerations and Verlet.</span><br />
<span style="font-size: small;">In AccumulateAccelerations we iterate through each mass and add up earthquake readings from a file (per millisecond), gravity acceleration (980 cm/s2), and the internal forces caused by deformation divided by the weight of the mass.</span><br />
<span style="font-size: small;">The Verlet procedure, simply updates the position of each particle according to the formula: </span><br />
<br />
<div style="text-align: center;">
<b><span style="font-size: small;">x(t)=x(t-1) + v(t)·dt + a(t)·dt^2</span></b></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<b><span style="font-size: small;">Constraint integration: </span></b><span style="font-size: small;">The only constraints included in the current implementation </span><span style="font-size: small;">are those of the distance between two particles. By means of the concept of impulse, once two particles move close or apart by the effect of the accelerations, a corrective force is applied on each one of them. This force is applied in a very short lapse of time, hence can be regarded as an impulse. A more detailed explanation can be found in the work by Jan Bender (<a href="http://www.impulse-based.de/">www.impulse-based.de</a>). The algebraic system of equations that arises so as to satisfy all of the constraints simultaneously is solved by means of a Gauss-Seidel iterations.</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3yB5aFUyeXnOWugOk9tdCOIurEXwD75EpTvvSlRDAaWHx9evXuhhHsjvIGEPpH18X4kht3pvGL3QPcR38NLMkcn_3JGzMViCVKHZM78yJeneXNkPOabQ6eCNj2dWKPG8WaRwd9qbUUp-S/s1600/Model2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><br /></a></div>
<div style="text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3yB5aFUyeXnOWugOk9tdCOIurEXwD75EpTvvSlRDAaWHx9evXuhhHsjvIGEPpH18X4kht3pvGL3QPcR38NLMkcn_3JGzMViCVKHZM78yJeneXNkPOabQ6eCNj2dWKPG8WaRwd9qbUUp-S/s1600/Model2.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="205" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3yB5aFUyeXnOWugOk9tdCOIurEXwD75EpTvvSlRDAaWHx9evXuhhHsjvIGEPpH18X4kht3pvGL3QPcR38NLMkcn_3JGzMViCVKHZM78yJeneXNkPOabQ6eCNj2dWKPG8WaRwd9qbUUp-S/s400/Model2.jpg" width="400" /></a><span style="font-size: small;"></span></div>
<br />
<b>Matter integration: </b>For the consideration of matter properties the program uses the Finite Element Method. A quadratic shape function is used according to the implementation taught in<a href="http://www.colorado.edu/engineering/cas/courses.d/IFEM.d/"> http://www.colorado.edu/engineering/cas/courses.d/IFEM.d/</a>. Chapters 20 and 21 explain clearly how to infer the values for the case of an elastic beam.<br />
This provides our system with a rigidity matrix that is easily attached to each of the distance constraints. As the displacements have already been obtained previously, the solution of the force vector is straightforward by means of a simple rigidity matrix-displacements vector operation:<br />
<br />
<div style="text-align: center;">
<b>[f] = [K] · [u]</b></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
This force vector stores the effect of the deformation into the constraint and is later used to obtain the particle acceleration in the next timestep.</div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6352511023055453909.post-15766742312223606762011-03-19T15:13:00.000-07:002011-03-19T15:13:15.327-07:00CANE STRUCTURES WITH FEMCurrently Barcelona is holding a lot of activity in cane structure promoted by krfr collective (<a href="http://www.krfr.org/">www.krfr.org</a>). In a recent conversation with my colleague Oriol Palou (<a href="http://www.sustenta.eu/">www.sustenta.eu</a>) we discussed about the material properties of cane that are being studied within the<a class="l" href="http://www.upc.edu/unitat/fitxa_unitat.php?id_unitat=123&lang=ing"> School of Building Construction of Barcelona (EPSEB).</a><br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.blogger.com/video.g?token=AD6v5dywNfYVrkUUgeF6PruQp3-b2FJA6fM6LHxXKYY68VbakKmn3VXOorHkuYpW2YiM7UF9FtUEiLvNe-10CoKnaA' class='b-hbp-video b-uploaded' frameborder='0'></iframe></div>
This led to a first experiment with FEM which video I show here. This simulates one load test made in EPSEB laboratories, where deflections in the middle of the arch under a 200 kg load were around 30 cm, with purely elastic behavior.<br />
Obviously our model needs some refinement, as I had to load it with 2000 kg to make it deform that much, but the results are somehow encouragingUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-6352511023055453909.post-82925039583763126472011-02-04T05:41:00.000-08:002011-03-21T04:44:10.011-07:00ON LAGRANGE'S UBIQUITI IN MODERN PHYSICSThis post is just to point out a quite dazzling phenomenon I have been encountering during this year of research: Joseph Louis Lagrange.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYxfp1h249fhR3w3nI3NLX_NXWc1h2h_0f7rJ5m9CXoABOwADkwit_j8qCZWDzNP4yGESYmm-msv8oup6oGRQOwfctywczJ1JNOeWfT1l8hjyHApEFpu5OMe-K-fwHyxjlEQ1N6APi8tgz/s1600/Langrange_portrait.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYxfp1h249fhR3w3nI3NLX_NXWc1h2h_0f7rJ5m9CXoABOwADkwit_j8qCZWDzNP4yGESYmm-msv8oup6oGRQOwfctywczJ1JNOeWfT1l8hjyHApEFpu5OMe-K-fwHyxjlEQ1N6APi8tgz/s1600/Langrange_portrait.jpg" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuXcYzN6iO8oR_hzfEDOijPj7WA4ZLlb-qA2JCZgxqdII8wMRVbjVbRxFa3hyaQlyVh7Chsq79uJKy5-Z6cCuD9_2mr53d2TbUPu83EugRI4lgh8oRcC8prazaWVGC0zWcxXF2sE6I2v1p/s1600/lagrange.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><br /></a></div>
<br />
It happens to be that this Italian gentleman revolutionized the world of Physics some two hundred years ago (<a href="http://plus.maths.org/issue36/features/dartnell/index.html">see here a beautiful explanation on how</a>), in such a manner that now is nearly impossible not to encounter his surname nearly everywhere when trying to understand them.<br />
The following is a short outline of the mathematical/physical concepts including Lagrange (a larger version can be found in <a href="http://en.wikipedia.org/wiki/List_of_topics_named_after_Joseph_Louis_Lagrange">http://en.wikipedia.org/wiki/List_of_topics_named_after_Joseph_Louis_Lagrange</a>):<br />
<br />
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: right; margin-left: 1em; text-align: right;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgH2bbm2ZPRz7-_14C2wbIiw-wB0dchFyabKdNnjwo3_tS55g2S5nsO8fIS4fDDsi1fY-rHI45IY-V1LAEDBD7kR5Rs7YvAUG7h-_FlTvJWHlQkECXUk7SlK-uCroZfUm9I_h1QwA0wJfxF/s1600/800px-LagrangeMultipliers3D.png" imageanchor="1" style="clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" height="130" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgH2bbm2ZPRz7-_14C2wbIiw-wB0dchFyabKdNnjwo3_tS55g2S5nsO8fIS4fDDsi1fY-rHI45IY-V1LAEDBD7kR5Rs7YvAUG7h-_FlTvJWHlQkECXUk7SlK-uCroZfUm9I_h1QwA0wJfxF/s200/800px-LagrangeMultipliers3D.png" width="200" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Lagrange multipliers</td><td class="tr-caption" style="text-align: left;"><br /></td></tr>
</tbody></table>
<br />
<ul>
<li style="text-align: justify;"><b>Lagrange multipliers</b>: These are mathematical artifacts for the solution of <u>optimization</u> problems (<a href="http://en.wikipedia.org/wiki/Lagrange_multiplier">http://en.wikipedia.org/wiki/Lagrange_multiplier</a>)</li>
<li style="text-align: justify;"><b>Euler-Lagrange equation</b>: The Euler–Lagrange equation was developed in the 1750s by Euler and Lagrange in connection with their studies of the tautochrone
problem. This is the problem of determining a curve on which a weighted
particle will fall to a fixed point in a fixed amount of time,
independent of the starting point. Lagrange solved this problem in 1755 and sent the solution to Euler.
The two further developed Lagrange's method and applied it to mechanics, which led to the formulation of <u>Lagrangian mechanics</u>.<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: right; margin-left: 1em; text-align: right;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyMH8QlP2-4SmWflUkF69_yhg3mUQbgQ8dSSdCouhFj4-mcvV5cxHAZ5A-oHccnEI1cXTgo4-eVPARffMD4u-Eeg6EpV6c722dqv4eQdblAToCb0iGFhPSahMCMv2Vzi_vNApCWvQjih4U/s1600/fcbb2da13495c1c12bef98ab883e9abd.png" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyMH8QlP2-4SmWflUkF69_yhg3mUQbgQ8dSSdCouhFj4-mcvV5cxHAZ5A-oHccnEI1cXTgo4-eVPARffMD4u-Eeg6EpV6c722dqv4eQdblAToCb0iGFhPSahMCMv2Vzi_vNApCWvQjih4U/s1600/fcbb2da13495c1c12bef98ab883e9abd.png" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Euler-Lagrange equation</td></tr>
</tbody></table>
Their correspondence ultimately led to the calculus of variations, a term coined by Euler himself in 1766.<sup> </sup>In classical mechanics, it is equivalent to Newton's laws of motion, but it has the advantage that it takes the same form in any system of generalized coordinates, and it is better suited to generalizations. Is also related to optimization according to variational principles (<a href="http://en.wikipedia.org/wiki/Euler%E2%80%93Lagrange_equation%29">http://en.wikipedia.org/wiki/Euler%E2%80%93Lagrange_equation)</a>.</li>
<li style="text-align: justify;"><b>Lagrangian function</b>: The concept of a Lagrangian was originally introduced in a reformulation of <u>classical mechanics</u> by Irish mathematician William Rowan Hamilton known as Lagrangian mechanics. <table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: right; margin-left: 1em; text-align: right;"><tbody>
<tr></tr>
<tr><td style="text-align: center;"><img alt="L = T - V.\quad" class="tex" src="http://upload.wikimedia.org/math/b/f/b/bfb2ab0977e6e5fedbd978efceee5845.png" style="margin-left: auto; margin-right: auto;" /></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Lagrangian function</td></tr>
</tbody></table>
In classical mechanics, the Lagrangian is defined as the kinetic energy, <span class="texhtml"><i>T</i></span>, of the system minus its potential energy.</li>
<li style="text-align: justify;"><b>Green-Lagrangian tensor</b>: In <u>continuum mechanics</u>, the finite strain theory also called large strain theory, or large deformation theory, deals with deformations in which both rotations and strains are arbitrarily large. This means to invalidate the assumptions inherent in infinitesimal strain theory. In this case, the undeformed and deformed configurations of the continuum are significantly different and a clear distinction has to be made between them. This is commonly the case with elastomers, plastically-deforming materials and other fluids and biological soft tissue. The concept of <i>strain</i> is used to evaluate how much a given
displacement differs locally from a rigid body displacement . One of such strains for large deformations is the <i>Lagrangian finite strain tensor</i>, also called the <i>Green-Lagrangian strain tensor</i> or <i>Green - St-Venant strain tensor.</i></li>
<li style="text-align: justify;"><div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<b>
Lagrange description of motion</b>. In continuum mechanics the Lagrangian specification of the flow field is a way of looking at fluid motion where the observer follows an individual fluid parcel as it moves through space and time. Plotting the position of an individual parcel through time gives the pathline of the parcel. This can be visualized as sitting in a boat and drifting down a river. The Eulerian specification of the flow field is a way of
looking at fluid motion that focuses on specific locations in the space
through which the fluid flows as time passes. This can be visualized by sitting on the bank of a river and watching the water pass the fixed location. The Lagrangian approach is also associated to particle based formulation, whereas the Eulerian is referred to as grid based formulations.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEik2u_qJMCr4AEsRBw3INi4EE0Q3M7KzwvYDHvmREMyGAOIx33szLjUTBBMqaVCZyN00zOjKhPeRojTXeBXSRXNi4FR3a7MHGlukYXHp0789I8zAfHdD-dlxF-lRaiCce5OBhHuiH3F6CvT/s1600/800px-EulerianMesh.png" style="margin-left: auto; margin-right: auto;"><img border="0" height="138" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEik2u_qJMCr4AEsRBw3INi4EE0Q3M7KzwvYDHvmREMyGAOIx33szLjUTBBMqaVCZyN00zOjKhPeRojTXeBXSRXNi4FR3a7MHGlukYXHp0789I8zAfHdD-dlxF-lRaiCce5OBhHuiH3F6CvT/s320/800px-EulerianMesh.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Eulerian description</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpVwQZIg2bTcGRhdAhu-YIcaaCUBrZwwBfQGVYIQQ2fwoNFpro3pzRZEsV2918ZrdfbiZP6X_E11v-IrFXze6_rzBPVEG2VANmAUKKIl8CW0YeaRn3gl7wbu7R74nBwX7FDHtEMnh2k7_X/s1600/400px-LagrangianMesh.png" style="margin-left: auto; margin-right: auto;"><img border="0" height="147" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpVwQZIg2bTcGRhdAhu-YIcaaCUBrZwwBfQGVYIQQ2fwoNFpro3pzRZEsV2918ZrdfbiZP6X_E11v-IrFXze6_rzBPVEG2VANmAUKKIl8CW0YeaRn3gl7wbu7R74nBwX7FDHtEMnh2k7_X/s320/400px-LagrangianMesh.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Lagrangian description</td></tr>
</tbody></table>
<br />
<i> </i></li>
</ul>
And this is just a small sample. However, it fully justifies the name of the thesis and this blog's, as our research departs from Lagrange's work to try to find engineering solutions.<br />
It must be said that Lagrange's prolificacy results somehow dazing and stunning, as there are so many fields he got involved in, and none of them of trivial nature.<br />
I hope this quick outline serves others to find a way through all this tangled knowledge. <br />
<ul>
</ul>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6352511023055453909.post-54094281506482069692010-11-22T14:08:00.000-08:002010-11-22T14:08:42.093-08:00A proposal on a course on Real-Time Structural Dynamics The following is a tree with the key concepts that, although already at reach of any graduated structural engineer, need to be tied together, maybe in a course, in order to achieve a proper scope on how to simulate real-time structural dynamics:<br />
<ul>
<li> Main <b>time</b> integration methods (<b>ODE</b>),
their limitations (drawbacks), advantages, motivation, references,
illustrations, year, all related to the three disciplines applied
physics, maths and applied computing:</li>
<ul><ul>
<li>1st order</li>
<ul>
<li>Euler</li>
<li>Backward Euler</li>
<li>Semi-implicit Euler</li>
<li>Exponential Euler</li>
</ul>
</ul>
<ul>
<li>2nd order</li>
<ul>
<li>Verlet</li>
<li>Velocity Verlet</li>
<li>Midpoint Method</li>
<li>Heun's</li>
<li>Newmark-beta</li>
<li>Leapfrog</li>
</ul>
</ul>
<ul>
<li>Higher order</li>
<ul>
<li>Runge-Kutta</li>
<li>Linear multistep</li>
</ul>
</ul>
</ul>
<li>Main <b>constraint/collision</b> (<b>DAE</b>)
integration methods, their limitations (drawbacks), advantages,
motivation, references, illustrations, year, all related to the three
disciplines applied physics, maths and applied computing.</li>
<ul><ul>
<li>Coordinate Partitioning</li>
<li>Constraint Orthogonalization</li>
<li>Udwadia-Kalaba</li>
</ul>
</ul>
<li>Main <b>matter/continuum</b>
(<b>PDE</b>) integration methods, their limitations (drawbacks), advantages,
motivation, references, illustrations, year, all related to the three
disciplines applied physics, maths and applied computing.</li>
<ul><ul>
<li>MESH BASED METHODS</li>
<ul>
<li>Finite Element</li>
<li>Finite Differences</li>
<li>Finite Volume</li>
<li>Boundary Element</li>
<li>Mass-spring systems<br />
</li>
</ul>
<li>MESH FREE METHODS</li>
<ul>
<li>SPH</li>
<li>Diffuse Element Method</li>
<li>Partition of Unity</li>
<li>Moving Least Square</li>
<li>Reproducing Kernel Method</li>
</ul>
</ul>
</ul>
</ul>
A graphical approach to ths subject, not so tied to complex formalisms and formulation, would be a real help to attract more researchers into this fascinating discipline.<br />
It also would reinforce the interest on the very differential equations, as these are a very abstract concept explained and taught on a very abstract basis. This makes them first candidate to be either forgotten or banned into the minds of students.<br />
<br />
I will try to develop these subjects with more care in future issues...<br />
<br />
Se vidimo!Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6352511023055453909.post-41808703459929120972010-10-26T06:49:00.000-07:002010-10-26T06:49:07.590-07:00Physics Engines BenchmarkingThe target was to devise in some manner the way different computational
physics simulation models/engines/environments performed against a
canonical one.<br />
<br />
For such purpose, I have reviewed the paper <i>"Beam Benchmark Problems For Validation Of Flexible Multibody Dynamic Codes"</i> by A.L. Schwab and J.P. Meijgaard.<br />
The following is an outline of the proposed in this paper:<br />
<br />
<ul>
<li>1.- Introduction</li>
<ul>
<li>The paper presents some basic problems for which analytic solution is known</li>
</ul>
<li>2.- Beam benchmark problems</li>
<ul>
<li>Tests to be performed</li>
<ul>
<li>Static analyses in small displacements for the validation of the correct formulation of elastic forces</li>
<li>Static analyses for large displacements and rotations, on straight and curved beams</li>
<li>Buckling
tests in normal, lateral and torsional directions to check the way
geometric stiffness due to prestress is taken into account</li>
<li>Eigenfrequency analyses for the validation of the combination of elastic forces and distributed inertia forces</li>
<li>Mesh refinement tests for all the above to prove convergence of the results</li>
</ul>
<li>Underlying model: Timoshenko beam with large displacements and large rotations</li>
<ul>
<li>Finite Element Method Beam Element</li>
<li>Shear flexible based on the elastic line concept</li>
<li>Slender beam, cross section doubly symmetric</li>
<li>Large rotation and displacements, but small deformations</li>
<li>Isotropic and linearly elastic</li>
<li>BEAM model: standard strain-displacement relations</li>
<li>BEAMNL model: additional quadratic terms included in the strain-displacement for better performance in the pre-stress cases</li>
</ul>
</ul>
</ul>
Interestingly enough, the analytical solution is
provided for each of the tests, and the proposed model is simple enough
so as not having too much trouble in introducing it in a few
characteristic ready made softwares currently available.<br />
<br />
The implementation of such a benchmark over some of the most popular engines revised lately would surely make a nice contribution.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6352511023055453909.post-68409444326775413302010-10-14T04:49:00.000-07:002010-10-14T04:49:00.850-07:00Integration Overview<div class="separator" style="clear: both; text-align: justify;">
In order to get some scope I have prepared a new diagram where the different integration fields of any multibody physics engine can be fit.</div>
<div class="separator" style="clear: both; text-align: justify;">
Normally we have to integrate time, via ODEs, for which any of the available schemes can be chosen, but then also the Differential Algebraic Equations for constraints (related to collisions) and the Partial Differential Equations related to the continuum have to be solved.</div>
<div class="separator" style="clear: both; text-align: justify;">
<br />Of course, not every engine implements the continuum part (limiting to rigid solid) and some matter integration schemes already consider the very collisions so the constraint integration is explicitly sorted...</div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
The associated disciplines where each concept fits are represented by the horizontal blocks.</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnX9txgiVnNcnF1D18aGm7EYi_sewj-XKDFnpQx0nJdflj4qUWgXJqKnUnt-XYnHBgR4TG4XG136dP2nhvAu7QBWzXjN02g7G8chEnI_pKct55vtGBgM_OtrVWPIjeeFmahfUgUv1bl6he/s1600/Discipline+overview.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnX9txgiVnNcnF1D18aGm7EYi_sewj-XKDFnpQx0nJdflj4qUWgXJqKnUnt-XYnHBgR4TG4XG136dP2nhvAu7QBWzXjN02g7G8chEnI_pKct55vtGBgM_OtrVWPIjeeFmahfUgUv1bl6he/s400/Discipline+overview.jpg" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6352511023055453909.post-80526308223907425442010-09-22T04:45:00.000-07:002010-09-22T04:46:53.528-07:00Discipline OverviewHolidays are over already. I am now living in Slovenia, Ljubljana, and developing the thesis in the Faculty of Architecture (lovely place, by the way...).<br />
<br />
Last June I presented my Thesis Proposal to the jury of the Computational and Applied Physics Department in the UPC and...it was accepted!!<br />
<br />
After the long pause I have had to prepare an overview of all the studied subjects, just to get some scope on what is coming and where we are now. The following diagrams give some idea on how it is:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyDqr0hm2-xtyzlk3WDF_8JbiHQ-VzJ3ih8-e2Md1knqCNGNol5z5P5fbrMM8uqO-AEu5aV07dvhu695aH2RkvoBuCjBWwI13fJ7REKFWBc-bZDlfe_8ZNoDlcXuK0Vzo6nr9tAIdEjjlw/s1600/Screenshot.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="290" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyDqr0hm2-xtyzlk3WDF_8JbiHQ-VzJ3ih8-e2Md1knqCNGNol5z5P5fbrMM8uqO-AEu5aV07dvhu695aH2RkvoBuCjBWwI13fJ7REKFWBc-bZDlfe_8ZNoDlcXuK0Vzo6nr9tAIdEjjlw/s400/Screenshot.png" width="400" /></a></div>
<br />
And with a bit more of detail:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7aDGNRyTXdkJRoFM6FGkRmC1ZjlRQujhKshNT_vaVEPG-gW3FcUv_zSNeDYwmqsnu_dzShssQXMdpslZiJc3sL829taCQDaV1KR_mnkWKh5gn_EuWoA8pIH4RocNi8k6EdFvk3ySvTfbU/s1600/Screenshot-1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="302" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7aDGNRyTXdkJRoFM6FGkRmC1ZjlRQujhKshNT_vaVEPG-gW3FcUv_zSNeDYwmqsnu_dzShssQXMdpslZiJc3sL829taCQDaV1KR_mnkWKh5gn_EuWoA8pIH4RocNi8k6EdFvk3ySvTfbU/s400/Screenshot-1.png" width="400" /></a></div>
<br />
These diagrams derive from the need of disentangling disciplines that more often than seldom get mixed in the literature and make it fairly hard to follow.<br />
The literature I am talking about is that of the computational simulation of physics, where numerical methods meet with very different origins.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6352511023055453909.post-86187068260702466112010-07-27T08:45:00.000-07:002010-07-27T08:48:43.086-07:00SUSTAINABLE DYNAMIC STRUCTURES WITH CANE<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjafG4tAsddWfTBJ_99LvwRSqNLBPGO4HCum1D9Fhr5ki34l_Wiib3zfkdSYkfbBcpCwhKMxTACO87s1G2P7GW88qw9wARRdGolaBgsGkvvZMs3okSSrG7kwEg1tAn5yaW_Aq0jePlldL-S/s1600/IMG_1948.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="265" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjafG4tAsddWfTBJ_99LvwRSqNLBPGO4HCum1D9Fhr5ki34l_Wiib3zfkdSYkfbBcpCwhKMxTACO87s1G2P7GW88qw9wARRdGolaBgsGkvvZMs3okSSrG7kwEg1tAn5yaW_Aq0jePlldL-S/s400/IMG_1948.JPG" width="400" /></a></div>
The last month I have been quite busy helping out raise the structure above.<br />
It is located near Idanha Velha, in the premises for the International Boom Festival in Portugal.<br />
<br />
It is one of the most clear examples of dynamic structures, where ordinary laws of statics don't apply, and one of my first fields of intense research.<br />
<br />
The aim is to reach a comprehensive computational model that allows the designer (Jonathan Cory Wright - <a href="http://www.canyaviva.com/">www.canyaviva.com</a>) to experiment with his designs prior to having to actually raise his buildings!Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6352511023055453909.post-7716071198892477052010-04-20T14:55:00.000-07:002010-04-20T15:08:36.725-07:00An Overview on Constraint Enforced Formulations of Variational DynamicsA couple of weeks ago a very interesting paper entered my hard drive: <a href="http://www.google.es/url?sa=t&source=web&ct=res&cd=1&ved=0CAoQFjAA&url=http%3A%2F%2Fsoliton.ae.gatech.edu%2Fpeople%2Fobauchau%2Fpublications%2FLaulusa%2BBauchau07.pdf&ei=WhfOS_3JNIKe_ganppxt&usg=AFQjCNGO1CDPIxNxdwc9JPhcDkk5cu_VXA&sig2=4aLcduMx8UpE4g3sLnRAgQ">Review of classical approaches for constraint enforcement in multibody systems</a>.<br />
It is a fairly clarifying overview on solid grounds of certain methodologies to solve multibody systems dynamics.<br />
These methodologies differ from the ones I have encountered in the spreaded dynamics engines in their apparently more robust and simple formulation.<br />
Here is a synthesis of this paper:<br />
<br />
<blockquote>
Multibody systems present two distinguishable features:<br />
<ol>
<li>Bodies undergo finite relative rotations, which introduce nonlinearities</li>
<li>Bodies are connected by mechanical joints that impose restrictions, which mean a set of governing equations that combine differential and algebraic equations (ODEs and DAEs, respectively).</li>
</ol>
Lagrange's equation of the first kind has the following aspect:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbJLxXcjZ8AOxiTj6qtAfs7_aAWTMw7iDpzu_cpnyQgVGOxiDtUpbcyKHz_YWnJDqKMUu3pT5ZN1M12HP5kYOdP18vWNBUzlcOlC1F6Ih_i7ITIR2-1AV-Y5X8wILCYyArcZ5qSegKz2NI/s1600/Pantallazo.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbJLxXcjZ8AOxiTj6qtAfs7_aAWTMw7iDpzu_cpnyQgVGOxiDtUpbcyKHz_YWnJDqKMUu3pT5ZN1M12HP5kYOdP18vWNBUzlcOlC1F6Ih_i7ITIR2-1AV-Y5X8wILCYyArcZ5qSegKz2NI/s320/Pantallazo.png" /></a></div>
Where<br />
<ul>
<li>M=M(q,t) is the mass matrix</li>
<li>q is the generalized coordinates vector</li>
<li>B is the constraint matrix</li>
<li>λ is the array of Lagrange multipliers</li>
<li>F is the dynamic externally applied forces</li>
</ul>
If all the constraints are holonomic (velocity independent), B is called the Jacobian matrix, and the generalized coordinates, q, are linked by m algebraic constraints.<br />
Lagrange's equations of the first kind form a set of (m+n) Differential Algebraic Equations.<br />
The approach of the following methods is to use algebraic procedures in order to eliminate Lagrange's multipliers and then obtain a set of ODEs.<br />
<ul>
<li>Maggi's formulation: implies the creation of a vector containing the so called <i>kinematic parameters</i>, <i>generalized speeds</i> or <i>independent quasi-velocities</i> by the analyst in order to obtain a Γ matrix. This matrix spans the null space of the constraint matrix and allows for the elimination of the Lagrange multipliers.</li>
<li>Index-1 formulation: requires that initial condition of the problem be subjected to the constraint conditions. Then, it is possible to obtain a system of 2nd order ODEs that is solvable by rearranging the previous equation, extracting the Lagrange multipliers and hence obtaining:<span id="goog_883168442"></span><span id="goog_883168443"></span></li>
</ul>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUsova0l1GcE6_PpfkUcPBUdFDPogY8vjCZ_lnEX-2ZuXRjGREiZI1sOO1PSbAAjnilVZx_2syuaH0wMlITLoejUQVQJS0zuyz4kXZhQTPY2Zub9xaDCt9XWxHhZ9bkJRCo3jPXZI8u-Hh/s1600/Pantallazo-1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUsova0l1GcE6_PpfkUcPBUdFDPogY8vjCZ_lnEX-2ZuXRjGREiZI1sOO1PSbAAjnilVZx_2syuaH0wMlITLoejUQVQJS0zuyz4kXZhQTPY2Zub9xaDCt9XWxHhZ9bkJRCo3jPXZI8u-Hh/s320/Pantallazo-1.png" /></a></div>
<ul>
<li>Null space formulation: this method solves the system of second order ODEs by premultiplying the first part of the equation by the transposed null space matrix thus eliminating the Lagrange multipliers.</li>
<li>Udwadia-Kalaba formulation: this method represents a more compact and general form of solving the DAEs by means of the Moore-Penrose generalized inverse. It is based on Gauss' Principle of Minimum Constraint, which establishes that the explicit equations of motion be expressed as the solution of a quadratic minimization problem subjected to constraints, but at the acceleration level.</li>
</ul>
</blockquote>
<blockquote>
<br />
All these formulations transform the (2n+m) first order DAEs into ODEs by eliminating Lagrange multipliers.<br />
Maggi's formulation yields (2n-m) first order ODEs.<br />
Index-1, null space and Udwadia-Kalaba form sets of (n) second order ODEs which could be alternatively recast into (2n) first order ODEs for the n generalized coordinates and the n generalized velocities.<br />
The main advantage of these methodologies is not so much the reduction in the number of equations but rather in the change from DAEs to ODEs.<br />
There is a warning on the constraint drift phenomenon, for which these method will be more affected (not so much in Maggi's formulation), and that would require constraint stabilization techniques.</blockquote>
My conclusion is that it seems the way to go, not only for the claims of more stable and quick numerical techniques available to get them working, but also for an apparently more clear approach in the theoretical field.<br />
Particularly, I have done some research into the Udwadia-Kalaba formulation, and definitively is a very promising one.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6352511023055453909.post-8567649177409205472010-04-15T15:26:00.000-07:002010-04-15T15:26:32.407-07:00ODE DYNAMICS ENGINE QUICK OVERVIEWAfter seeing my own simulator running there is a whole lot of things that I wish it had.<br />
All this stuff is more or less complicated to achieve, but from my previous research I have found some Open Source engines from which I can learn a lot.<br />
<br />
The best documented one so far is ODE (<a href="http://www.ode.org/">www.ode.org</a>), and also the one I intend to merge with Blender.<br />
So, I present a very quick and thorough overview on how this works, in order to have some scope.<br />
<br />
The first thing to disentangle is how it gets working. For that, just looking at the user's manual one gets the following algorithm:<br />
<br />
<blockquote>
1.-Create a Dynamics world<br />
<ul>
<li>This basically means to make an instance of the dxWorld struct.</li>
</ul>
2.-Create the bodies<br />
<ul>
<li>Attach the bodies to the world (this means adding data to the dxBody* array of the dynamics world).</li>
<li>Set their properties (position and orientation of point of reference, its linear and angular velocities, the mass of the bodies and some other stuff of the like).</li>
</ul>
3.-Create the joints<br />
<ul>
<li>Attach the joints to the world (by adding data to the dxJoints* array of the dynamics world)</li>
<li>Set their properties (depending of the selected type of joint, one has to provide different details).</li>
</ul>
4.-Manage collisions<br />
<ul>
<li>Create a new collision world (just by making an instance to the dxSpace struct).</li>
<li>Create a joint group where collisions will be stored temporarily for every frame step.</li>
</ul>
5.-Loop<br />
<ul>
<li>Apply forces to bodies.</li>
<li>Adjust joint parameters.</li>
<li>Call collision detection.</li>
<li>Create a contact joint for every detected collision point and add it to the collision joint group.</li>
<li>Take a simulation step.</li>
<li>Clear the collision joint group.</li>
</ul>
6.-Destroy the dynamics and the collision worlds (wow, that sounds evil...hehehe).</blockquote>
<br />
All of this seems fairly easy to do but then one has to get to know where and how things have been implemented. This is when things become a bit harder.<br />
I am sure the file structure and the class definitions make perfect sense for the programmers of this engine.<br />
Fortunately, they have been careful enough so as to comment everything in an understandable way, for which I feel deeply grateful.<br />
After some digging, I have managed to restructure the ode/src folder into the following topics:<br />
<blockquote>
<ul>
<li>Accessories</li>
<ul>
<li>Memory management</li>
<li>Math</li>
<li>Matrix handling</li>
<li>External applications</li>
</ul>
<li>Collision</li>
<li>Core</li>
<li>Joints </li>
<li>Primitives</li>
<li>Solver</li>
</ul>
</blockquote>
Which means one can tackle the engine in an ordered manner and find things when needed.<br />
<br />
From a theoretical point of view, this engine presents the following features:<br />
<ul>
<li>A Lagrange multiplier velocity based model from Trinkle and Stewart</li>
<li>A friction model from Baraff</li>
<li>A Danzig LCP solver</li>
</ul>
<ul>
</ul>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6352511023055453909.post-65503861115355925532010-04-13T20:14:00.000-07:002010-09-07T03:16:33.343-07:00First Ogre+Verlet+Gauss-Seidel simulationOnce the Ogre3D engine is ready to draw what we numerically compute, it was about time to start having some fun.<br />
<br />
I found this excellent article from Thomas Jakobsen: <a href="http://www.gotoandplay.it/_articles/2005/08/advCharPhysics.php">http://www.gotoandplay.it/_articles/2005/08/advCharPhysics.php</a> where a very neat and simple engine is implemented (thanks Mr. Jakobsen).<br />
<br />
It is very well explained so adapting it to my little lab was not very hard.<br />
Here I proudly present my very first simulation!<br />
<br />
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
<object height="320" width="400"><param name="movie" value="http://www.youtube.com/v/sxoBJJ2f8uQ&hl=es_ES&fs=1&border=1">
</param>
<param name="allowFullScreen" value="true">
</param>
<param name="allowscriptaccess" value="always">
</param>
<embed src="http://www.youtube.com/v/sxoBJJ2f8uQ&hl=es_ES&fs=1&border=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="400" height="320"></embed></object></div>
<br />
<br />
I am perfectly conscious that it lacks of a lot of things...namely collision detection, a proper stable, precise integrator, an optimized implementation...and a long etcetera...but it's just a baby!<br />
<br />
Here is a zip file with the code (an extension from what I presented in the last post):<br />
<a href="http://www.blogger.com/goog_1516204070"><br /></a><br />
<a href="http://www.mnbvlabs.com/Thesis/VerletRelaxation.zip">http://www.mnbvlabs.com/Thesis/VerletRelaxation.zip</a> <br />
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6352511023055453909.post-61512493025111285322010-04-11T15:51:00.000-07:002010-04-27T04:36:20.925-07:00Setting Ogre3D as Graphic EnvironmentThe last days I have been working on getting a Graphics Environment for my Toy Physics Engine.<br />
Last December and January I had already fiddled around with excellent engines Ogre (<a href="http://www.ogre3d.org/">www.ogre3d.org</a>) and Bullet (<a href="http://bulletphysics.org/wordpress/">http://bulletphysics.org/wordpress/</a>), trying to put them to work together.I have a post from february where some simulations on youtube can be seen and some preliminary introductions are made.<br />
<br />
However, now I am starting to understand things, and whenever I have the drive to test them always encounter the problem on how visualize them.<br />
<br />
So, I came across with Blender (<a href="http://www.blender.org/">www.blender.org</a>), another fantastic tool, and got surprised to find their Google Summer of Code mentorship for 2010 (<a href="http://wiki.blender.org/index.php/Dev:Ref/GSoC/2010/Info">http://wiki.blender.org/index.php/Dev:Ref/GSoC/2010/Info</a>).<br />
I have applied for it. Deadline was 9th April, which meant preparing everything in a hurry and some embarrasing trouble with their wiki page (I have already apologised in their bf-commiters mailing list...ooops).<br />
Here is my proposal for such an important event: (<a href="http://wiki.blender.org/index.php/User:Ndujar">http://wiki.blender.org/index.php/User:Ndujar</a>).<br />
Hopefully they find it interesting and contact me to complete it!<br />
<br />
In the meantime, I have prepared a short and basic Ogre framework to begin doing some tests.<br />
It is composed of a few files and classes integrating Ogre.<br />
<br />
I generated it basically copying, cutting and pasting from the very good tutorials available at the Ogre web page (<a href="http://www.ogre3d.org/wiki/index.php/Ogre_Tutorials">http://www.ogre3d.org/wiki/index.php/Ogre_Tutorials</a>).<br />
<br />
It goes as follows:<br />
<br />
The first step is to intall and cofigure Ogre in your computer. This is the best tutorial I found: <a href="http://ubuntuforums.org/archive/index.php/t-1148570.html">http://ubuntuforums.org/archive/index.php/t-1148570.html</a>.<br />
<br />
Then, using whatever IDE of your taste (I am on EasyEclipse), just get the following files to compile.<br />
<br />
The core of the application is the BaseApp object, from which I will later extend further as needed. It is basically in charge of doing everything Ogre requires to be done to put things up in a rendering window.<br />
<b>BaseApp.h</b>: <br />
<textarea cols="55" name="textfield" rows="20">#include <Ogre.h>
#include "BaseFrameListener.h"
#include "PhysicsFrameListener.h"
#include "PhysicsEntity.h"
#include <iostream>
#include <math.h>
#include <vector>
#include <time.h>
#include <ctime>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
using namespace Ogre;
class BaseApp
{
public:
void go();
~BaseApp();
private:
Root *mRoot;
BaseFrameListener *mListener;
PhysicsFrameListener *PhListener;
Ogre::String mResourcePath;
SceneManager *mgr;
RenderWindow *win;
Camera *mCamera;
std::vector<PhysicsEntity> PhysicsEntities;
void createRoot();
void defineResources();
void loadResources();
void setupRenderSystem();
void createRenderWindow();
void initializeResourceGroups();
void setupScene();
void setupInputSystem();
void setupCEGUI();
void createFrameListener();
void createPhysicsFrameListener();
void startRenderLoop();
};
</textarea>
<br />
<b>BaseApp.cpp</b>: <br />
<textarea cols="55" name="textfield" rows="20">#include "BaseApp.h"
using namespace Ogre;
using namespace std;
///This code is adapted from the Ogre tutorials webpage for my own purposes
///http://www.ogre3d.org/wiki/index.php/Basic_Tutorial_6#Creating_the_RenderSystem
///Main function, calling all the private settings to make the application run in proper order:
///The basic Ogre life cycle looks like this:
/// 1. Create the Root object.
/// 2. Define the resources that Ogre will use.
/// 3. Choose and set up the RenderSystem (that is, DirectX, OpenGL, etc).
/// 4. Create the RenderWindow (the window which Ogre resides in).
/// 5. Initialize the resources that you are going to use.
/// 6. Create a scene using those resources.
/// 7. Set up any third party libraries and plugins.
/// 8. Create any number of frame listeners.
/// 9. Start the render loop.
void BaseApp::go()
{
createRoot();
defineResources();
loadResources();
setupRenderSystem();
createRenderWindow();
initializeResourceGroups();
setupScene();
createFrameListener();
createPhysicsFrameListener();
startRenderLoop();
}
///Destructor releases the FrameListener and the Root object from memory
BaseApp::~BaseApp()
{
delete mListener;
delete mRoot;
}
///-createRoot sets the Ogre Root object from where all others derive.
///The Root object is the core of the Ogre library,
///and must be created before you can do almost anything with the engine.
void BaseApp::createRoot()
{
mRoot = new Root();
}
///-defineResources sets all the Ogre engine requirements by iterating the configuration file.
///The next thing we have to do is define the resources that the application uses.
///This includes the textures, models, scripts, and so on.
///Everything is set up in the resources.cfg file.
void BaseApp::defineResources()
// Method which will define the source of resources (other than current folder)
{
// Load resource paths from config file
ConfigFile cf;
mResourcePath = "";
cf.load(mResourcePath + "resources.cfg");
// Go through all sections & settings in the file
ConfigFile::SectionIterator seci = cf.getSectionIterator();
String secName, typeName, archName;
while (seci.hasMoreElements())
{
secName = seci.peekNextKey();
ConfigFile::SettingsMultiMap *settings = seci.getNext();
ConfigFile::SettingsMultiMap::iterator i;
for (i = settings->begin(); i != settings->end(); ++i)
{
typeName = i->first;
archName = i->second;
ResourceGroupManager::getSingleton().addResourceLocation(archName, typeName, secName);
}
}
}
///-loadResources intializes the application ResourceGroupManager.
///The function defineResources adds all of the resources from the config file,
///but it only tells Ogre where they are.
///Before you can use any of them you have to either initialize the group that you want to use,
///or you must initialize them all.
void BaseApp::loadResources()
{
// Initialise, parse scripts etc
ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
}
///-setupRenderSystem checks wether the config file Ogre.cfg has already set things up and calls the
/// Ogre render system setup dialog in case it isn't.
///In the first part of the if statement, we attempt to restore the config file.
///If that function returns false it means that the file does not exist so we should show the config dialog,
///which is the second portion of that if statement.
///If that also returns false it means the user canceled out of config dialog
///(meaning they want to exit the program).
void BaseApp::setupRenderSystem()
{
if (!mRoot->restoreConfig() && !mRoot->showConfigDialog())
throw Exception(52, "User canceled the config dialog!", "BaseApp::setupRenderSystem()");
}
///-createRenderWindow sets the Ogre root window where everything is going to be displayed
///Now that we have chosen the RenderSystem, we need a window to render Ogre in.
///There are actually a lot of options for how to do this, but we will really only need this to
///keep thing simple.
void BaseApp::createRenderWindow()
{
mRoot->initialise(true, "Physics World");
}
///The only thing left to do is to initialize the resources we are about to use.
///In a very large game or application, we may have hundreds or even thousands of
///resources that our game uses - everything from meshes to textures to scripts.
///At any given time though, we probably will only be using a small subset of these resources.
///To keep down memory requirements, we can load only the resources that our application is using.
///We do this by dividing the resources into sections and only initializing them as we go.
void BaseApp::initializeResourceGroups()
{
TextureManager::getSingleton().setDefaultNumMipmaps(5);
ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
}
///There are at least three things that must be done before you start adding things to a scene:
///creating the SceneManager, creating the Camera, and creating the Viewport.
///I have added some lights and entities to give it some flesh.
///Entities are instances of PhysicsEntity, which is the class where all physics properties
///will be implemented
void BaseApp::setupScene()
{
mgr = mRoot->createSceneManager(ST_GENERIC, "Default SceneManager");
Viewport *vp;
PhysicsEntity *PhysEnt(0);
Light *light;
mgr->setAmbientLight( ColourValue( 0, 0, 0 ) );
mgr->setShadowTechnique( SHADOWTYPE_TEXTURE_MODULATIVE );
mCamera = mgr->createCamera("PlayerCam");
mCamera->setPosition(Vector3(300,300,200));
mCamera->lookAt(Vector3(0,0,0));
mCamera->setNearClipDistance(5);
vp = mRoot->getAutoCreatedWindow()->addViewport(mCamera);
vp->setBackgroundColour(ColourValue(0,0,0));
mCamera->setAspectRatio(Real(vp->getActualWidth()) / Real(vp->getActualHeight()));
light = mgr->createLight("Light1");
light->setType(Light::LT_POINT);
light->setPosition(0, 15, 25);
light->setDiffuseColour(.25, .25, 0);
light->setSpecularColour(.25, .25, 0);
light = mgr->createLight("Light3");
light->setType(Light::LT_DIRECTIONAL);
light->setPosition(10,10,10);
light->setCastShadows(true);
light->setDiffuseColour(.25, .25, 0);
light->setSpecularColour(.25, .25, 0);
light->setDirection(Vector3( 0, -1, 1 ));
PhysEnt=new PhysicsEntity(mgr,PhysicsEntity::cube);
PhysEnt->Geometry->scale(10,10,10);
PhysicsEntities.push_back(*PhysEnt);
PhysEnt=new PhysicsEntity(mgr,PhysicsEntity::plane);
PhysEnt->Geometry->scale(1000,1000,1000);
PhysicsEntities.push_back(*PhysEnt);
}
///Every frame you must call the capture method on all Keyboard, Mouse, and Joystick objects you use.
///Our BaseFrameListener class manages all this for us.
void BaseApp::createFrameListener()
{
mListener= new BaseFrameListener(mRoot->getAutoCreatedWindow(),mCamera);
mRoot->addFrameListener(mListener);
}
///Every frame you must also update all physics entities
///Our PhysicsFramelistener class manages all this for us.
void BaseApp::createPhysicsFrameListener()
{
PhListener= new PhysicsFrameListener(PhysicsEntities);
mRoot->addFrameListener(PhListener);
}
///This will render the application until a FrameListener returns false.
void BaseApp::startRenderLoop()
{
mRoot->startRendering();
}
</textarea>
<br />
<br />
<br />
The BaseFrameListener is another very important piece of code that allows one to control the rendering flow. <br />
In order to manage whatever happens on every rendering step, Ogre provides the FrameListener object.<br />
With the installed package comes an ExampleFrameListener.h file, which overrides the basic Ogre FrameListener and allows for a fairly good control over the inputting devices such as keyboard and mouse.I have slightly customised it for my purposes.<br />
It has been a bit tricky however, and has made my computer crash a few times.<br />
Anyway, here it is, domesticated at last!<br />
<b><br /></b><br />
<b>BaseFrameListener.h</b>: <br />
<textarea cols="55" name="textfield" rows="20">/*
-----------------------------------------------------------------------------
This source file is part of OGRE
(Object-oriented Graphics Rendering Engine)
For the latest info, see http://www.ogre3d.org/
Copyright (c) 2000-2006 Torus Knot Software Ltd
Also see acknowledgements in Readme.html
You may use this sample code for anything you like, it is not covered by the
LGPL like the rest of the engine.
-----------------------------------------------------------------------------
*/
/*
-----------------------------------------------------------------------------
Filename: ExampleFrameListener.h->Adapted into BaseFrameListener
Description: Defines an example frame listener which responds to frame events.
This frame listener just moves a specified camera around based on
keyboard and mouse movements.
Mouse: Freelook
W or Up: Forward
S or Down:Backward
A: Step left
D: Step right
PgUp: Move upwards
PgDown: Move downwards
F: Toggle frame rate stats on/off
R: Render mode
T: Cycle texture filtering
Bilinear, Trilinear, Anisotropic(8)
P: Toggle on/off display of camera position / orientation
Imp Pant: Saves an incremental Screenshot
-----------------------------------------------------------------------------
*/
#ifndef BASEFRAMELISTENER_H_
#define BASEFRAMELISTENER_H_
#include "Ogre.h"
#include "OgreStringConverter.h"
#include "OgreException.h"
//Use this define to signify OIS will be used as a DLL
//(so that dll import/export macros are in effect)
#define OIS_DYNAMIC_LIB
#include <OIS/OIS.h>
using namespace Ogre;
class BaseFrameListener: public FrameListener, public WindowEventListener
{
protected:
Camera* mCamera;
Vector3 mTranslateVector;
Real mCurrentSpeed;
RenderWindow* mWindow;
bool mStatsOn;
std::string mDebugText;
unsigned int mNumScreenShots;
float mMoveScale;
float mSpeedLimit;
Degree mRotScale;
// just to stop toggles flipping too fast
Real mTimeUntilNextToggle ;
Radian mRotX, mRotY;
TextureFilterOptions mFiltering;
int mAniso;
int mSceneDetailIndex ;
Real mMoveSpeed;
Degree mRotateSpeed;
Overlay* mDebugOverlay;
//OIS Input devices
OIS::InputManager* mInputManager;
OIS::Keyboard* mKeyboard;
OIS::Mouse* mMouse;
virtual void updateStats(void)
{
static String currFps = "Current FPS: ";
static String avgFps = "Average FPS: ";
static String bestFps = "Best FPS: ";
static String worstFps = "Worst FPS: ";
static String tris = "Triangle Count: ";
static String batches = "Batch Count: ";
// update stats when necessary
try {
OverlayElement* guiAvg = OverlayManager::getSingleton().getOverlayElement("Core/AverageFps");
OverlayElement* guiCurr = OverlayManager::getSingleton().getOverlayElement("Core/CurrFps");
OverlayElement* guiBest = OverlayManager::getSingleton().getOverlayElement("Core/BestFps");
OverlayElement* guiWorst = OverlayManager::getSingleton().getOverlayElement("Core/WorstFps");
const RenderTarget::FrameStats& stats = mWindow->getStatistics();
guiAvg->setCaption(avgFps + StringConverter::toString(stats.avgFPS));
guiCurr->setCaption(currFps + StringConverter::toString(stats.lastFPS));
guiBest->setCaption(bestFps + StringConverter::toString(stats.bestFPS)
+" "+StringConverter::toString(stats.bestFrameTime)+" ms");
guiWorst->setCaption(worstFps + StringConverter::toString(stats.worstFPS)
+" "+StringConverter::toString(stats.worstFrameTime)+" ms");
OverlayElement* guiTris = OverlayManager::getSingleton().getOverlayElement("Core/NumTris");
guiTris->setCaption(tris + StringConverter::toString(stats.triangleCount));
OverlayElement* guiBatches = OverlayManager::getSingleton().getOverlayElement("Core/NumBatches");
guiBatches->setCaption(batches + StringConverter::toString(stats.batchCount));
OverlayElement* guiDbg = OverlayManager::getSingleton().getOverlayElement("Core/DebugText");
guiDbg->setCaption(mDebugText);
}
catch(...) { /* ignore */ }
}
public:
// Constructor takes a RenderWindow because it uses that to determine input context
BaseFrameListener(RenderWindow* win, Camera* cam, bool bufferedKeys = false, bool bufferedMouse = false) :
mCamera(cam),
mTranslateVector(Vector3::ZERO),
mCurrentSpeed(0),
mWindow(win),
mStatsOn(true),
mNumScreenShots(0),
mMoveScale(0.0f),
mRotScale(0.0f),
mTimeUntilNextToggle(0),
mFiltering(TFO_BILINEAR),
mAniso(1),
mSceneDetailIndex(0),
mMoveSpeed(100),
mRotateSpeed(36),
mDebugOverlay(0),
mInputManager(0),
mKeyboard(0),
mMouse(0)
{
mDebugOverlay = OverlayManager::getSingleton().getByName("Core/DebugOverlay");
LogManager::getSingletonPtr()->logMessage("*** Initializing OIS ***");
OIS::ParamList pl;
size_t windowHnd = 0;
std::ostringstream windowHndStr;
win->getCustomAttribute("WINDOW", &windowHnd);
windowHndStr << windowHnd;
pl.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str()));
mInputManager = OIS::InputManager::createInputSystem( pl );
//Create all devices (We only catch joystick exceptions here, as, most people have Key/Mouse)
mKeyboard = static_cast<OIS::Keyboard*>(mInputManager->createInputObject( OIS::OISKeyboard, bufferedKeys ));
mMouse = static_cast<OIS::Mouse*>(mInputManager->createInputObject( OIS::OISMouse, bufferedMouse ));
//Set initial mouse clipping size
windowResized(mWindow);
showDebugOverlay(true);
//Register as a Window listener
WindowEventUtilities::addWindowEventListener(mWindow, this);
}
//Adjust mouse clipping area
virtual void windowResized(RenderWindow* rw)
{
unsigned int width, height, depth;
int left, top;
rw->getMetrics(width, height, depth, left, top);
const OIS::MouseState &ms = mMouse->getMouseState();
ms.width = width;
ms.height = height;
}
//Unattach OIS before window shutdown (very important under Linux)
virtual void windowClosed(RenderWindow* rw)
{
//Only close for window that created OIS (the main window in these demos)
if( rw == mWindow )
{
if( mInputManager )
{
mInputManager->destroyInputObject( mMouse );
mInputManager->destroyInputObject( mKeyboard );
OIS::InputManager::destroyInputSystem(mInputManager);
mInputManager = 0;
}
}
}
virtual ~BaseFrameListener()
{
//Remove ourself as a Window listener
WindowEventUtilities::removeWindowEventListener(mWindow, this);
windowClosed(mWindow);
}
virtual bool processUnbufferedKeyInput(const FrameEvent& evt)
{
if(mKeyboard->isKeyDown(OIS::KC_A))
mTranslateVector.x = -mMoveScale; // Move camera left
if(mKeyboard->isKeyDown(OIS::KC_D))
mTranslateVector.x = mMoveScale; // Move camera RIGHT
if(mKeyboard->isKeyDown(OIS::KC_UP) || mKeyboard->isKeyDown(OIS::KC_W) )
mTranslateVector.z = -mMoveScale; // Move camera forward
if(mKeyboard->isKeyDown(OIS::KC_DOWN) || mKeyboard->isKeyDown(OIS::KC_S) )
mTranslateVector.z = mMoveScale; // Move camera backward
if(mKeyboard->isKeyDown(OIS::KC_PGUP))
mTranslateVector.y = mMoveScale; // Move camera up
if(mKeyboard->isKeyDown(OIS::KC_PGDOWN))
mTranslateVector.y = -mMoveScale; // Move camera down
if(mKeyboard->isKeyDown(OIS::KC_RIGHT))
mCamera->yaw(-mRotScale);
if(mKeyboard->isKeyDown(OIS::KC_LEFT))
mCamera->yaw(mRotScale);
if( mKeyboard->isKeyDown(OIS::KC_ESCAPE) || mKeyboard->isKeyDown(OIS::KC_Q) )
return false;
if( mKeyboard->isKeyDown(OIS::KC_F) && mTimeUntilNextToggle <= 0 )
{
mStatsOn = !mStatsOn;
showDebugOverlay(mStatsOn);
mTimeUntilNextToggle = 1;
}
if( mKeyboard->isKeyDown(OIS::KC_T) && mTimeUntilNextToggle <= 0 )
{
switch(mFiltering)
{
case TFO_BILINEAR:
mFiltering = TFO_TRILINEAR;
mAniso = 1;
break;
case TFO_TRILINEAR:
mFiltering = TFO_ANISOTROPIC;
mAniso = 8;
break;
case TFO_ANISOTROPIC:
mFiltering = TFO_BILINEAR;
mAniso = 1;
break;
default: break;
}
MaterialManager::getSingleton().setDefaultTextureFiltering(mFiltering);
MaterialManager::getSingleton().setDefaultAnisotropy(mAniso);
showDebugOverlay(mStatsOn);
mTimeUntilNextToggle = 1;
}
if(mKeyboard->isKeyDown(OIS::KC_SYSRQ) && mTimeUntilNextToggle <= 0)
{
std::ostringstream ss;
ss << "screenshot_" << ++mNumScreenShots << ".png";
mWindow->writeContentsToFile(ss.str());
mTimeUntilNextToggle = 0.5;
mDebugText = "Saved: " + ss.str();
}
if(mKeyboard->isKeyDown(OIS::KC_R) && mTimeUntilNextToggle <=0)
{
mSceneDetailIndex = (mSceneDetailIndex+1)%3 ;
switch(mSceneDetailIndex) {
case 0 : mCamera->setPolygonMode(PM_SOLID); break;
case 1 : mCamera->setPolygonMode(PM_WIREFRAME); break;
case 2 : mCamera->setPolygonMode(PM_POINTS); break;
}
mTimeUntilNextToggle = 0.5;
}
static bool displayCameraDetails = false;
if(mKeyboard->isKeyDown(OIS::KC_P) && mTimeUntilNextToggle <= 0)
{
displayCameraDetails = !displayCameraDetails;
mTimeUntilNextToggle = 0.5;
if (!displayCameraDetails)
mDebugText = "";
}
// Print camera details
if(displayCameraDetails)
mDebugText = "P: " + StringConverter::toString(mCamera->getDerivedPosition()) +
" " + "O: " + StringConverter::toString(mCamera->getDerivedOrientation());
// Return true to continue rendering
return true;
}
virtual bool processUnbufferedMouseInput(const FrameEvent& evt)
{
// Rotation factors, may not be used if the second mouse button is pressed
// 2nd mouse button - slide, otherwise rotate
const OIS::MouseState &ms = mMouse->getMouseState();
if( ms.buttonDown( OIS::MB_Right ) )
{
mTranslateVector.x += ms.X.rel * 0.13;
mTranslateVector.y -= ms.Y.rel * 0.13;
}
else
{
mRotX = Degree(-ms.X.rel * 0.13);
mRotY = Degree(-ms.Y.rel * 0.13);
}
return true;
}
virtual void moveCamera()
{
// Make all the changes to the camera
// Note that YAW direction is around a fixed axis (freelook style) rather than a natural YAW
//(e.g. airplane)
mCamera->yaw(mRotX);
mCamera->pitch(mRotY);
mCamera->moveRelative(mTranslateVector);
}
virtual void showDebugOverlay(bool show)
{
if (mDebugOverlay)
{
if (show)
mDebugOverlay->show();
else
mDebugOverlay->hide();
}
}
// Override frameRenderingQueued event to process that (don't care about frameEnded)
bool frameRenderingQueued(const FrameEvent& evt)
{
if(mWindow->isClosed()) return false;
mSpeedLimit = mMoveScale * evt.timeSinceLastFrame;
//Need to capture/update each device
mKeyboard->capture();
mMouse->capture();
Ogre::Vector3 lastMotion = mTranslateVector;
//Check if one of the devices is not buffered
if(!mKeyboard->buffered()|| !mMouse->buffered() )
{
// one of the input modes is immediate, so setup what is needed for immediate movement
if (mTimeUntilNextToggle >= 0)
mTimeUntilNextToggle -= evt.timeSinceLastFrame;
// Move about 100 units per second
mMoveScale = mMoveSpeed * evt.timeSinceLastFrame;
// Take about 10 seconds for full rotation
mRotScale = mRotateSpeed * evt.timeSinceLastFrame;
mRotX = 0;
mRotY = 0;
mTranslateVector = Ogre::Vector3::ZERO;
}
//Check to see which device is not buffered, and handle it
if( !mKeyboard->buffered() )
if( processUnbufferedKeyInput(evt) == false )
return false;
if( !mMouse->buffered() )
if( processUnbufferedMouseInput(evt) == false )
return false;
// ramp up / ramp down speed
if (mTranslateVector == Ogre::Vector3::ZERO)
{
// decay (one third speed)
mCurrentSpeed -= evt.timeSinceLastFrame * 0.3;
mTranslateVector = lastMotion;
}
else
{
// ramp up
mCurrentSpeed += evt.timeSinceLastFrame;
}
// Limit motion speed
if (mCurrentSpeed > 1.0)
mCurrentSpeed = 1.0;
if (mCurrentSpeed < 0.0)
mCurrentSpeed = 0.0;
mTranslateVector *= mCurrentSpeed;
if(!mKeyboard->buffered() || !mMouse->buffered())
moveCamera();
return true;
}
bool frameEnded(const FrameEvent& evt)
{
updateStats();
return true;
}
};
#endif /*BASEFRAMELISTENER_H_*/
</textarea>
<b><br /></b><br />
<br />
Once the beast is under control, the rest is a piece of cake...hehehe...<b> </b><br />
You can make as many instances of a FrameListener as you need in an Ogre application.<br />
I have chosen to create a separate framelistener for managing whatever goes under the physics, to keep things up neat and tidy.<br />
It is the PhysicsFrameListener class:<br />
<br />
<b>PhysicsFrameListener.h</b>: <br />
<textarea cols="55" name="textfield" rows="20">/*
#ifndef PHYSICSFRAMELISTENER_H_
#define PHYSICSFRAMELISTENER_H_
#include "PhysicsEntity.h"
#include <iostream>
#include <math.h>
#include <vector>
#include <time.h>
#include <ctime>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <Ogre.h>
using namespace Ogre;
///This class is in charge to manage the physics before every
///render step on the Ogre window.
class PhysicsFrameListener : public FrameListener
{
public:
///The Ents vector contains the entities with physical properties attached to them
///In this example, no physics are used yet. Just an X-axis displacement is applied
///to perceive motion.
PhysicsFrameListener(std::vector<PhysicsEntity> Ents):
Entities(Ents)
{
}
///frameStarted is an overriden event from the Ogre FrameListener.
///Note that positions are updated before sending the information
///to the root object in the go loop.
bool frameStarted(const FrameEvent& evt)
{
UpdatePositions();
return true;
}
///Update positions is in charge to reallocate the entities to their future locations
void UpdatePositions()
{
// PhysicsEntity::EntityType TypeEnt;
for (unsigned int i=0; i<Entities.size(); i++)
{
if (Entities[i].GeomType==PhysicsEntity::cube)
Entities[i].Geometry->translate(0.1,0,0,Ogre::Node::TS_WORLD);
}
}
private:
std::vector<PhysicsEntity> Entities;
};
#endif /*PHYSICSFRAMELISTENER_H_*/
</textarea>
<br />
<br />
<br />
The elementary brick on which everything else will be constructed is likely to be called PhysicsEntity.<br />
So I have defined my PhysicsEntity Class.<br />
In this code is still at its very bones, just presenting a couple of functions to make things visible.<br />
Hopefully in the near future some more flesh will get added on it!<br />
<br />
<b>PhysicsEntity.h</b>: <br />
<textarea cols="55" name="textfield" rows="20">/*
#ifndef PHYSICSENTITY_H_
#define PHYSICSENTITY_H_
#include <Ogre.h>
using namespace Ogre;
class PhysicsEntity
{
public:
enum EntityType
{
cube,
plane
};
PhysicsEntity(SceneManager *SceneMgr,EntityType ShapeType);
~PhysicsEntity();
double mass;
Vector3 position;
Vector3 velocity;
Vector3 acceleration;
SceneNode *Geometry;
EntityType GeomType;
private:
ManualObject* createCubeMesh(Ogre::String, Ogre::String);
ManualObject* createPlane(Ogre::String, Ogre::String);
};
#endif /*PHYSICSENTITY_H_*/
</textarea>
<br />
<b>PhysicsEntity.cpp</b>: <br />
<textarea cols="55" name="textfield" rows="20">/*
#include "PhysicsEntity.h"
PhysicsEntity::PhysicsEntity(SceneManager *SceneMgr,EntityType ShapeType)
{
Geometry = SceneMgr->getRootSceneNode()->createChildSceneNode();
Geometry->setPosition(0,5,0);
GeomType=ShapeType;
switch (GeomType)
{
case cube:
Geometry->attachObject(createCubeMesh("Cube","myMaterial"));
break;
case plane:
Geometry->attachObject(createPlane("Plane","myMaterial"));
break;
};
}
PhysicsEntity::~PhysicsEntity()
{
}
ManualObject* PhysicsEntity::createCubeMesh(Ogre::String name, Ogre::String matName)
{
ManualObject* cube = new ManualObject(name);
cube->begin(matName);
cube->position(0.5,-0.5,1.0);cube->normal(0.408248,-0.816497,0.408248);cube->textureCoord(1,0);
cube->position(-0.5,-0.5,0.0);cube->normal(-0.408248,-0.816497,-0.408248);cube->textureCoord(0,1);
cube->position(0.5,-0.5,0.0);cube->normal(0.666667,-0.333333,-0.666667);cube->textureCoord(1,1);
cube->position(-0.5,-0.5,1.0);cube->normal(-0.666667,-0.333333,0.666667);cube->textureCoord(0,0);
cube->position(0.5,0.5,1.0);cube->normal(0.666667,0.333333,0.666667);cube->textureCoord(1,0);
cube->position(-0.5,-0.5,1.0);cube->normal(-0.666667,-0.333333,0.666667);cube->textureCoord(0,1);
cube->position(0.5,-0.5,1.0);cube->normal(0.408248,-0.816497,0.408248);cube->textureCoord(1,1);
cube->position(-0.5,0.5,1.0);cube->normal(-0.408248,0.816497,0.408248);cube->textureCoord(0,0);
cube->position(-0.5,0.5,0.0);cube->normal(-0.666667,0.333333,-0.666667);cube->textureCoord(0,1);
cube->position(-0.5,-0.5,0.0);cube->normal(-0.408248,-0.816497,-0.408248);cube->textureCoord(1,1);
cube->position(-0.5,-0.5,1.0);cube->normal(-0.666667,-0.333333,0.666667);cube->textureCoord(1,0);
cube->position(0.5,-0.5,0.0);cube->normal(0.666667,-0.333333,-0.666667);cube->textureCoord(0,1);
cube->position(0.5,0.5,0.0);cube->normal(0.408248,0.816497,-0.408248);cube->textureCoord(1,1);
cube->position(0.5,-0.5,1.0);cube->normal(0.408248,-0.816497,0.408248);cube->textureCoord(0,0);
cube->position(0.5,-0.5,0.0);cube->normal(0.666667,-0.333333,-0.666667);cube->textureCoord(1,0);
cube->position(-0.5,-0.5,0.0);cube->normal(-0.408248,-0.816497,-0.408248);cube->textureCoord(0,0);
cube->position(-0.5,0.5,1.0);cube->normal(-0.408248,0.816497,0.408248);cube->textureCoord(1,0);
cube->position(0.5,0.5,0.0);cube->normal(0.408248,0.816497,-0.408248);cube->textureCoord(0,1);
cube->position(-0.5,0.5,0.0);cube->normal(-0.666667,0.333333,-0.666667);cube->textureCoord(1,1);
cube->position(0.5,0.5,1.0);cube->normal(0.666667,0.333333,0.666667);cube->textureCoord(0,0);
cube->triangle(0,1,2); cube->triangle(3,1,0);
cube->triangle(4,5,6); cube->triangle(4,7,5);
cube->triangle(8,9,10); cube->triangle(10,7,8);
cube->triangle(4,11,12); cube->triangle(4,13,11);
cube->triangle(14,8,12); cube->triangle(14,15,8);
cube->triangle(16,17,18); cube->triangle(16,19,17);
cube->end();
return cube;
}
ManualObject* PhysicsEntity::createPlane(Ogre::String name, Ogre::String matName)
{
ManualObject* plane = new ManualObject(name);
plane->begin(matName);
plane->position(-0.5,0,-0.5);plane->normal(0.408248,-0.816497,0.408248);plane->textureCoord(1,0);
plane->position(-0.5,0.0,0.5);plane->normal(-0.408248,-0.816497,-0.408248);plane->textureCoord(0,1);
plane->position(0.5,0.0,0.5);plane->normal(0.666667,-0.333333,-0.666667);plane->textureCoord(1,1);
plane->position(0.5,0.0,-0.5);plane->normal(-0.666667,-0.333333,0.666667);plane->textureCoord(0,0);
plane->triangle(0,1,2); plane->triangle(0,2,3);
plane->end();
return plane;
}
</textarea>
<br />
<br />
<br />
Last, but not least, is the main.cpp file, where everything gets blended:<br />
<br />
<b>main.cpp</b>: <br />
<textarea cols="55" name="textfield" rows="20">/*
#include "BaseApp.h"
///This is the top module for running any Ogre based application
///Is just simple an concise.
///Call the go method of the BaseApp class and everything just goes
int main(int argc, char **argv)
{
// Create application object
BaseApp app;
//Just in case, catch any errors
try
{
//Call the go method, where all the private settings
//for running an Ogre app are called
app.go();
}
catch(Exception& e)
{
printf( "An exception has occurred: %s\n",
e.getFullDescription().c_str());
}
return 0;
}
</textarea><br />
<br />
And this is it.
Now...Let's get busy!Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6352511023055453909.post-19833654134443754142010-03-31T14:29:00.000-07:002010-03-31T15:11:29.862-07:00CODE NAME: BrachistochronaToday I'm going to reveal a classified archive. Or so it seems...<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizYGUvQ7OoQ4TCN9j3Gl3trU_6-ldcPNZhZVTKeOJbSi6MRsyjyAN6oMrejaR6M9HrGWNdULhyphenhyphenoXDpVe3UsBGLc8ctljBb2iMdrdOMTac9QXpRRygitpj0m13IZeeJrWeZaQT9BOSslZsx/s1600/top-secret.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizYGUvQ7OoQ4TCN9j3Gl3trU_6-ldcPNZhZVTKeOJbSi6MRsyjyAN6oMrejaR6M9HrGWNdULhyphenhyphenoXDpVe3UsBGLc8ctljBb2iMdrdOMTac9QXpRRygitpj0m13IZeeJrWeZaQT9BOSslZsx/s320/top-secret.jpg" /></a></div>
Physicians have been keeping this knowledge from us simple mortals for centuries...hehehe...<br />
While trying to understand the essentials on variational mechanics, I have come into this article: <a href="http://jazz.openfun.org/wiki/Brachistochrone">http://jazz.openfun.org/wiki/Brachistochrone</a>.<br />
The problem of the brachistochrone dates back to Newton (17th century) and appears mentioned frequently as one of the problems that can be solved be means of this refined technique.<br />
<br />
In fact, this problem appears to be the actual trigger for the modern physics (or better stated, its solution), and reveals a completely counterintuitive phenomenon:<br />
<br />
<b>The quickest path is not the straight line</b><br />
<br />
Amazingly, the solution for a bead on a wire going in the least time from point A to point B:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlFuQBCu-Ti-d2haH0Bc6OSuRGc2lmS-witvRBpS0cDfe6nhYtSjovJ1PnyYVzoYmr2fD0MuN1Tk4tZqrUZyV0QJxc_km9Jeogr0y3qAz3l9O9MymB-Al3rXoeevyaEf_I9UT22lsQrPgo/s1600/Brachistochrone.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlFuQBCu-Ti-d2haH0Bc6OSuRGc2lmS-witvRBpS0cDfe6nhYtSjovJ1PnyYVzoYmr2fD0MuN1Tk4tZqrUZyV0QJxc_km9Jeogr0y3qAz3l9O9MymB-Al3rXoeevyaEf_I9UT22lsQrPgo/s320/Brachistochrone.png" /></a></div>
<br />
Is the cycloid represented in the picture.<br />
<br />
As standard human, one always tends to think that the shortest path would be the quickest one. It is wrong.<br />
Analogously, when it comes to minimize the action (see previous posts on the subject), it is very hard to imagine that the stationary points would not come at flattening the curve for the action.<br />
This is what makes so hard to understand the variational principles that rule over Lagrangian, Eulerian and Hamiltonian mechanics.<br />
<br />
If one only had been told...<br />
<br />
I have made a spreadsheet with openoffice (<a href="http://www.openoffice.org/">www.openoffice.org</a>) where this can be numerically perceived also.<br />
<br />
<b>The spreadsheet is <a href="http://www.mnbvlabs.com/Thesis/EulerVariational.ods">here</a>.</b><br />
<br />
I have made it with the help of a paper by Jozef Hanc: <a href="http://www.google.es/url?sa=t&source=web&ct=res&cd=1&ved=0CAYQFjAA&url=http%3A%2F%2Fwww.eftaylor.com%2Fpub%2FHancEulerEJP.pdf&ei=RMizS-ejAs-N4gba0e2cAg&usg=AFQjCNG4UqmFWYufyzZHPcz2LMO0XwgZlQ&sig2=ncESlxp5h9GL2BeTuIlByA">The original Euler's calculus-of-variations method: Key to Lagrangian mechanics for beginners.</a><br />
I found it extremely appropriate for my case, and also absolutely clarifying. Thanks mr Hanc<br />
<br />Unknownnoreply@blogger.com0