Message Boards Message Boards

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

GROUPS:

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.

POSTED BY: Mor Bo
Answer
8 days ago

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})));
equation
  y = u^n;
end PowerN;
POSTED BY: Otto Tronarp
Answer
8 days ago

Group Abstract Group Abstract