XCOS blocks with annotation _c _f

Hi,
I have noticed blocks which have en ending of either _f, _c . When does for example the CONST block in sources have three different versions with these annotations?

Thanks.

All these blocks are different implementations of the same mathematical function. Historically, the _f and _c suffixes were the Xcos/Scicos API used in the associated simulation function but this is no more true.

The point is: the implementation differs! Some might support scalar inputs, others matrices; some might have a vector-like operation, others matrix-like; some might saturate on a upper-value set in the parameters, others might overflow as in C; etc…

I read somewhere that the _f was implementation in Fortran and _c was written C. I must have overlocked that there was some difference in the between them besides them. I will look into that :+1:

Thanks !

Hello @davidcl, could you guide me on when to choose “PRODUCT” over “PROD_f” for performing multiplication? I encountered issues with the PRODUCT Block when attempting to use it for division, resulting in the following error message:

Simulation problem:
at block #18" -3b9d4a6a:18e56739c2f.-7de1"
singularity in a block
Xcos error: Partial information in "pout(2)" is unset 
for Block '15- "-776dad33:18e55af1a51:-7ee9": a value
between 1 and 39 expected.

However, I managed to get satisfactory outcomes by employing the “INVBLK” Block and the “Prod_f” Block instead.

Hello @Smart, the PRODUCT block is supposed to be better than PROD_f ; it as more parameters to tweak its inputs and the error on divide. Could you post a schema describing the issue ?

Thanks