Re: The "evolution" of GA Math

new topic     » goto parent     » topic index » view thread      » older message » newer message

DB James wrote:
> 
> Al Getz wrote:
> > 
> > Al Getz wrote:
> > > 
> > > Hi again,
> > > 
> > > 
> > > Oh yes, it's looking even better now.
> > > I'll have to try a few more formulas and things with it.
> > > The flicker is gone, and that's really nice.  Seems to run
> > > faster too or something now.
> > > Thanks for updating again!
> > > 
> > > 
> > > Take care,
> > > Al
> > > 
> > > And, good luck with your Euphoria programming!
> > > 
> > > My bumper sticker: "I brake for LED's"
> > > 
> > 
> > Hi Quark,
> > 
> > Looks like we might have to add some functions, as im trying a new
> > formula
> >   y=a*ln(x/b+1) --physically, a 'diode'... a,b constants
> > and it doesnt seem to be able to find a solution.
> > 
> > Im thinking maybe this is because it takes a great many adds and
> > subtracts and multiplies to emulate the "ln" (log natural) function.
> > Im guessing that if "ln" could be added to the list of possible
> > functions it would find the solution.
> > I havent studied the code itself in any detail yet, so if you can
> > give me some tips how best to add functions to the possible set of
> > useable functions (which are now add, subtract, multiply, etc) that
> > would help.  This way a user could add (or take away) functions that
> > would most likely fit the situation.
> > 
> > BTW, the error stays approx between 0.2 and 1.0 for the most part
> > and it keeps restarting.
> > 
> > This could be very interesting for coming up with new Spice models!
> > 
> > 
> > Take care,
> > Al
> > 
> > And, good luck with your Euphoria programming!
> > 
> > My bumper sticker: "I brake for LED's"
> > 
> 
> Hi Al,
> 
> I am all for functions being added to GA Math!
> 
> As the program is now, it has no clue about log.  The David Cuny library
> eval.e would
> not know what to do with it, though it does have three trig functions I have
> not used.
>  David set up eval.e to make it easy to add functions, so you would first look
>  at his
> code and modify it so it could calculate a log function.  Then in GA Math,
> there are
> two areas to focus on:
> 
> 1)
> constant OPS={
> {"abs",1},
> {"rec",1},
> {"chg",1},
> {"add",2},
> {"sub",2},
> {"mul",2},
> {"div",2},
> {"int",1},
> {"rem",2},
> {"frc",1},
> {"nop",0}
> }
> You would stick, say, "log", in above "nop" as: {"log",1},
> 
> 2)
> In the function Animate() you would add the actual Eu functionality associated
> with
> the number of the function (possibly 11, in this case).  It would be something
> like:
> elsif op=11 then
>   --log
>   p[i][REG][store]=log(p[i][REG][from1])
> 
> Of course remember the limitations on log(), from the docs:
> 
> Comments: Note that log is only defined for positive numbers. Your program
> will abort
> with a message if you try to take the log of a negative number or zero.  
> 
> I hope you do this as it will be a steroid shot to GA Math blink  Also a power
> function
> would be slick, but then overflow would be an issue...
> 
> --Quark
> 

Hi Quark,

Done :)
I added ln() to both programs, and ran the program, but it still was
taking a bit longer than i had time for at that moment...i'll try again
though for sure.

Actually, i was thinking of making a Windows version of your program?
How's that sound?  Too bad i dont have a good Linux yet.  I went searching
for a boxed linux set at comp stores but didnt have any luck.  CompUSA
doesnt seem to carry in the store anymore for some reason.


Take care,
Al

And, good luck with your Euphoria programming!

My bumper sticker: "I brake for LED's"

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu