Integrating System Modeler and Finite Element Analysis

Oliver and Vedat show how to link System Modeler with finite element analysis in Wolfram. A room heating example uses a lumped model to set boundary conditions for a heat PDE, finding that 44 W/m³ reaches 20°C average. A beam mechanics example derives spring constants from FEM data and imports them back into System Modeler for controller testing.
Questions this video answers
40,000 seconds (extracting temperature at 30,000 seconds).
Approximately 18 degrees (Celsius).
Q = 200 watts per cubic meter → average temperature ≈ 25°C.
Approximately 44 watts per cubic meter.
10 N, 25 N, 50 N, 75 N, and 100 N.
Chapters
So hello everybody, my name is Oliver and with me is Vedat and I'm working in the numerics group and Vedat is working in the system modeler group. And in today's talk we want to show how we can possibly integrate system modeler and the finite element method that's implemented in ND solve in the Wolfram language. So yeah, so there is different ways of exploring this integration. So you can think of having a system model that drives a finite element analysis or the other way around you have a finite element analysis that drives a system model. And the third way would be to have a what we call CO simulation between a finite element model and a system model where they interact continuously. We're going to look at all of these things. The first thing we're going to exclude is the CO simulation between a finite element model and a system model where we have a back and forth. This is something we'll consider in the future. What we're trying to do now is show some examples that we've explored of how to do this integration. The first thing we're going to look at is a system model drives a finite element analysis and that's a room heating example. And then in the second part we're going to look at the finite element model that's going to drive a system model and there we have a spring constant computation and then we show a proof of concept that you can actually have a finite element model run in system modeler. So those are the things that we'd like to talk about today. Right? So let's start with the room heating example. So we're now thinking about or looking at converting or using a system model to drive a finite element model.
Right here. Now we are looking at a room heating example. So in this type of implementation is really useful when you consider in case that assume you are a stress analysis engineer and you are planning to run some PD analysis for wind turbine and you don't know anything about which load they apply. So what you do in such cases you get the seismic loads from a CFD engineer who run the CFD analysis and you implement such things. So in this example we have room heating system modeler model where we can get all these boundary conditions and initial conditions for a holistic analysis. So when we look at this example, this is a multi domain example including control domain hydraulic and the sorry fluid and the thermal dynamics. So here we have an interactive diagram plot where we test many different scenarios quickly on mathematical environment. We might have either a larger room or smaller we can change it capacity of the room. Maybe we can have a large radiator. So if you want to know about this model, you can visit the From System Modeler web page and look for the college Terminal library. Yes, Oliver.
So we're using a pre existing system model and now we're trying to use some data from the system model in a PDE analysis. What we're going to do is do a simple heat transfer pde. If you want to learn more about heat transfer, there's an entire monograph. It's the heat transfer monograph. And that's a link. You can click on that and get to that page. But, but basically what we're doing is a heat equation where we have a thermal capacitance K and a heat source Q. And we're trying to make a model of this room now.
Okay.
So the dependent variable is the temperature T. We have something that looks a bit like a rectangular room. And in the lower part of the room we have a region that's a little more finely discretized. That's where the heater is. And what we're going to do next is we're going to try to make a finite element analysis of that. So to get the thermal conductivity, we use the thermodynamic data. This is used to set up the parameters for the finite element analysis. In this case, that's more or less the only parameter, material parameter, that we need. The second thing we have to do is we'll have to set up a heat source. So we have a symbolic parameter Q. Q is the amount of heat that's generated from the radiator. And the this is, we have a special function like a region member of this region of the radiator. And if, when we integrate the system, and if that region member function says yes, we are actually integrating inside the region of the heater, then we get this value Q for the heat generation. And if we're outside of the heater, we have zero. That's what this piecewise function is showing. Now what we have to do is we have to set up some boundary conditions for the finite element analysis. And this is where the system modeler comes in. So we use the system model that we had. We run this system model, we simulate it for 40,000 seconds and get a simulation data object. And from this simulation data object, we extract a temperature at a specific point in time, like in this case at 30,000 seconds. And the variable, the system model variable that contains this temperature data is called room with water radiator, room temperature so this is a data point from the system model. And in this case, at this specific temperature time, the temperature was about 18 degrees. Now we use this 18 degrees as a boundary condition. So all four walls in this finite element model will have set this temperature to 18 degrees. And then in the next slide, we're going to see how we set up this entire system. So we now call the function heat transfer PD component with the variables and the parameters that we set up and the boundary conditions on the wall. And we set up a parametric ND solve function. And the parameter is Q and Q is the heat generated in the heater. So when we call this PFAN, that's how I've called it, with 200 watts per cubic meter, we get an interpolating function and that's the temperature distribution for this room with an 18 degrees wall temperature. Now you may want to do something a little differently. So now we've just used 2, 200 watts per cubic meter as a heat. But maybe you want to know something different. How is the temperature or how much heat do I need in the room when I want an average temperature? And we can do that. So now we have a small helper function that's called average that gets a specific heat that's put out of the heater. We compute the parametric function with that value. That gives us an interpolating function. And then we integrate over that function and divide by the area of the region to get a temperature. So for the example that I've previously shown for the average, for the 200 meter watts per cubic meter, we get an average temperature of 25 degrees roughly. Now if we want to say how has the heater to be adjusted so that we get an average temperature of about 20 degrees in the room, then we use find root and we'll start with maybe 200 or any other starting value and it finds a q value of 44 watts per cubic meter. And then we can recompute the interpolating function and get a solution of how the heat is distributed in this room with 18 degrees on the walls and have an average temperature of 20 degrees in the room. So this is a basic scenario for how you can move from a system model to a finite element model. Basically. Next slide. Basically you extract some data from the system model and use that in the finite element analysis.
Right. So far, if we check what we have learned so far, we can easily say that system modeler can provide all the information needed for the finite element models, including boundary conditions and initial conditions. Okay. Even if we haven't run transient analysis in this example. If we needed those, we can get those conditions from system modeler as well. So other thing we can conclude is system modeler now and then may make some assumptions which depends the modeler. So for instance, in our scenario we had a room example in which we have the same temperature across the room wall, etc. That is because of the nature of the method we choose. While modeling. We said that this is a lamped model of the room. Right. Oliver, what would you like to add?
Maybe we can also add that. I mean, for example, the system modeler doesn't have any notion of where in the room, for example, the heater is positioned. So these are things. So the basic point we're trying to get to is that if you have a system model and then subsequently do a finite ELE analysis of some sub component, you'd probably have to add additional information into the model that is not present in the system model. So this is just the nature of things. Just one thing to keep in mind when you do follow such an approach. Okay.
Right. And also we can say that system modeler gives us the multi domain of dynamics, whereas the finite elements model gives us internal dynamics. High fidelity device level internal dynamics.
Yeah. Okay, so now we're going to do the reverse way. We start with the finite element analysis and drive a system model with that. And for this example we've used a beam. And we're going to compute the spring constant of that beam and use that then in the mass spring system model, just to show how this works in principle. Okay, so what we have here is a rectangular region and we set up a solid mechanics simulation. So we have a shear modulus, a thickness Poisson ratio of this beam. And this beam is going to be made of vulcanized rubber. And this will get important a little later. At the left side of the beam we have a solid fixed condition. That means the beam on the left hand side is held fixed, it can't move there. On the right hand side we have a solid boundary load and that has a force in the negative Y direction. So a downward force basically. So we want to deform the beam. Then again we create a parametric ndesolve value and the parameter is the force in the boundary. What we now do is we compute the deformation of this beam for various forces. So 10, 25, 50, 75 and 100 Newtons. And that will give us a displacement of the beam. And the picture you see is, I think it's the last the 100 Newtons. I'm not even sure if it's the scale, but just to show you roughly what this looks like. So for certain forces we get displacements. Slide. And what we can do now is we can look at a specific point on the tip of the beam. So for a specific force, we have a specific displacement. And because we used a linear elastic material model, the force displacement relation is linear. So that's a good thing to compute the spring constant. Now just one second. No worries. So to compute the spring constant, we create an interpolating function of the data that we have and find the derivative of that data and that gives us the spring constant. So yeah, next slide. So now what we're going to do is we want to use the spring constant in a system model. You could now very well go and open System Modeler and do the system model in System Modeler. We choose to do it in Mathematica. So System Modeler is usable from within Mathematica. And for that we used a list of components. We have a fixed component, spring component and the mass component. And then we have a list of connectivities, how these components are connected. And the function connect system model component, we call this massspring, gets this list of components, the connectivity, and we specify the initial value. So the mass of this thing is 5.5kg. That's computed from the dimensions of the thing. And we set the spring constant C to the spring constant we've just computed previously. And an initial deformation of 0.3 meters is the deformation. So now this is done, the dynamic analysis of this. So we have an initial displacement of 0.3 meters and it's swinging up and down like you expect because it's an undamped system. So far, so good. That's how this works. Okay, so now we're going to notch this up one bit. So what if we don't use a linear material law, but a non linear material material law? So the spring, now this is vulcanized rubber is not linear elastic. We use a hyper elastic material law. And for that we use the same parameters as above. We just change the solid mechanics material model to a neo hook and material model. And that's a nonlinear model. And we see that in a second. We proceed in exactly the same way. We compute a parametric and dissolve function that gets a force. We compute the same forces 10, 25, 50, 75 and 100 Newtons and we get displacements. Next slide. Now, however, the relation is no longer linear. You see a small increase there. We can in principle still compute the spring constant in Inverted commas in the same way by computing the derivative of the interpolating function. But now we'll have to get that data into system modeler. Okay. And in this case what Veda did, he created a system model in system modeler. And now we imported it here to show this. But what we've done here is so after the system model is imported, it has again a fixed node, a nonlinear spring and a mass. But now we can create data system model. We use that function to set the values of the nonlinear spring displacement, force displacement to the data that we've computed previously with the nonlinear material law. And we can then system simulate that model again with similar starting parameters. Yeah, and now you get a slightly different behavior of this spring constant of this model of this beam. I think the point here is that you can even use sophisticated models, finite element models to make useful additions to your system models. Like a nonlinear. A nonlinear analysis can find parameters for a system model analysis. Okay.
Yeah, right. In the last part we have another example from finite element model to system modeler. Here we use the BIM model. It is a proof of concept study. Let's have a look at it. So what we did in this example, we wanted to model this jib crane in system modeler. And here we see how the model look like. And such type of multi domain example are really easy to model in system modeler. And let's have a look at how does it look even in system modeler. Here, let me come to the model center. Okay, so here we see the diagram of it. Then when we are done with design of this jib crane, we design a controller for that. Here we can see we have a rigid beam. Here we have a rigid beam and prismatic joint and weight and some sensor. And we design a compid controller to regulate its position. And here we have the position for the weight. And when we look at the performance, the control errors looks reasonable, satisfactory enough. And here we look at how the controller performs. And it works as it should be. Okay, done. If we continue. Okay, this is the point. We thought that this controller is missing something. This actually jib crane is missing something. Because in reality we don't have such rigid beam. So what we did instead we wanted to model a beam by using FEM and get its dynamics to have a higher fidelity modeling system modeler. To do so we roughly, we use roughly the same vulcanized rubber material. I mean, if you look at that on the left, on the right hand side, it is fixed on the left we are implementing forces. So to keep the things simple to track, we made as small number as possible as a degree nodes. And we have 12 nodes over here, which translates to 42, 24 degrees of rhythm. 12 in X direction, 12 in Y direction. And then we assign steel as a material to do this beam and we solve the PDE and this is what we get as a result. So here we are looking at a transient analysis result of the beam and it is oscillating as expected. So what we want to have is to get this oscillationary behavior to system modeler to test the controller whether it performs as good as in the model with a cube with rigid beam. So to do so what we did is we extract the system matrices of this finite element. Yeah. For finite element model beam. And here we are looking at the stiffness matrices. And similarly we can extract damping and stiffness. So which is really cool in Mathematica we can have those parameters. And what is left to use this system matrices? All model parameters. It depends in which domain you are. So we can create a system modeler model by just using the create system model functionality. Here you see that we are going to create a new beamfam model which has this dynamics in it, which is an equation of motion. And here we see some familiar things like mass, damping and stiffness which we extract from the finite element. And then we create that. And we just duplicate the model by substituting the rigid beam with the finite element model. And here we see our 2D finite element beam. So if we look at how the system performs, I mean the controller performs here we see the controller ones work flawlessly in the system maker with rigid beam start showing some. Start showing cracks on flexible beam, finite element model beam. And even if the. Another cool thing about this approach, I would like to say that we can now see what are the internal. Okay, here I had to open that. Sorry. Now if we go here. Now we are looking at right now, this is our flexible finite element beam which we created by system modeler by Mathematica and shipped to the system modeler. As you can see, we can see all the displacement from 0 to 10 meter. And these are exactly matching with the nodes we had in finite element model. Now we can see spatial internal dynamics basically in system modeler. If we come back to. Okay, now. Now it's stuck. Now it's stuck.
Now it's stuck.
Okay. Yeah.
Okay, the next slide is a summary slide, if I remember Right.
Right, you're right. Yeah. Maybe, maybe we can just summarize what we have learned so far. Yeah. Okay. So as we achieved from system modeler to finite element method, we could achieve integration from finite element to system modeler. Now I mean this might be I think the more intuitive when it comes to this hybrid type of simulations because I mean most of the time not the system level but the device level. The people might be interested in how this for instance it can be hydrothermal or stress related thing, this field distribution thing. So I guess in such implementation using such approach will be really beneficial. And also it is possible to get. Yeah, right. We already covered this topic. Right.
So I mean maybe, maybe it's also worthwhile pointing out that this is something we are experimenting with. And so we've seen two ways like from System modeler to FEM and From FEM to System Modeler, both seem useful. The FEM to System model seems more intuitive right now because it's more natural to extract some detailed knowledge from a FEM analysis and use that then in a system modeler. So that's one thing, but the other way around is certainly also possible and useful to do.
Right. So if you want to know about this example, we have community post written about these things. We explain how, how we did those things. We can have a check. We already uploaded this notebook. You can just have a look at it and you will have the links for that. So as a summary we covered From System Modeler to FAM integration and similarly from to System Modeler. And also if you like to learn about fam, you can check documentation of the PDE modeling. You can access that by clicking on this.
So this is the first example from System model to FEM is already in the April 14.0 documentation and we'll try to make it happen that we'll have the second the spring example also in the 14.0 documentation. Not quite sure if we still make it, but that's the plan to still do that, to make that available to you. The last one, the example with the beam in system modeler that is still a bit. We're experimenting with that. So it's not quite ready for prime time. We're just showing that this is in principle possible. And I'd like to comment that there was one question from Harald Biller that. Let me quickly read this. In the last mechanics example I guess you could reduce the matrix size, use most relevant eigenmodes and the FE model can be much larger. What you think? Yes, so this is certainly something we're thinking about and I mean obviously we'd like to use some form of model order reduction to Get a high fidelity finite element model into system model. That would definitely be the goal for this type of approach.
Right, Right. Or maybe sometimes you might be interested. Assume that in the middle mid deflection of the beam and you just want to have some ballpark. And then what you can do, you can have large model with the thousands of degrees of freedom and you can do some reduction and shift that into system modeler. And look at that. Okay. Now if I have this boundary condition, this beam showed such deflection, roughly so. Not the finest, but at least you will have some level of fidelity.
Yeah, that definitely would be great to get. Okay. But this is still future work. But we're definitely aware of that and thinking in that direction. Yeah, absolutely.
Right. Please don't hesitate to contact us.
Yeah, absolutely.
These are our emails. Yeah, I guess if we don't have any question left.
I think we're right on time. Yeah. Okay. Thanks a lot for attending. Enjoy your conference. I think both Vidot and I are also available for chat and stuff like that email. You choose the medium. We'll try to answer. All right, Have a good day and enjoy the conference. Bye now.
Yeah, bye. Take care.
More from Guy

Cheryl Strauss Einhorn | The Human Edge: Smarter Decisions in the Age of AI | Talks at Google

Rachel Glennerster | Innovation and the Center for Global Development | Talks at Google

Rebecca Winthrop | Rethinking the Purpose of Education in the Age of AI | Talks at Google

Dr. Robert Wachter | A Giant Leap: How AI Is Transforming Healthcare... | Talks at Google






