- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Can I create diffrent classes and...
Can I create diffrent classes and merge them into a model?
Can I create diffrent classes and merge them into a model?
Hello!
This might seems to be a stupid question. But I wonder if I can create e.g a class who contains a differential equation of a resistor v = R*i.
Let's say that i want to model up a circurit of resistors. Can I then add in that class into a model and connect the resistors with each other?
Or is it not easy as it sounds like? Beacuse I want to create a class of an object e.g spring, mass, resistor, cacapitor, damper etc. Then i want to connect those with each other in OpenModelica.
Beacuse in normal cases with paper and pen, i need to create a big state space model with a big matrix, then simulate. But I don't want to create a big state speace model and simulate. I want to create classes of part models and then insert them into the model and simulate. No state space and matrix. Just first order ODE in classes.
Is that possible?
Re: Can I create diffrent classes and merge them into a model?
Yes, that's one of the main points of using Modelica, that you can create parts and connect them together. There's already a big standard library available that contains all the parts you list, see the Modelica library in OMEdit.
- perost
- 114 Posts
Re: Can I create diffrent classes and merge them into a model?
perost wrote:
Yes, that's one of the main points of using Modelica, that you can create parts and connect them together. There's already a big standard library available that contains all the parts you list, see the Modelica library in OMEdit.
Thank you for your answer.
Is it better to learn codeing or the "drag and drop"-method?
Re: Can I create diffrent classes and merge them into a model?
Hello!
Your issue seems to have some relation to the difficulties I am experiencing as a new modelica user.
A lot of examples within the OMNotebook has you create a class to model whatever situation you're dealing with, then create more classes that are needed for further iterations. I found that you cannot "lump" in all of the classes together within the "Text View" of the OMEdit interface, but have to create different classes and keep them separate in different models located underneath the modelica libraries menu. I'd love to hear your input on this.
Also, the I believe it's more useful learning the coding back end of the software. Most of the tutorials from the OMNotebook and external sources give practice via coding, not "drag and dropping".
Hope this helps, let me know what you think.
- KFung
- 27 Posts
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Can I create diffrent classes and...