Message Boards Message Boards

0
|
5302 Views
|
4 Replies
|
3 Total Likes
View groups...
Share
Share this post:

Language of SystemModeler & how to create a new model from Mathematica?

Posted 4 years ago

Hello, my name is Shahin and im a beginner in SystemModeler(SM). The question that engaged me is that what is the language of text view part in the SM? and is there any way to create a new model (such as FlatTank example inside the SM) in Mathematica and export it into SM? or export it based on SMs text part language? I understand "WSM" command in Mathematica links together and making a circuit is feasible but only based on defined models in the SM. Thank you

POSTED BY: shahin eskandri
4 Replies

Shahin,

The car model can be successfully made using built-in components. An example can be found in IndustryExamples.AutomotiveTransportation.DrivelineModel. You may want to also consider using the Multibody library (included with WSM) because simulations can be automatically animated. However, make sure you really want the animations because modeling is more difficult with the multibody library (the learning curve is steeper).

If you have unique components that you can't model with WSM blocks, you can make custom blocks.

Lastly, control algorithms can either be modeled in blocks, custom blocks, or you can write them in C code and call the C-coded controller as a block. (This is particularly useful if you plan on implementing the novel controller in hardware). You can also do the controller design in Mathematica and export a State-Space controller to WSM. For an example on how to do a C controller in WSM and an example on designing a State-Space controller and exporting that to WSM see my talk from the Wolfram Tech Conference in 2018 Click on this link and then search for Neil Singer and you can download the presentation as an Mathematica notebook and/or watch the video Since some of the presentation was done in WSM and not Mathematica, the presentation notebook is not as complete as the video.

If you are planning on modeling the hydraulic components in the braking system, you may need the add-on hydraulics library.

I hope this helps,

Regards,

Neil

POSTED BY: Neil Singer

Thanks a lot Dr Neil. You respond with great patience and efficiency!

POSTED BY: shahin eskandri

Shahin,

The language in SystemModeler is Modelica. If you go to help-> Documentation center and click on "Resources" and select "Modelica by example" you get a good introductory book on the Modelica language.

There are several ways to make models in WSM. You can use the built-in components and wire them together. You can write your own components (for example, use the built-in ones as a starting point). You can create components from Mathematica.

To create components from Mathematica, You can use CreateSystemModel. You can give equations or a statespace model. In some cases you may have to edit the Modelica code to do exactly what you want. The documentation on reading and writing WSM models from Mathematica is here: Documentation

It is hard to be more helpful unless you can be more specific on what you need and/or what you are trying to model.

Regards,

Neil

POSTED BY: Neil Singer

Thank you Dr Neil Your comment was very helpful. Since my academic discipline is Dynamic and Control of Vehicles, im looking for a way to create a brake system control for car based on development of new algorithms in Autonomous emergency braking (AEB) as my Master's Thesis. Therefore, I guess between control system designs, SM would be suitable for my purpose since I have a good correlation with Mathematica.

POSTED BY: shahin eskandri
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract