Hi,

I am trying to plot only the real part of the values obtained from the MapleSim model. Probably there is a Modelica function to get only the real part of the values, but I am unable to find it. Could you please have a look at the code and let me know what I should do to solve this problem?

Best

Onder

The code is: (I want to plot the real part of R2)

model IKTest

parameter Boolean switched = false;

parameter Modelica.SIunits.Length L1 = 0.100;

parameter Modelica.SIunits.Length L2 = 0.102;

parameter Modelica.SIunits.Length L3 = 0.5;

//parameter Real c; //Complex number

//parameter c;

Modelica.Blocks.Interfaces.RealInput u[3]

annotation (Placement(transformation(extent={{-140,-20},{-100,20}},rotation=0)));

Modelica.Blocks.Interfaces.RealOutput y[3]

annotation (Placement(transformation(extent={{90,-10},{110,10}},rotation=0)));

Real Tx = u[1];

Real Ty = u[2];

Real Tz = u[3];

Real R1 = y[1];

Real R2 = y[2];

Real R3 = y[3];

equation

R1=atan(Ty/Tz);

R2=(acos((L1^2+L2^2-(sqrt(Tx^2+Ty^2+Tz^2))^2)/(2*L1*L2)));

//2*Modelica.Math.asin(1.0)

//R3=R2.re;

annotation (uses(Modelica(version = "3.1")));

end IKTest;