 So this is the outline of my talk today. First of all an introduction about multi-body simulation next. Yeah, okay some background information. Then I would like to show you some assemblies. So I would fill this talk at least half of it to show you some assemblies so that you get an impression what is in fact possible with this package in the end. This package is not in public already. It will be published maybe in September. And in the end I will give you a short note of future work and some back up. Package name is multi-body symbol which is says multi-body symbolic. So in fact there are two different ways to approach this problem. You can use symbolic equations and you can stick more to the numerical side. Most of the industrial products stick to the numerical side, but we decided to approach it analytically. Our aim is to provide on basis of existing Python packages to provide once in a while a complete multi-body simulation tool. So why is this important for us? I mean you can guess it. We want to be independent from market leaders. Market leaders for example a sim pack or also VL or also Adams costs a whole lot of money. The license and all of these companies are now not they are now yeah, bored by very big companies. So it is not possible to yeah to stick in this development process much easy. Second scripting ability is included. Of course it's in Python, so it's of course included and third educational purposes. So what is multi-body simulation? Multi-body simulation deals with systems which can be described by these equations. These are the Newtonian Euler equations. They are differential equations, so they are well known since several hundred years. What is the problem writing them down and integrating them? Well the problem here is as you will see in my talk this F is not only an expression which you can write down. It happens that most of multi-body simulation assemblies include constraints and constraints are like a ball which runs on a table or sliders or whatsoever. So these constraint forces are in fact the difficult thing in multiple simulations. We look back at the development process of 30 years more or less, not us, but in general, so the yeah, the community and the scientific community is working on this problem since more or less 30 years and you can imagine they have come up a whole tons of papers out of there and yeah, and you cannot expect to climb up within half a year on top, but we are very enthusiastic and we think we can go ahead this way. So use cases of this multi-body simulation is mechanical engineering, ground vehicle dynamics, robotics and biomechanics. Each of these branches are more each of these spreading branches is modern and relevant. So I'm working in ground vehicle dynamics since more or less seven years and I'm doing right and handling simulation for another company right now and I know how, what difficulties are in this in this field. So what package are we using? SimPy, it's more or less the basis of this one. SimPy is these guys who produced SimPy, they were doing a really really really great job and I would like to thank you those people. It's a symbolic algebra package, so it replaces more or less these three products and it's on a very, it's right at the moment, it's on an advanced level, so it's not that you can just do some algebra derivatives or integrals, it's on a high advanced level and it also includes already advanced mechanics. So why do not parcel these together, stick these loose ends together and and produce something with which you can do your multipoly simulation. So fine, we try to do this. Yeah, I would like not to forget these packages which are really really helpful and maybe the core of numerical and scientific, Python programming, NumPy and SimPy and without these it would not happen anything about of these. For linear algebraic solvers, we use NumPy, they're very very very advanced and not forget well tested. So these packages are so well tested that you can trust on this and this is good. There are some ODE solvers in SimPy available. So in the end we need some graphics. Graphics we did with vPyzen, vPyzen is a medium advanced. It is really really nice, but it has some primitives, called primitives, some rods, springs and so on and you can put these together and make out of these your graphics simulation. In fact, you need this to make sure that your assembled equations behave well. So just a visual check of your solution. I mean you cannot just solve your equations and then put some some graphs and then you cannot judge if this is done really nice or really good. You have some visual check up. Now some background theory. I will I will try to make this short. Building blocks of a mechanical system, you have your bodies, everybody has six degrees of freedom, translation rotational, including the time derivatives you end up with 12 degrees of freedom. So each body should lead to, yeah, to 12 lines in your system of ordinary differential equations. If there wouldn't be some possibilities to boil it down somehow. Each of these bodies has mass and moments of inertia in intrinsic. So this is the figure citation. This is not mine. This is also not my figure, so I will cite it. You can boil down. You can boil down the numbers of degrees of freedom by joints. Toins you can think about as two bodies are connected. We are joints like in your skeleton. And in fact, it's technically done more or less the same. Each of these joints can be produced in a technical sense and in the end. But these joints, you reduce the numbers of degrees of freedom. Here we talk about these type of joints, cardinic, axis, revolute. For example, if you think about a tire on a car, it's just revolute, except that, okay, the front tire can also steer, but more or less revolute, so it's a revolute joint. In these equations appears forces and torques, forces and torques accelerates your masses. So forces, most of the time, appear pairwise. So if one body is attracting another, it's the same done for the other body. But you have different types of forces, pairwise forces. So think about sun and earth, for example. The external forces, if you just want to find a system of a mechanical system on earth, you would add the gravitational force, of course, and you wouldn't include the earth as an independent mass, but you just would add your gravitational field as an external force. And the difficult things, the constrained forces. For example, if you have here a surface and a ball is running on the surface, the surface would act a force on the ball to be on this surface. So in multibody simulation, you'll see most many times these kind of drawings, because these kind of drawings show most of the things included. Here, for example, you have a chain of bodies and here are the joints. And you can see, if you switch from Cartesian coordinates to just the angle here, you can reduce it somehow, the number of degrees of freedom. Nobody would write this down in Cartesian coordinates, but in angles. But you know, if the generalized coordinates are minimal, it equals the number of degrees of freedom. But it is not always the case, so you can have more generalized coordinates, so you would have add on top of it some equations, which gives you the constraints. Even the generalized coordinates are not unique. So you can, for example, measure the angle towards the set axis or towards the axis of the previous body. So it is not at all unique, the set of generalized coordinates. One problem, which is really maybe the main or one of the core problems in multibody simulation is this one. So if you have, this is called a constrained loop. If you do not just have your joints, but if you have another constraint in the end, which builds a constrained loop, you can say, okay, these angles here on top, they are somehow connected to each other. They cannot be independent at all. And this is called constrained loop, and this constrained loop produces another equation, most of the time an algebraic equation. And this algebraic equation, you can take care of in several possibilities to solve these kind of problems. Most of the time, there are differential algebraic equation methods, but they are very costly, and in Python, maybe too slow. So we propose here a solution according to Lagrange one with additional drawback force. For linearization, you can always put this algebraic equation into your set of equations. Here, this is the set of methods we can use to generate our equations of motions. In this package, they produce here already Keynes method, which is also called Dallon-Bear's principle of virtual work. And Lagrange method number two, emittance equations is another possibility, but not used here. Okay, so I will show you what, how it is used. You just need to, if you are a user, you just need to have an object which sets up your world, just give you a world coordinate system and a marker. A marker is always a coordinate system in the language of multi-body simulation. There are methods provided to add bodies, markers, so extra coordinate systems, external forces, extra constraints, and for example, reflective walls. ODE solver is connected, more or less automatically. A 3D graphical backend is connected automatically. So each body signs up in the graphical backend and appears somehow as you want it to be appeared. I will show you examples later on. Some physical quantities are provided, like energy, forces, velocity, and so on. You can, if you, I mean, we are inside Python, so you can calculate whatever you want here. And this is the advantage. New and interesting. So what did we put into this work? We would like to have a completeness of joints and tools. And the Jacobian is calculated for linearization analysis, so this is on top. A nice feature, very nice feature. The linearization tool, which is already in Sympi, is kind of completed. You can detect automatically independent and dependent coordinates and so on. Constraints loop are more or less kind of solved here. External models and parameters can be included. This is a very important point here, the external models, which I will show you in one example. We have also some B splines, which can be used if you don't have an analytical expression for your force. You can also include some kind of B splines for having a representative of your force function. So sometimes measurements don't give you analytical expressions. Okay, coding style, set up the system. Here, this is your multi-body simulation world. You add your bodies, your markers, your forces, your force models, your external force model, your geometric constraint. Assembling and solving is just this one. Here, you have maybe some constant, like the gravitational constant. You give it a number. You produce equations of motion and integrate them. Post-processing is calculation of linear analysis, linearization, so stability analysis. You prepare and animate your result. Okay, if you would like to be a developer once in a time or if you would like to work with SimPy once in a time, you should be aware of these three things. I mean you should be aware of many things, but these three, especially, never use SimPy for numerics. Do not try to use, for example, to use SimPy to solve for eigenvectors. It will never happen. It will never be as fast as NumPy. So find the right step between SimPy to NumPy. Okay, so I got the sign for 10 minutes right now, so I will hurry a little bit up. LambdaPy is one of the core functions of SimPy. I mean if you have an algebraic expression, what can you do with it in a computer? You would like to use it as a function and to use it as a function, you use this word which is called LambdaPy. You LambdaPy expressions into Python functions. This is maybe the most impressive invention here, not our from SimPy. And ODE solvers don't use your own, so even if it looks like fun to produce one, it is not never as good as those which are around. Use those. We use LS ODE solver. This is also called for sundials. Maybe if you are interested in these topics, you know that sundials is an open-source solver which is out there, but not connected to Python. At the moment, it is connected, but it stopped kind of at Python 2.6 also. So I would like to connect this and use this sundial solvers, which is really good in my opinion. Okay, I will show you examples. And for these examples, not only the pictures, but also the results, so the movies. Okay, this is bad because now it appears here on my screen and not on the screen. I wanted it to be appeared. So this is what comes out more or less. This is a crank slide. Something called crank slide. And this is a simple example for a constrained loop. Here, this goes round and round. And this goes linear. So this is rotating linear. You see we put in also some forces. And here, an extra constrained force. So this, if we don't put this constrained force here, it would be just a pendulum. So I will skip some of these because I have 12 and this is too much. Maybe this one. Yeah, some spring and it's a reflective wall here at this position. There's a reflective wall. It's interesting because it's not so fluent, but I don't know why because it's in the middle of two screens maybe. Yeah. So this is a reflective wall example. I will show you this one. This is a simple car. And this is non-trivial. I mean, maybe you can see this, that assembling these equations takes around 60 seconds. Let's take a look at the assembly here. So these equations, they just come up by this mechanism. And this mechanism, as I told you, is quite easy. So we just add bodies, markers, special forces, and so on. And in the end, here, this is the steering, more or less. And in the end, here, this is the starting vector. So you need starting vectors. And in the end, we just call here canify and then these equations are assembled. And now, it's around 60 seconds assembling equations of motion. And why is this non-trivial? Because it is not only the mechanics, which you can see here. It's also kind of an external model. It's a tire model which we plugged in. And the tire model gives you, I mean, if you think about tires, I know, yeah, if you think about tires, it's a non-trivial external model. And I'm working in ground vehicle dynamics. So it matters a lot to plug in to your system non-trivial external models. And the nice thing here is that it is possible to do this. Now it's integrating. We have around 27 degrees of freedom, in fact, all together. No, 28. So it's okay. It's fast. It's not real time at the moment, but it's fast. So it's not bad. I mean, if you would like to make it real time, you would have to export it in a C or Fortran code. Then it would be real time, but at this level it is not. But it's okay. Hope so. Somehow it's a little bit slower. I don't know why, because maybe it's some resources here out. Yeah. I can tell you this. We used here a Pacheco model. Pacheco, maybe one of some of you may know this. Pacheco is a professor. He's working on tire models. And he's really, really famous in this area of research. And tires, they are quite interesting to model, because it's rubber. And rubber is always difficult. So, for example, if you think about rolling, rolling tires or so, you sometimes include a no slip, a no slip constraint. But the tires, this would never work, because tires produce the longitudinal and vertical force only with slip. So you have to include slip in your calculation. So now, here on top of this, we have calculated, in the end, the eigenvalues of the Jacobian. So you can see this. And now I will go into the animation. In this step, all of these degrees of freedom has to be prepared in Cartesian coordinates, that it works. So now here, let's go. This is our car model. It looks simple, but it's okay. And it is, in fact, more or less fixed on zero, so that it... This is a sign steering. It's a simple maneuver, sign steering. But it's nice that it's working well. You can see it's breaking in the end here on top. I can show you just this. We have also some outputs calculated for the tires, special values for the tires, and put these into these graphs. Okay. So I would skip the examples and go to some future work. This is not so easy. We thought about making this assembly as equations that are very complex objects. This is non-trivial. The assemblies are not. They are quite complex objects. So ZODB, which I really like, but it's based on serialization. And very complex objects cannot be serialized this way. And I would like to do this to make it persistent, because to skip the assembly, which may take a little bit of time. So graphics always, some improvements to be done, model validation. And just in time, compilation is another nice idea to speed up. Post-processing with pandas, maybe you know this package. Okay. So future work. Complete the basics until September and full vehicle simulation. So to end up with a nice full vehicle simulation, better than that one I showed to you October until December 2015. And thank you for your attention. And I would like to invite you to ask questions. Thank you very much. You talked about transitioning from SMPI to NMPI to do numerical computations. Is there an automated path from SMPI to NMPI, perhaps? At the moment, I'm not aware that they are closely connected. And this is a kind of a pitfall. I think you have to, yeah, except for this lamdify you need sometimes, if you plug your numbers in, just convert your SMPI matrices to NMPI matrices one by one. This is how I did it, and this works fine. Thanks. Okay. Thank you very much.