Jump to content



Photo
- - - - -

Define A Rectangular Signal


  • Please log in to reply
22 replies to this topic

#1 Alvise

Alvise

    Newbie

  • Members
  • Pip
  • 8 posts

  • Calculators:
    Classpad 300Plus

Posted 19 October 2005 - 12:15 AM

Hello,

i define a rectangular signal rect(x) = piecewise(-1/2<x<1/2,1,0,0).
The problem is that if i try to Integrate rect(x) from -inf to +inf or -T to +T the calculator calc rect(x)=1 FOR ANY x.
Ex.

integrate rect(x) from -10 to +10 :

real rect area:
1

Classpad300 solution

20

Sorry for my English.
Thanks

Alvise

#2 Filip Georgijev

Filip Georgijev

    Casio Fan

  • Members
  • PipPip
  • 37 posts
  • Location:Skopje, Republic of Macedonia
  • Interests:Computing, Programming, Casio...

  • Calculators:
    CASIO ClassPad 300 OS Version 2.00 2x, CASIO ALgebra FX 2.0 Plus, CASIO CFX-9970G, CASIO CFX-9950GB+, CASIO fx-6300G, CASIO fx-570, CASIO fx-991MS and so on... Huh!!!

Posted 19 October 2005 - 09:53 AM

Dear Alvise, could you possibly check whether your ClassPad 300 Plus has an internal speaker (i.e. buzzer)?
You see, there is a doubt about this issue that even Saltire employees cannot solve. Sorry for this off-topic, but we are really interested. About the bug, wait till the next year for the new OS version 3! Thank you! Bye!

#3 Kilburn

Kilburn

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 491 posts
  • Gender:Male
  • Location:France
  • Interests:Blah

  • Calculators:
    FX-7500 G
    ClassPad 300

Posted 19 October 2005 - 05:05 PM

Very strange...
On my ClassPad I get 0... :banghead: .

And in the Graph application, I can't integrate it.

To know if your ClassPad has an internal buzzer, use the addin Chip8. Tap 1=>Chip8Sys\ChipBzz in Main, then run Chip8 and tap [Options][Sound On], and try some games.

#4 Overlord

Overlord

    Casio Technician

  • Moderator
  • PipPipPipPipPipPip
  • 355 posts
  • Gender:Male
  • Location:Brussels - Belgium
  • Interests:Math Researcher

  • Calculators:
    My head - C300 OS 3.00 - G100 Rom 1.02 - G65 - G60 - G25

Posted 19 October 2005 - 07:20 PM

Strange, I got 0 too. Now I know I shouldn't use CP to solve my signals exercices...

#5 PAP

PAP

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 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 21 October 2005 - 12:55 AM

i define a rectangular signal rect(x) = piecewise(-1/2<x<1/2,1,0,0).
The problem is that if i try to Integrate rect(x) from -inf to +inf or -T to +T the calculator calc rect(x)=1 FOR ANY x.

I get 0 in OS 2.20. This is obviously erroneous, but, in fact, I'm not surprised: ClassPad uses numerical integration to compute this integral, because the CAS cannot compute the corresponding indefinite integral. Now, I suspect that ClassPad's built-in numerical integration is based on some kind of the Romberg's method, which is very accurate, but it is not suitable for signal functions. A simpler numerical method, such as adaptive trapezoidal, is prefferable for such functions, but ClassPad's CAS is not a Numerical Analysis tool, and has only a standard numerical integration method. However, you can compute this integral very easily by using my Numerical Analysis library "LuaNumAn", written in the Lua programming language. In the upcoming version of LuaNumAn, adaptive trapezoidal integration is available as a function called TrapAdapt. Using this function, the integral can be computed very easily. Here are some screenshots:

Posted ImagePosted ImagePosted Image

You can see the program that computes the integral from -20 to 20, then plots the signal (thin line) together with the integral of rect(u) from u=-1.5 to u=x, for all x within the range [-1.5,1.5] (thick line). Using LuaNumAn, the integral can be computed accurately, and in no time :).

And in the Graph application, I can't integrate it.

Indeed. However, the built-in "Graph" application can be used to produce the above graph, but it is extremely slow: Try to plot the function integral(piecewise(-0.5<=u<=0.5,1,0,0),u,-1.5,x,1.5) in the "Graph" application, if you dare: ClassPad plots it correctly, but it needs more than one hour! In CPLua, and using LuaNumAn, the graph needs only a few seconds to be plotted, although it computes the integral for many upper limits, in order to plot the thick line.

Strange, I got 0 too. Now I know I shouldn't use CP to solve my signals exercices...

Hmm, don't be so sure. Of course, getting 0 as a result is a bug, but this doesn't mean that ClassPad cannot be used for signals exercises. Just switch to CPLua, then write a program for this on your own, or simply use my LuaNumAn library :P.

#6 Alvise

Alvise

    Newbie

  • Members
  • Pip
  • 8 posts

  • Calculators:
    Classpad 300Plus

Posted 21 October 2005 - 11:49 AM

Thank you. I will try. I'll check the about speacker during the afternoon.

#7 PAP

PAP

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 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 21 October 2005 - 12:09 PM

Thank you. I will try.

You are welcome. Note that you need the upcoming version of LuaNumAn, which includes adaptive trapezoidal integration. The current version, 1.30, only supports Romberg integration. However, you can easily solve the problem with Romberg integration, but be warned that the Romberg method is very fast only for sufficiently smooth functions, and your rectangular signal is not a smooth function. The solution I gave in my previous post is based on adaptive trapezoidal method, which is ideal for this case. I'm planning to release the new version of LuaNumAn within the next week.

#8 Alvise

Alvise

    Newbie

  • Members
  • Pip
  • 8 posts

  • Calculators:
    Classpad 300Plus

Posted 21 October 2005 - 03:23 PM

thanks. I found same post about Lua for classpad, but no websites or links where download it.

#9 Orwell

Orwell

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 777 posts
  • Gender:Male
  • Location:Paris - France

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 21 October 2005 - 05:17 PM

Aww, because of PAP's skills in making advertising for CPLua I am really forced to provide an official version quite soon :lol:
Alvise > CPLua is still in development, you can only work with temporary beta versions so there are currently no available downloads on any website ;) But look in the CPLua subforum, there is a link to download the last beta :)

#10 Alvise

Alvise

    Newbie

  • Members
  • Pip
  • 8 posts

  • Calculators:
    Classpad 300Plus

Posted 21 October 2005 - 05:44 PM

Thank you Orwell. I have downloaded and installed the add-in. Great program :D I installed luanuman libs. Is it possible to install Lua on Classpad Manager ? When i go to add-in section it tells me that "add-in" option exist only on "real" classpad 300

#11 Orwell

Orwell

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 777 posts
  • Gender:Male
  • Location:Paris - France

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 21 October 2005 - 06:09 PM

Indeed, you cannot use the Add-ins with the CP Manager. However, the executable version of CPLua is available in the archive and you can edit and run Lua programs with it ;)
You still need the manager to send or receive the mcs files though. :rolleyes:

#12 Alvise

Alvise

    Newbie

  • Members
  • Pip
  • 8 posts

  • Calculators:
    Classpad 300Plus

Posted 21 October 2005 - 06:22 PM

Thanks :) In the images up here i see a function LuaNumAn/TrapAd , in my luaNumAn 1.30 libs i havn't that function....

#13 Orwell

Orwell

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 777 posts
  • Gender:Male
  • Location:Paris - France

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 21 October 2005 - 07:42 PM

Actually PAP said that it would be available in the next version ;)

#14 PAP

PAP

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 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 23 October 2005 - 01:13 PM

Aww, because of PAP's skills in making advertising for CPLua I am really forced to provide an official version quite soon :lol:

Advertising was not my true intention (but you probably know that). I just wanted to show that you can make ClassPad much more useful by using CPLua Numerical Analysis programs. But if that forces you to release an official version sooner than you are planning, I'm happy for that ;).

Actually PAP said that it would be available in the next version ;)

Indeed. I thought that adding just a rather elementary numerical method, such as adaptive trapezoidal, would not be a good reason to release a new version of LuaNumAn. In fact, I'm waiting for the "mat" package to be added in CPLua, to make all necessary conversions in all matrix-related LuaNumAn libraries, then release the new version. But if someone wants adaptive trapezoidal here and now, I can release LuaNumAn 1.31.

#15 Kilburn

Kilburn

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 491 posts
  • Gender:Male
  • Location:France
  • Interests:Blah

  • Calculators:
    FX-7500 G
    ClassPad 300

Posted 24 October 2005 - 01:23 PM

<stupid question>

Is it possible to integrate a function WHITHOUT ANY ERROR?
If yes, it would be very great.
I recently found that on my ClassPad : integral(sqrt(1-x?)) from -1 to 1 = -pi/2
so : -2*integral(sqrt(1-x?)) from -1 to 1 = pi :nod:

<end of stupid question>

But I think many people found this before me! :P

#16 Orwell

Orwell

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 777 posts
  • Gender:Male
  • Location:Paris - France

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 24 October 2005 - 02:16 PM

I recently found that on my ClassPad : integral(sqrt(1-x?)) from -1 to 1 = -pi/2

:huh: It should be pi/2, not -pi/2...
You are just integrating the half of the trigonometric circle, and it is a circle with radius=1, thus of course this integral = pi/2 ;)

Note that the only way to perform an integral "without any error", is precisely to use an Algebra System (CAS) ;)

#17 PAP

PAP

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 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 25 October 2005 - 10:57 AM

<stupid question>
Is it possible to integrate a function WHITHOUT ANY ERROR?
If yes, it would be very great.

Well, I don't think that this is a stupid question; everybody asks this, whenever he/she starts to use numerical methods. ;)
Now, you should realize that Numerical Analysis is not magic; it tries to solve a problem which usually cannot be solved analytically. Numerical Analysis aims to solve problems that will never be solved by a CAS, simply because there is no analytic solution, or because this solution is very time consuming to be computed by a CAS. In other words, Numerical Analysis solves "unsolvable problems". That being said, it is clear there is no numerical method able to solve any problem with perfect accuracy, and such a "perfect" method will never be. However, in some particular cases, a numerical method may return a perfect result, without any error. Examples: try to integrate Alvise's rectangular function by:
q,err=TrapAdapt(rect,-0.5,0.5)
or by
q=Romberg(rect,-0.5,0.5)
You will see that you get exactly 1, i.e., the result is exact. But this is an exception: for example, integrating the same function from x=-2 to x=2 gives a result which is highly accurate, but not exact. If you think how these numerical methods work, you will easily realize why this happens.

Note that the only way to perform an integral "without any error", is precisely to use an Algebra System (CAS) ;)

Yes, this is the rule, and it's true to, say, the 99.99% of the cases; there are however some exceptions, as explained before. You can say that "Numerical Analysis starts where the CAS stops", and this happens very often. I'm not referring to ClassPad's CAS, I'm referring to any CAS.

In the images up here i see a function LuaNumAn/TrapAd , in my luaNumAn 1.30 libs i havn't that function....

Well, TrapAd is included in the new version of LuaNumAn. I know that I said I was planning to release it later, but I finally decided to do it now, for reasons explained in the LuaNumAn topic. You can now reproduce to graph I posted here, which solves your problem.

#18 MicroPro

MicroPro

    Casio Overlord

  • Deputy
  • PipPipPipPipPipPipPip
  • 640 posts
  • Gender:Male
  • Location:Iran

  • Calculators:
    Casio ClassPad 300

Posted 31 December 2005 - 06:54 PM

Thank you. I will try. I'll check the about speacker during the afternoon.


ClassPad Plus had an speaker or not?!
Please tell me! I'm dying!

#19 Kilburn

Kilburn

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 491 posts
  • Gender:Male
  • Location:France
  • Interests:Blah

  • Calculators:
    FX-7500 G
    ClassPad 300

Posted 31 December 2005 - 08:05 PM

NO!

#20 Lovecasio

Lovecasio

    Casio Freak

  • Members
  • PipPipPipPip
  • 242 posts
  • Location:Hochiminh city Vietnam
  • Interests:Organic chemistry.<br />Pharmacy

  • Calculators:
    fx 570 MS, Casio AFX 2.0+, ClassPad 300

Posted 01 January 2006 - 01:08 AM

Hi. :)
My first post in 2006
To test whether CP300 Plus has speaker, you can download new add-in on Classpad.org site. After accessing it, press + or - or EXE then if you hear the beep, your CP has speaker.

2006 will be a revolution year of CP? In Casio and Saltire, we hope.

#21 TacoFred

TacoFred

    Casio Freak

  • Members
  • PipPipPipPip
  • 145 posts
  • Location:NJ
  • Interests:I LOVE STARCRAFT BROODWAR<br />MUHAHAHAHAHAHAHAHAHAHAHA

  • Calculators:
    cfx 9850gb+, fx 115MS, ClassPad 300, TI-89 Titanium

Posted 01 January 2006 - 01:29 AM

Your first post in 2006?
......but it's only 8:30PM...

edit: LOL I just realized that you live in Vietnam :blink: :lol2: :lol2:

#22 MicroPro

MicroPro

    Casio Overlord

  • Deputy
  • PipPipPipPipPipPipPip
  • 640 posts
  • Gender:Male
  • Location:Iran

  • Calculators:
    Casio ClassPad 300

Posted 01 January 2006 - 11:59 AM

NO!

Thanks! But I didn't expect to hear such load answer! ;) Anyway.

#23 Kilburn

Kilburn

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 491 posts
  • Gender:Male
  • Location:France
  • Interests:Blah

  • Calculators:
    FX-7500 G
    ClassPad 300

Posted 01 January 2006 - 01:29 PM

Thanks! But I didn't expect to hear such load answer! ;) Anyway.

:plol:


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users