Help Needed

3 replies to this topic

#1 -Tom-

-Tom-

Casio Freak

• Members
• 104 posts
• Location:Poland

• Calculators:

Posted 12 March 2006 - 12:58 PM

Hi!
Q:How to draw function given in intervals and integrate it later?
I searched instruction and there is nothing. Could anyone help me?

#2 PAP

PAP

Casio Overlord

• Members
• 681 posts
• Gender:Male
• Location:Somewhere in Europe.
• Interests:Computer Algebra, Numerical Analysis.

• Calculators:
ClassPad 300 (plus an old Casio model, with only a few Kb ram).

Posted 13 March 2006 - 11:30 AM

Hi!
Q:How to draw function given in intervals and integrate it later?
I searched instruction and there is nothing. Could anyone help me?

You probably mean that you want to define a piecewise function, then integrate it from x=a to x=b. If so, defining a piecewise function is described in the manual. Integration is straightforward, but expect very slow convergence, if build-in integration is used, and the function is not smooth. On the other hand, defining and solving this problem in a CPLua program using LuaNumAn is very easy and accurate. For more details see a similar topic; you will find more information about this problem, and its solution.

#3 -Tom-

-Tom-

Casio Freak

• Members
• 104 posts
• Location:Poland

• Calculators:

Posted 13 March 2006 - 04:35 PM

No, this is not what I wanted. What I need is to define a function on many ranges, using piecewise I can define: here-this, rest-this :| it is not satysfying. I already used Lua, not exacly LuaNumAn (sorry for this) and I must say that it was best solution, like always. Integration doesnt have to be so accurate in my case. But Im still interested how to solve my problem without Lua....

#4 PAP

PAP

Casio Overlord

• Members
• 681 posts
• Gender:Male
• Location:Somewhere in Europe.
• Interests:Computer Algebra, Numerical Analysis.

• Calculators:
ClassPad 300 (plus an old Casio model, with only a few Kb ram).

Posted 14 March 2006 - 02:50 PM

What I need is to define a function on many ranges, using piecewise I can define: here-this, rest-this :| it is not satysfying.

You should use nested piecewise functions. For example the following code:
`piecewise(case1,val1,piecewise(case2,val2,val3))`
will return val1, if case1 is satisfied; if not, it will return val2, if case2 is satisfied, otherwise, it will return val3. Needless to say that you can nest more than 2 piecewise functions. This way you can define multi-branch functions .

I already used Lua, not exacly LuaNumAn (sorry for this) and I must say that it was best solution, like always. Integration doesnt have to be so accurate in my case. But Im still interested how to solve my problem without Lua....

Well, built-in definite integration is powerful, but usually slower than LuaNumAn functions. Like you said, a Lua program implementation is the best solution anyway.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users