
Ankit (Applications Engineer at Wolfram MathCore), co-presenting with Jan Brugaut, demos new System Modeler capabilities and libraries. He summarizes features added in v13.2 (control-panel/Explores, Wolfram Language performance-quantification functions, improved error localization), v13.3 (simplified distribution/installer workflow, interactive input controls/sliders, automatic model calibration via SystemModelCalibrate), and previews System Modeler 14 (unit-system switching, custom display units, updated Modelica library with Batteries and Clogged, and an upcoming Rotating Machinery library with flexible components). Live demonstrations include attaching sliders to model inputs in Simulation Center, creating installers for libraries, calibrating a motor model against experimental data, and running uncertainty analyses to validate model robustness.
Chapters
Hi everyone, I am Ankit Applications Engineer at wilfram Math Core and in this presentation I will be presenting on new in System Modeler. This presentation was prepared by me and Jan Brugaut from Wilfriend Math Core and Jan will be helping me in answering your questions. So if you have any question during the Q and A, please feel free to post it on the chat and we will be responding to it. Right in this presentation I will be covering the key I will be giving you an overview of the key things that have happened since the last conference as well as we have I will get I will demo some of the key features that that we think will help you as a model developer as well as a model user. So I'll be giving examples on each of these key features that are listed here. I'll be going one by one as we progress through the presentation right since last conference we have released two new libraries. One is the Aircraft library that has components that you can drag and drop and you can quickly create and test new novel designs as well as you can also use that library to test existing designs and understand the flight mechanics controllability and check its performance. It also this library. The components in this library have built in animations so when you use this you can see the behavior of your aircraft design in the form of an animation. We also have a new library called College Mechanical Engineering. This library is meant for, as the name says, new mechanical engineers as well as if you are a practicing mechanical engineer and you want to browse concepts through kinematics, dynamics and those vibration concepts, you can use this library. This library has various labs and by lab I mean it has interactive notebooks which rely on system modeler models working in the background and you can use it to understand vibrations. You can use it to see animation of a car jump and understand how kinematics plays a role in modeling those kind of things. Also in last December, System Modeler version 13.2 was released and with this version we introduced concepts like using a control panel that we call Explores that you can use to in to test different designs in Simulation Center. We had covered this during the last conference. Apart from this, we introduced some new Wolfram language functionalities which helped you in quantifying the performance of your controlled system. And by that I mean if you have a system you give it a step input and you want to see how the system responded. What is the overshoot, what was the settling time? Those things are computed automatically and you can quantify those with just using a single function. Also System Modeler 13.2 the error detection and error localization improved a lot and that would help you to to quickly figure out what the error messages are and it would directly point you to the relevant code line of code where the error is present. And these three the features in version 13.2 were demoed in the last conference as well. Also during June I think System model of version 13.3 was released and it introduced several useful or convenient features and these are the features that I will be giving examples during this presentation as well. So in this version we have created we've simplified the workflows through which you can easily distribute your models and libraries with others. Second, you can attach sliders or you can add interactive controls to real inputs to inputs for your models and you can gamify your model. We will look into more details as we go along in this presentation on what I mean by gamification of this and third, we have new Wolfram language workflows that allows you to automatically calibrate your models based on experimental data. For all these three features I will be showing an example and just a heads up, we are going to Release System Modeler 14 very soon and with this new version it comes with various new features like you can add uncertainty uncertainty to your model parameters and inputs. You can change a preferred unit system, for instance if you are comfortable in using SI unit or if you're comfortable in using US customary unit, those things you can easily switch between those unit systems. Also the new version will have the new model ecard library or which is the most recent Modulica library as default. And what that means is with this new Modulika library you have access to two new libraries that is Batteries and clogged. So batteries library has lot of pre made components on different types of battery models, simple resistance models, RC models and such that you can directly use in your examples. Also this new library will come with a sub library called clogged. And so if you're interested in modeling synchronous systems where everything are all the events are synchronously linked with each other, then this clogged library provides built in components that you can directly use. Finally, we will also be releasing a library called rotating machinery very soon. This library can be used to model as the name suggests, rotating machineries like you can say turbines or pumps, anything which rotates, you can use this library. The advantage of using this library is this has components which are high fidelity components. By that I mean the components are not rigid, the components are flexible and with this components being Flexible, small, small vibrations can also be detected. So if you are, if you, if you have rotating machinery which has some faults, using this high fidelity components from the rotating machine library, those small, small faults because of vibrations can be detected, right? And with that, let me start giving, using, giving some examples that will cover the feature list that I just mentioned. First, with version 13.3, you can now make your simulations more interactive. And you can make it more interactive by adding sliders to your model inputs. Let me switch to System Modeler to give you a small example. For those of you who are new to System Modeler. This is the modeling interface called Model Center. And here I have the model of my drone. So this component is the model of my drone to which I have added a controller. And then this drone is also connected to a battery, so that we can also model the state of charge of a battery as the drone flies over a period of time. And to this controller, you can pass on inputs like how much should it move laterally, how much should move forward, turn and height. So these are the inputs you can provide to a controller. And this controller takes the actual measurements and it gives a control signal to our drone. And the drone tries to follow the reference signal. So let's open up Simulation center and check its animation. So this is Simulation center where you can visualize the, the behavior of your model using plots. You can use it to see animations. And with 13.3, or with 13.2, you could add sliders and other interactive controls. And in this model, what I've done is for my forward motion, I have attached sliders to the input. So here if I change, if I give some forward input, you see in the second plot, the orange curve is the reference signal and the blue curve is the signal that my drone is trying to follow. So if I give it a signal more, you see, the signal increases. And now my drone is following my signal. And by attaching these sliders, you can now validate with. So rather than just watching the plots, you can actually see the model live in action. I'll pause it for now. Now I wanted to show how easy it is to add such slider. So here I have two sliders for forward and lateral motion. Let me go ahead and add one more slider for the height input. To do that, I can click on this plus icon over here. When I click on the plus icon, I can select Control Object. And here it will automatically give me a list of things that I can select. I will select the height, which is an input. I can give it A label or I will just keep it the default. So I'm just keeping the default name as height. And then I can select a control type for this. I will select a slider and I want my slider to move from let's say 0 meters to 20 meters for instance. And I click OK. And now I have a new control object called height which is attached to my input. And then if I simulate my model now, I can use it to give a height signal to this. So if you can see the plot over here, as I am increasing the height, the height is increasing and the drone is trying to follow it. Right? And then with this I can create a game and then maybe I can try to have make my drone reach the flag over there, right? Okay, so let me get back to my presentation now. So with that small example you saw how you can attach sliders to the model inputs and then try to get a more interactive view of your simulation results, right? With the upcoming version 14, you can now switch between different type of unit system. For example, let's say if you are in Europe and you are used to using SI units, you can set global option for your system modeler for system modeler so that you can only get units from si. So here I am only shown units from meter centimeter and other units like feet, inches, which I'm not interested, those are filtered out. Again, if you are from the US then you can also filter out the SI unit. So you can only see units which are used like the US customary units like feet, inches and so on. Also with version 14 it is also possible to attach custom units to your library. For instance, let's say you are based in Sweden like I am and you are trying to create a model for your users who are based in Sweden. And the units that you are using is basically in Swedish length like for instance fort, Dom, knee, meal and so on. You can, with version 14 you can also add this custom display units to your models and use it. And then you can filter out the SI and other units so it becomes very convenient for your model users to play around. To play around the different parameters. Let me just quickly open up simulation center to show how easy it is to switch between various units. Let's say here all the forward, lateral and height motion are defined in si. Currently I have all the units selected. So if I just write let's say two, I am shown here all the display units that are compatible or that I can use for my forward motion. I can use meter, centimeter, inches, feet, yard. I have access to all the display units that I can use. But as a model user, you want to filter out the number of units that's being displayed. Let's say you only want to show the US customary units. To do that you would go to Tools options and in display units, I will uncheck my SI units here and I also uncheck this option at the end which says I should disregard any display unit filtering and then click Apply and hit ok. And for these changes to take effect, to have to take effect completely, I will just duplicate this experiment. I could even rerun this model. But once I duplicated this experiment, you could see all the units that I had defined here, which were in meters previously, now are defined in feeds. And if I write a numeric like 2, the things that I can select are feet, inches, yard and and miles. So now I have applied a filter to my input fields. Also, one interesting thing that you might observe like in the plots, previously I had the display unit for my vertical axis in meters and now they have automatically been converted to feet. So now as you can see it, is it very convenient to easily switch between different unit systems and you don't have the hassle of converting to different units and trying to think in different unit systems all the time when you're creating a model, right? Okay, the next thing that I wanted to show was let's say you want to create your drone and you created the model, Everything works. But now you want your model to replicate a real world drone. And one of the component that is used in a drone is a motor. So you buy a motor from the market. Now you want your model to mimic the model that you bought from the market. To do that, you first created. You first you took the motor and you did some experiment on it. You gave it some input current and you got the input shaft velocity readings and you got some experimental data for your model. The next that you want to do is you want to calibrate. You want to calibrate your model such that the model parameters like resistance and damping are calibrated so your model matches the experimental data. So to do that, previously you had to manually tune all the parameters and you had to obtain those values. But now with version 13.2, we have introduced the system model calibrate function. And to this function you can pass on the experimental data and also you can pass on the different parameters, for instance in this case, resistance and damping that you want to tune and then it will automatically try out different resistance and damping values and it will automatically Try to minimize a loss function. Here you can see in this progress bar, it is trying out different resistance and damping value and trying to automatically get the best. To get the best the optimal resistance and damping values for you. Either you can wait for this calibration to finish, or if you feel that the loss function has reached or is below a threshold that you can accept, then you can just click on this square button here and it will return a partial result. So it will stop at this point and it will create a new model with the new calibrated parameters. And once I have the new model, I can just plot the calibrated model and I can compare with the experimental data. So here with the system model plot, I have passed on my calibrated model C model that I computed here. And then I can compare with the experimental data. And here you can see the blue line over here is the result from my model. And the orange points are the experimental values. So you can see this way it has reduced your design time by so much. You don't need to manually tune your parameters, but you can get a first approximation by using functions like this again in version. So one thing is creating a model. So here I have my model. But the thing is, when you create a model, maybe it's working for a particular parameter values. You want your model to work for a range of parameter values so that when you create a model and you are trying to use it for different conditions, you want to see that the model does not go go. The output of the model does not go beyond the tolerance limit. So you want to validate the results of your model. In this case, to my chassis, I want to see given some wind, given some disturbance from wind, I want to see how much the drone deviates from its reference position if a wind disturbance is applied to it. And to this model, you can see when I give a reference signal, it is nicely following the reference signal. The blue curve is the actual signal of the drone. It is nicely following it. But what happens if there is a wind? How would my result look like to do that? We now have a new function. We will have very soon a new function called system model uncertainty plot. And to this function I can add like to the parameter value win Y dot K, I'm adding a disturbance for which I'm not defining a value, but I'm just giving it a normal distribution. So rather than just saying parameter value y.k goes to some value like X, I'm saying that it now goes to a distribution. I can even give an interval and I want to validate of how my model behaves. If my parameter varies as per this given distribution, I've also truncated my distribution so that the value of the disturbance doesn't go beyond acceptable limits. And once I use function like this, I get an output plot like this here. And you can see the blue line is the median response of the height for the given deviations in my disturbance parameter. And the orange curve around it, or the blue light blue curve around it shows the deviation, the maximum deviation from the median value. And that way I can see that for some values it's going is deviating by 1 meter, but still it is able to maintain its reference height after some time. It's not behaving in an uncontrollable fashion. Using this function you can test the different parameter values and be confident of your model. Now you have a nice drone model that you have tested, validated, you have uncertainty plots, you have calibrated the models, everything is great. Now what you want to do is you want to share your models with, let's say your colleagues, friends or students. Now your model has different assets like CAD objects, it has Mathematica notebooks, it has various documentation images. So you have a model with so many external dependencies. How can you package your model in such a way that it's very easy to share it with others? With version 13.3 we have created a nice workflow that allows you to ship to create installers for your models or for your models and libraries. Let me show an example. So now let me get back to my model center and here I have my drone library which has all the different packages and now I want to share it with others. So how can I create an installer from it? To create an installer I would just right click on it and go to export and then click Library Archive. And when I click like Library Archive, I am presented with this interface that allows me to create my installer. The only thing that I need to add here is the name of my archive. I will give it a name called Drone Drone. And then since I used some features from 13.2, I want to have a compatibility. I want to add a minimum compatibility requirement for my library. So if someone is using old version that they know that it will not work in that old version or something might break. So I will set 13.3 and now I can just click OK and I can create my installer. So it's just a one step process. You just give a name and you're done. But if you are Interested to do more. You can do more on it. For instance, let's say I want to add a copyright notice to my installer so I can just write Wolfram Research and I want to add a license agreement for my library. To do that I can just click on the thing, the browse button over here and I can attach a license file to my model. I will click ok. And now yeah, I can, I can put it on my desktop and click Save. So now it is creating the archive, taking into account my. Taking into account my licensing condition and also the copyright notice. And now let me open up this drone here, the SMA here from here and then I can just. So here. Okay, let me just. This is not a good idea, but let me just show it. So now this drone SMA file was created for me and I can share it with others. I can just. And the model users, they will just drag this SMA to their installation and when they do that they will be presented with this nice installer menu where they can just click on the Install Libraries button. They can read through the library agreement. They can and they have to click the accept agreements to move forward. When once they click the accept agreement and click ok, now the file the library is automatically installed for them. So there is no more hassle of ACAD link not working. Documentation link not working. My license agreement, they're not accepting. So those kind of things are automatically taken care of. And now it's become very easy to share models with assets with other users, right? And also, and here is also this QR code that I quickly created. You can just use the QR code and download the drone model that I presented in this in this presentation. Finally, if you want to dig deeper into the different concepts that I covered in this topic, then we have various follow up presentations. The next presentation right now is how do you integrate PDE models with system models? That's also very interesting. And following that there is a presentation of modeling fighters, drones and so on. Tomorrow if you are interested in the uncertainty plot and the calibration functionality, then you can follow this presentation on Friday. We have a customer who is presenting their models that they used in the oil production field. It looks like I am out of time but anyways, if you guys have any questions, I hope Jan has answered it, I guess. And also the notebook should be there in the handouts so you can find it there. And if you have any other questions please we will be available at the Algorithm Wolfram Algorithms R D Expo hall. You can come and join us there or you can schedule a one to one meeting with me, and then we can. We can take it from there. Yeah. So with that, I would like to thank you all for attending this talk. Thank you.
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






