Page 1 of 1

Scientific calcs and Look up tables

Posted: Wed Jul 25, 2007 12:04 pm
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.

Posted: Wed Jul 25, 2007 12:37 pm
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.

Posted: Wed Jul 25, 2007 1:26 pm
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;

Posted: Thu Jul 26, 2007 9:14 am
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).

Posted: Thu Jul 26, 2007 9:35 am
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.

Posted: Thu Jul 26, 2007 1:27 pm
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.

Posted: Mon Jul 30, 2007 11:03 am
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