Message Boards Message Boards


[✓] Find a simple x^n power kind of block in Modelica library?

Posted 11 months ago
1 Reply
1 Total Likes

I purchased Mathematica and system modeler a while ago to learn design with computers...simulation and the like..and when trying to derive the energy of a system I was attempting to simulate, I required from the math block ( I would think at least) the power of an input...which for the life of me I can't find in the program, the documentation or anywhere on the internet....and I ended up making my own component...basically a modified gain, where k=n n being whatever power I desired...but system modeler complains everything time I try to load a simulation with my custom components...but that is actually another problem for another day...

So my question is. Where do I find a simple x^n power kind of block? Surely something like this isn't missing.


As far as I know there are no Power block in the Modelica standard library, but it's trivial to roll your own:

model PowerN
  extends Modelica.Blocks.Interfaces.SISO;
  parameter Integer n;
  annotation(Diagram(coordinateSystem(extent = {{-148.5, -105}, {148.5, 105}}, preserveAspectRatio = true, initialScale = 0.1, grid = {5, 5})));
  y = u^n;
end PowerN;
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract