0

I'm trying to use the xcos/scicos expressionless block:

enter image description here

with this scilab/scicoslab expression:

sign(u2 – u1) * (2 * ((Fm + M) * abs(u2 – u1) + k * (u2^2 – u1^2) / 2) / m)^0.5

where all the variables above has already been defined in the context. But it keeps giving me random errors:

enter image description here

answer given for scilab expression is incorrect...

I would appreciate if you could help me know what is the probelm and how I can solve it.

Community
  • 1
  • 1
Foad S. Farimani
  • 12,396
  • 15
  • 78
  • 193

1 Answers1

0

OK, I checked the expression block's description and it seems it does not support power or sqrt! The only supported functions are:

sin, cos, tan, exp, log, sinh, cosh, tanh, int, round, ceil, floor, sign, abs, max, min, asin, acos, atan, asinh, acosh, atanh, atan2, log10.

There is the Scilab function block which is much more handy:

enter image description here

There you can call user-defined Scilab functions. I have explained the procedure here in details.

Foad S. Farimani
  • 12,396
  • 15
  • 78
  • 193