Scientific calcs and Look up tables

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 2 and 3.

Moderators: Benj, Mods

Post Reply
echase
Posts: 429
Joined: Mon Jun 11, 2007 11:55 am
Has thanked: 49 times

Scientific calcs and Look up tables

Post by echase »

How can one do scientific calcs in Flowcode or C, such as W = (V)^1.5?
Same thing as V x V / SQRT V. So can do it if it is possible to do a square root.

Ideally I'd like to do complex things like W = (V)^1.7 where the SQRT fix is no use.

User avatar
Steve
Matrix Staff
Posts: 3433
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times

Post by Steve »

At the moment, this is not easy - although it is possible with some effort.

Do do this, I would recommend creating some kind of look-up table (probably in C or Assembly) and then using interpolation to find an approximate answer to the calculation.

We are looking at ways of improving Flowcode in this regard and I hope that it will soon allow you to insert your own look-up tables without needing to understand C or Assembly. Unfortunately, you will need to wait for version 4 for this kind of functionality.

echase
Posts: 429
Joined: Mon Jun 11, 2007 11:55 am
Has thanked: 49 times

Post by echase »

Look up table would be useful as another probelm I have is reading standard PT1000 thermistorss whose calibration is defined by

-10 -5 0 5 10 15 20 25 30 degrees C
961 980 1000 1019 1039 1058 1078 1097 1117 ohms;

User avatar
Steve
Matrix Staff
Posts: 3433
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times

Post by Steve »

This is a common issue. I will ask Ben to produce an example of a lookup table (perhaps with some basic interpolation) within Flowcode.

Unfortunately, this will probably not simulate in Flowcode (because the table will be implemented in C code).

echase
Posts: 429
Joined: Mon Jun 11, 2007 11:55 am
Has thanked: 49 times

Post by echase »

Would be useful to see an example.

For the particular data set I provided above a straight line graph can be drawn thought the points and implemented in C as

temp= constant1 x degrees +constant2

But many data sets do not have a straight line answer.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Post by Benj »

I am currently working on a Sin wave example. Bear with me and hopefully it will be finished by the end of the day. If not then it will be early next week.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Post by Benj »

Hello

Ok the Look Up Table example is now finished.

Please see the following post on the forums.

http://matrixmultimedia.com/mmforums/vi ... php?p=5509

Post Reply