Difficult Cas Problems In Classpad
#1
Posted 09 August 2005 - 10:32 PM
If you have solved a difficult problem with ClassPad, many users will be happy to know how (me included). If you cannot solve it, maybe someone will be able to help you (I will try for sure).
Pleaaase, don't post trivial CAS problems, or non CAS-related problems here!
A general rule concerning computer algebra systems:
Each time you evaluate an expression, and your CAS does not give the answer you expected, don't blindly assume that there is a bug, or that the expression cannot be evaluated. Sometimes you need to give more information to the CAS. Sometimes the CAS does not respond the way you expected simply because the result you expected is not true in general. Things that are obvious to you are not obvious to the CAS. For example, if your expression contains a constant, equal to the length of a pendulum, you know that this constant is a positive real number, but the CAS does not "know" this. Always give to the CAS information concerning the underlying physics of the problem, otherwise it may not be able to give you a useful answer. To conclude, the golden rule is:
Whenever you use a CAS, try to "think" as a CAS, not as a human being.
No computer algebra system will be ever able to "think" as you think (the rest is science fiction). Nevertheless, a CAS can be extremely helpful, provided that you know how to use it.
#2
Posted 10 August 2005 - 08:57 AM
Although symbolic integration in ClassPad is far from being "perfect", it seems that its capabilities in numerical integration are quite satisfactory. Here is a well-known difficult problem, which serves as a test that any good algorithm for numerical integration should pass:
Integrate the function x sin(1/x) sqrt(abs(1-x)) from x=0 to x=3 (the correct result is about 1.98194).
Plot the function to see why this problem is difficult. Note also that there is an integrable singularity at the lower limit. Needless to say that the corresponding indefinite integral cannot be computed.
Guess what, ClassPad passes this test succesfully! The computation time is 6 mins 30 secs, but the result is correct. If you integrate from x=1e-6 instead of x=0 (to avoid the singularity), the computation time is reduced to 3 mins and 47 secs, and the result is almost the same.
ClassPad can also do numerical integration in the complex plane, even in difficult cases. For example, the function x sin(1/x) sqrt(1-x) (similar to the previous one, but without the absolute value inside the root) can be integrated from x=2 to x=3 in 5 secs (the correct result is 1.18615 i). You can also compute definite integrals in the complex plane even if they have singularities. For example, ClassPad succesfully computes the integral of the above function from x=0 to x=3, but the computation time is now 11 mins 40 secs (the correct result is 0.175542+1.80640 i). Clearly, singularities affect the computation time drastically. But it still works!
Of course, the fact that ClassPad has passed the above tests does not mean that ClassPad's numerical integration is perfect. For example, I was able to integrate e^x/Sqrt(x-1) only if the integration interval does not contain the singular point x=1. If it does, ClassPad gets confused. Depending on where the singularity is (upper limit, lower limit, or in the middle), ClassPad may left the integral unevaluated or it may report "Timed out. The end condition was not satisfied", after a lot of time . ClassPad was unable to compute such integrals even after performing a transformation, in order to remove the singularity . Nevertheless, I think that ClassPad is quite powerful, as far as numerical integration is concerned (at least it is more powerful than I expected). Of course, numerical integration in calculators is not something new or "exotic". Many non-programmable calcs can do this, but they are not as capable as ClassPad.
If you have other calcs, such as HP49g, TI 92, or Voyage 200, please try the test integrals above (get ready for long computation times). I would like to know what answer they give and how much time they need for that.
#3
Posted 12 August 2005 - 02:16 AM
About the sum function.
Example: calculate the sum of 1/(x^2+x+1) from x=1 to x=10. The result appeared immediately after 1 second. Now, change x=10 to x=12. It take considerable time to solve this problem. I have no solution.
About solving trigonometric equations: it takes much more time than the first OS (1.0) in solving any kind of trig-eq.
About integral: calculate the area of circle x^2+y^2=R^2:
S = 2*integral(sqrt(R^2-x^2),x,-R,R). In OS 1.24, it cannot solve (real mode). In OS 2.0, it can solve this problem in real mode.
However, if you calculate the area as formula:
S=4*integral(sqrt(R^2-x^2),x,0,R), then in real mode, it cannot solve.
#4
Posted 12 August 2005 - 09:10 AM
Indeed, summing from x=1 to x=12 takes 5 secs. Not a lot of time, but considerably larger. It seems that ClassPad "gets confused" if you add small terms (those corresponding to x=11 and x=12), to the sum of the first 10 terms (which is a considerably larger number). I suppose that this is the case, because sum(1/(x^2+x+1) for x=11 to x=12 is computed immediately. In general, adding very small number to e.g., unity, may lead to unexpected results. This is an unavoidable problem in computer arithmetics. For example, most computers give 1+8*10^-7=1, or 1+3*10^-16=1, depending on the precision of the machine and the programming language used.About the sum function.
Example: calculate the sum of 1/(x^2+x+1) from x=1 to x=10. The result appeared immediately after 1 second. Now, change x=10 to x=12. It take considerable time to solve this problem. I have no solution.
The obvious workaround is to avoid adding very small numbers to large numbers, or at least to reduce such additions to the minimum. In this case, you get the correct result immediately if you add the sum from x=1 to x=10 to the sum from x=11 to x=12. I'm afraid that there is no better solution.
I have upgraded the OS immediately after buying my ClassPad, so I cannot tell everything about that. I think that you should post this in the "Bugs" topic, adding examples of computation times, if you can.About solving trigonometric equations: it takes much more time than the first OS (1.0) in solving any kind of trig-eq.
Well, although ClassPad's integration has many problems, I don't think that there is a bug here. First of all, let me say this: there are much better ways to compute this area, given that it has a circular symmetry (see below for this). That being said, if you insist to compute the area the way you do, here is what happens: ClassPad does not know anything about R, hence the problem. For example, if R is imaginary, then the integral is also "Non-Real"; you can overpass this problem by switching to "real" mode. But, still, the result cannot be obtained without any further knowledge about R. To understand what happens here, calculate the corresponding indefinite integral (in "real" mode). You will see that the answer contains the term x/|R|, which is equal to x/R, if R is positive, or to -x/R, if R is negative, or even indeterminate, if R=0. So, ClassPad cannot "decide" which is the case. You can "help" ClassPad to decide as follows: first compute the indefinite integral then do:About integral: calculate the area of circle x^2+y^2=R^2:
S = 2*integral(sqrt(R^2-x^2),x,-R,R). In OS 1.24, it cannot solve (real mode). In OS 2.0, it can solve this problem in real mode.
However, if you calculate the area as formula:
S=4*integral(sqrt(R^2-x^2),x,0,R), then in real mode, it cannot solve.
(ans|{x=R,R>0})-(ans|{x=0})
This way, you can compute integral(sqrt(R^2-x^2),x,0,R) easily. You tell ClassPad that R is positive, so there is no confusion. This gives the correct answer, pi R^2/4. As you can see, there is no bug here. In fact, if ClassPad was able to give the expected answer without any knowledge about R, that would be a bug.
However, you should avoid computing areas that have circular symmetry that way. There are two much more convenient ways to do this. You may probably know that, but i'll post the alternative solutions anyway:
(1) Compute the area in polar coordinates by using
(1/2)*integral(r(phi)^2,phi,phi1,phi2),
where phi is the polar angle, r(phi) is your function transformed in polar coordinates, and phi1, phi2 are the minimum and maximum angle, respectively. In your case, 4*integral(sqrt(R^2-x^2),x,0,R) is transformed to
2*integral(R,phi,0,pi/2),
and the result is obtained in no time, no matter what the mode is ("real" or "complex").
(2) Compute the area by the corresponding double integral, also in polar coordinates. In your case, you have to compute
4*integral(integral(r,r,0,R),phi,0,pi/2)
This is computed in no time as well.
As you can see, computer algebra cannot be used to solve every problem "blindly". Usually, you should transform the problem at hand to the most simple form, then use a computer to do the rest.
#5
Posted 14 August 2005 - 02:52 PM
ROM Version: 1.24
CAS Version: 4.20031005
PAP's problems
First problem
-------------
Numeric: Returns 1.98194116309 in 5555.2627 seconds and integration error is -2.02463522636e-11
Damn, this is slow ! i don't know if this can be faster by changing something though.
simbolic: Returns the Integral with changed variable (tells me to do it)
Second problem
--------------
Numeric: Returns the Integral (tells me to do it) if i try to eval it returns "Error: Non-Real Result"
simbolic: Returns the Integral with changed variable (tells me to do it)
Third problem
-------------
Numeric: Returns the Integral (tells me to do it) if i try to eval it returns "Error: Non-Real Result" if system flag 22 is set and with system flag 22 cleared returns "/ Error: Infinite Result"
simbolic: Returns the Integral with changed variable (tells me to do it)
Lovecasio's problems
First problem
-------------
sum x=10 result .707486988986 in 1.6532 seconds
sum x=12 result .72137521273 in 1.6932 seconds
exact mode used but real result obtained don't ask me why because with some function it returns very simplified result in exact form, but i can get the exact result using other ways
sum x=10 result 13212635038/18675445971 in 7.5089 seconds
sum x=12 result 2115104598196/2932045017447 in 8.853 seconds
Conclusion 1: with the HP49G use simbolic integration when possible, and if the problems are difficult most probably it will not solve them.
But this is kind of strange because my HP was capable of solving some problems that the CP could not without any problem, anyway there is a reason for the name calculator, otherwise it would be called computer
Conclusion 2: if you have an HP then i advise you to get to know your calc and math a little better so you can find alternative ways of solving the problem.
I leave a problem for you to test here
do the sum from x=1 to +inf of 1/(x^2+x+1)
my calc answers '?' in 1.182 seconds
or
sum from x=1 to x=10 of e^K/x
result (e^11-e^1)/(K*e^1-K) in 5.6586 seconds
or
sum from x=1 to x=10 of
result e^K*Psi(11)-e^K*Psi(1) in 2.6992
Psi(11)=2.35175258907, Psi(1)=-0.577215664902
#6
Posted 17 August 2005 - 08:13 AM
It seems that ClassPad is more powerful than HP 49g, as far as numerical integration is concerned. But I'm not sure: Maybe HP needed a lot of time to evaluate the first integral simply because the default integration accuracy in HP is too high (this integral cannot be computed with great accuracy easily). Maybe HP49g was not able to integrate the second and third integrals because it was not in "complex" mode, or because it cannot compute integrals in the complex plane. I don't really know, since I don't have this calc. R00KIE, can you give us more information?Conclusion 1: with the HP49G use simbolic integration when possible, and if the problems are difficult most probably it will not solve them.
But this is kind of strange because my HP was capable of solving some problems that the CP could not without any problem
On the other hand, I have compared HP49g and ClassPad in symbolic integration (using the emulator of HP49g and my ClassPad). It seems that HP49g is more capable than ClassPad in symbolic integration. Does anyone in Casio hear this? Upgrade the CAS!
This is a general conclusion, which is true for any computer algebra system, not just for HP49g. See my initial post in this topic...Conclusion 2: if you have an HP then i advise you to get to know your calc and math a little better so you can find alternative ways of solving the problem.
ClassPad left this sum unevaluated as well. The true result is -1+1/sqrt(3) pi tanh(sqrt(3)pi /2). I suspect that hyperbollic trigonometric functions are not well-implemented both in HP49g and ClassPad. Well, there is no calculator as powerful as Mathematica or Maple...I leave a problem for you to test here
do the sum from x=1 to +inf of 1/(x^2+x+1)
my calc answers '?' in 1.182 seconds
There is a typographical error here. Your sum is not equal to the "result" you give. This forum does not permit to write mathematical expressions easily, so please pay additional attention whenever you post such expressions.sum from x=1 to x=10 of e^K/x
result (e^11-e^1)/(K*e^1-K) in 5.6586 seconds
I'm afraid I don't understand: sum of what?. You have probably forgot to give the definition of the psi(x) function.sum from x=1 to x=10 of
result e^K*Psi(11)-e^K*Psi(1) in 2.6992
Psi(11)=2.35175258907, Psi(1)=-0.577215664902
#7
Posted 18 August 2005 - 08:57 PM
Second and third, sorry i messed things up a bit it should be like this
sum from x=1 to x=10 of exp(K)/x
result: exp(K)*Psi(11)-exp(K)*Psi(1) in 2.6992
Psi(11)=2.35175258907, Psi(1)=-0.577215664902
and
sum from x=1 to x=10 of exp(x)/K
result: (exp(11)-exp(1))/(K*exp(1)-K) in 5.6586 seconds
now it should be right
#8
Posted 19 August 2005 - 07:59 AM
If so, then your results, compared to mine, show that ClassPad is more powerful than HP49g in numerical integration, and much more powerful if this is done in the complex plane . But I'm still not 100% sure. Maybe there is another example that shows the opposite. However, I think that this is a remote possibility, since the integrals I posted here are typically used to test numerical integration capabilities of any system. Conclusion: it seems that HP49g has a more powerful symbolic integration, but its numerical integration capabilities are limited, compared to ClassPad.First one: it is in complex mode and in aprox mode
This sum is simply the well-known harmonic sum, multiplied by exp(k). The correct result is 7381exp(k)/2520, and ClassPad gives that result instantly. Your result is correct as well, but I cannot realize why the (unknown) function Psi(x) is involved in HP49g's result.sum from x=1 to x=10 of exp(K)/x
result: exp(K)*Psi(11)-exp(K)*Psi(1) in 2.6992
Psi(11)=2.35175258907, Psi(1)=-0.577215664902
HP49g's result is, of course, correct, and it is given in the simplest form. ClassPad gives the correct result in no time, but it is not as simplified. Even Mathematica cannot simplify the result as HP49g does! Conclusion: There is no CAS system more powerful than the others in every case --- but we already knew this.sum from x=1 to x=10 of exp(x)/K
result: (exp(11)-exp(1))/(K*exp(1)-K) in 5.6586 seconds
#9
Posted 19 August 2005 - 09:41 AM
If you replace Psi(11) and Psi(1) by their values, we have 7381exp(k)/2520sum from x=1 to x=10 of exp(K)/x
result: exp(K)*Psi(11)-exp(K)*Psi(1) in 2.6992
Psi(11)=2.35175258907, Psi(1)=-0.577215664902
But I don't see why there is a Psi function
Note that if you do sum for x=1 to n, the cp gives immediatelysum from x=1 to x=10 of exp(x)/K
result: (exp(11)-exp(1))/(K*exp(1)-K) in 5.6586 seconds
(e^(n+1)-e) / ((-1+e)k)
#10
Posted 19 August 2005 - 11:21 AM
I have replaced Psi(11) and Psi(1) by their values before answering to R00KIE, but I have made a typo, and my result (and my conclusion) was not correct. Mea culpa. I have edited my previous post to correct this mistake. Thanks, Overlord!If you replace Psi(11) and Psi(1) by their values, we have 7381exp(k)/2520
But I don't see why there is a Psi function
Indeed. Nice remark.Note that if you do sum for x=1 to n, the cp gives immediately
(e^(n+1)-e) / ((-1+e)k)
In this case, ClassPad works better if the summation limit is an undefined variable than a given number; in general, however, the opposite seems to be true. Strange behavior.
#11
Posted 19 August 2005 - 09:03 PM
Note that if you do sum for x=1 to n, the cp gives immediately
(e^(n+1)-e) / ((-1+e)k),
well the hp returns that too in 6.1021s
i was just trying to see what classpad does because i already knew that mathematica was unable to simplify that expression, but my guess is that this type of sum is known and the simplification is built in for that because doing it in other way the calc can't simplify the result.
#12
Posted 20 August 2005 - 05:02 PM
CP can calculate the sum (e^x)/k but if you try to calculate the sum 1/(x^2) with x=1 to infinite it cannot do it !
In fact , as i wrote in an older post it only calculates from x=1 to 256, if i put 257 it cannot do it.
My Voyage 200 calculates the sum 1/(x^2) with x=1 to infinite instantly ! The result is (PI^2)/6.
Unfortunatelly i had to buy the V200 because CP could not help me im my engineering studies...
I must say that CP is nice, but the V200 is more powerfull and much more faster.
regards
fiberoptik (writing from Portugal )
#13
Posted 20 August 2005 - 08:26 PM
the sum of 1/(x^2) from x=1 to 157 returns a LARGE exact fraction in 49.8267s
the cas help of HP49G says this about the function Psi
Psi:
Digamma function at a
point: the derivative
of ln(GAMMA(x))
Psi(3.)=.922784335098
I hope this helps to understand what Psi is.
and i have another one that breaks every cas i've ever tried, (HP, Casio, TI)
try to integrate exp(-x)/x
the HP just tells me to do it (returns same thing with x converted to Xt)
#14
Posted 20 August 2005 - 09:03 PM
#15
Posted 20 August 2005 - 09:44 PM
Indeed. I'm not impressed with ClassPad capabilities, and I think that ClassPad's OS should be upgraded for good.CP can calculate the sum (e^x)/k but if you try to calculate the sum 1/(x^2) with x=1 to infinite it cannot do it ! In fact , as i wrote in an older post it only calculates from x=1 to 256, if i put 257 it cannot do it.
V200 is probably more powerful than ClassPad, maybe it is faster too, but I don't think that it is much faster. Anyway, you should prove your statement. I don't think that it is difficult to find CAS problems where ClassPad actually performs better than V200. For example, HP49g seems to be more powerful than ClassPad in analytic integration, but we have already found examples where ClassPad performs much better than HP49g in numerical integration (see previous posts in this topic). Even then, nobody said that ClassPad is much better than HP49g in numerical integration, we said that this seems to be true.I must say that CP is nice, but the V200 is more powerfull and much more faster.
Anyway, I didn't started this topic in order to compare calculator capabilities, although this is an interesting issue. If you want, you can start such a topic (maybe I will do it too).
#16
Posted 20 August 2005 - 10:02 PM
It does help, because the symbol Psi for this function is confusing. "Digamma" is a letter used in early ancient greek. It means "double gamma", and it is written almost as the latin "F" (actually, romans have copied this letter). "Psi", on the other hand, is also a greek letter, but it is written quite differently.the cas help of HP49G says this about the function Psi
Psi: Digamma function at a point: the derivative of ln(GAMMA(x))
Psi(3.)=.922784335098
I hope this helps to understand what Psi is.
Still, it is strange that HP49g needed this function to evaluate the sum of exp(K)/x from x=1 to x=10. Anyway, I have to say that I'm impressed by the HP49g's manual. Unfortunately, I cannot say the same thing for the manual of ClassPad...
Of course. There is no computer algebra system able to evaluate this integral, simply because it cannot be evaluated (to be more precise, the antiderivative cannot be expressed with elementary functions). You cannot ask from a CAS to solve a problem that cannot be solved. The most known example of unevaluated integrals is the integral of exp(x^2), which is directly related to the normal distribution.and i have another one that breaks every cas i've ever tried, (HP, Casio, TI)
try to integrate exp(-x)/x
the HP just tells me to do it (returns same thing with x converted to Xt)
#17 Guest_Guest_*
Posted 21 August 2005 - 12:52 AM
#18
Posted 21 August 2005 - 08:59 AM
Not always, not in every use of a CAS calculator. See previous posts, you will see that there are problems where ClassPad is much faster. There are also problems where ClassPad gives the correct answer, while HP cannot solve the problem at all. Of course, the opposite is true as well.Why compare with the HP49g? It's obsolete. The HP49g+ is a few times faster.
I'm not saying that ClassPad is a better calculator. Probably it is not. But this is not the point: this topic is for solving CAS problems with the ClassPad, despite the limitations that the current OS has. We may occasionally be interested on comparing calculators, but only with a difficult CAS problem at hand. Manifesting a personal opinion without any argument is useless.
No offense, but If you want to compare calculators, log in, then create a comparison topic, and post your opinion there. Even then, I think that you should prove what you are saying. In your topic, however, you may also keep manifesting how perfect your favorite calculator is, without any argument. The choice is yours. But do it in your topic, or in a free discussion topic. Please, don't do it here.
#19
Posted 21 August 2005 - 01:44 PM
here is a link to a page with some test calculations ( more or less a comparison between V200 / TI-89 and CP). This tests where made with CP OS 1.0 and it failed most of them. Let's try again with OS 2.0 to see if there was some improvement to the CAS engine.
http://www.ti-cas.or...tegr1/index.htm
regards
fiberoptik
#20
Posted 21 August 2005 - 04:42 PM
The well-known web page in ti-cas.org. I have almost forgotten this stuff. Thanks.here is a link to a page with some test calculations ( more or less a comparison between V200 / TI-89 and CP). This tests where made with CP OS 1.0 and it failed most of them. Let's try again with OS 2.0 to see if there was some improvement to the CAS engine.
http://www.ti-cas.or...tegr1/index.htm
I understand french, so I'm planning to re-test in OS 2.00 all the CAS problems found in ti-cas.org, together with several other tests I have found in the Internet (they are all in french). Needless to say that I will post my results here as soon as possible.
#21
Posted 22 August 2005 - 09:15 PM
Why compare with the HP49g? It's obsolete. The HP49g+ is a few times faster.
Well the 49G+ is mostly a faster (sometimes more than others) version of the 49G so the CAS is basically the same, and i've posted the result and timmings of the 49G because it's the one i own and because PAP said
If you have other calcs, such as HP49g, TI 92, or Voyage 200, please try the test integrals above (get ready for long computation times). I would like to know what answer they give and how much time they need for that.
i wasn't trying to say wich calc is better just posting the results as asked, and i think that with this comparison everybody wins, HP, Casio and TI owners, because this way people can be aware of problems/limitations of the calc they own and use at school (and exams) so you can avoid wasting time and possible wrong results.
About the calc compare thing, well if it's going to be like 1=0.99(9) true or false thing but with calcs it's better to be in another topic
#22
Posted 26 August 2005 - 11:12 AM
In the site, they have tried to compute the integral of cos(t) arctan(cos(t)) from t=0 to t=pi/2. They failed in a real ClassPad, although ClassPad Manager was able to give the correct result. So, their conclusion was: "it seems that this integral cannot be computed in a real ClassPad" (it is written in french). This is not true. ClassPad can compute this integral, but it needs a lot of time (more than 30 minutes). They break the computation after 10 minutes, so they were not able to get the result. Furthermore, this integral needs a lot of time to be evaluated if (and only if) you naively use the integration function. Indeed, if you simply type:
integral(cos(t) arctan(cos(t)),t,0,pi/2)
(as they did), ClassPad will try to evaluate the integral with "perfect" accuracy, and this needs a lot of time. Afterall, "perfect accuracy" is usually meaningless in numerical computations. However, you can easily evaluate the integral by reducing the tolerance to, e.g., 1e-16. This is done by typing:
integral(cos(t) arctan(cos(t)),t,0,pi/2,1e-16)
ClassPad is able to compute this integral in about 3 seconds, and the result is highly accurate (the difference from the true value is only 2e-10). In general, whenever ClassPad needs a lot of time to compute an integral numerically, try to reduce the integration tolerance. You may get a perfect result in no time.
On the other hand, TI-89 was able not only to compute this integral, but also to give the result in symbolic form! In the site, the say that "this is spectacular", and I totally agree. It is amazing, for a calculator.
#23
Posted 05 September 2005 - 08:22 AM
It is well-known that symbolic integration in ClassPad has many limitations, and it seems that the competitors perform better in most cases. This, however, doesn't mean that we cannot compute difficult indefinite integrals in ClassPad. In many cases, a simple substitution of the type u=g(x), where g(x) a carefully chosen function, can simplify things, and give the correct result in notime. As an example, let's try the integral of the function 1/sqrt(tan(x)). This a difficult integral, which cannot be computed directly in ClassPad (already posted in the "Bugs" topic). Here, the obvious substitution is u=sqrt(tan(x)). In ClassPad, we can do this by typing:
1/sqrt(tan(x)=1/u->subst
which is a substitution rule, stored in the variable subst. Note that u=sqrt(tan(x))->subst will not work, because the "assume" command (|) is not smart enough tou handle this; another limitation...
Now, the transformed integrand is
(1/sqrt(tan(x))|subst) diff(getRight(solve(subst,x)),u)->Uintgrnd
This gives the integrand, expressed in terms of the u variable, instead of x. This integrand is stored in Uintgrnd, and it is actually a list containing one element. The expression above seems complicated, but in fact it is not. Try to evaluate it part by part to realize why it should be written like that.
In this example, the integrand becomes 1/(u^4+1), and it is easily integrated (in "Complex" mode):
integrate(Uintgrnd ,u)
The result is, of course, expressed in terms of u. We must now eliminate u and return to the variable x:
ans|solve(subst,u)
This gives the final result (not posted here, since it is a rather long expression). Now we can verify our result by typing
simplify(diff(ans,x))
which gives 1/sqrt(tan(x)), as expected.
As you can see, we can make ClassPad able to compute something that it cannot handle directly...
#24
Posted 05 September 2005 - 08:39 AM
The example in my previous post shows a particular case, where a simple substitution can simplify things. This process can be generalized: the following function IntgSub(intgrand,subst) takes as arguments the integrand intgrand and the desired substitution subst. It returns the computed integral:
integrate((intgrand|solve(subst,x)) diff(getRight(solve(subst,x)),u),u)|solve(subst,u)
The function substitutes the integrand using the substitution rule given, then it evaluates the transformed integral. It returns the result as an expression in terms of the original variable x.
This function can be further generalized. Unfortunately, we cannot do this in CP Basic, because of the one-expression limitation that exists in functions. Nevertheless, the function IntgSub ("integral by substitution") is very handy in many situations, even as it is now (a "semi-generalized" form). For example, the integral of 1/sqrt(tan(x)) (see previous post) can be easily computed by typing:
IntgSub(1/sqrt(tan(x)),u=sqrt(tan(x)))
As another use of the function IntgSub, let's try the integral of x sin(x) + x ln(x). There is nothing difficult in this integral, but ClassPad cannot evaluate it directly, due to limitations concerning the ln(x) function (see my post about this in the "Bugs" topic). Here, the obvious substitution is u=ln(x). This integral can be easily computed by typing:
IntgSub(x sin(x) + x lin(x),u=ln(x))
which gives the correct result in notime.
------------------------------------------------------------------------------------
PS: Of course, one can write a more "sophisticated" version of the above function by implementing it as a program, where multiple expressions can be used. However, I think that this method is not convenient at all, since a program is not a "subroutine", so it cannot return anything. If you write the algorithm as a program, you can further generalize it, but you will need temporary variables in order to use the result in the "Main" application. These variables should be deleted after use, by using the DelVar command. I will not post such an algorithm until CP Basic will support functions that are not limited in one expression (I'm afraid we will never see such an an upgrade, given that, until now, all OS "upgrades" have nothing to do with the CAS...)
#25
Posted 06 September 2005 - 02:47 AM
PS: Of course, one can write a more "sophisticated" version of the above function by implementing it as a program, where multiple expressions can be used. However, I think that this method is not convenient at all, since a program is not a "subroutine", so it cannot return anything. If you write the algorithm as a program, you can further generalize it, but you will need temporary variables in order to use the result in the "Main" application. These variables should be deleted after use, by using the DelVar command. I will not post such an algorithm until CP Basic will support functions that are not limited in one expression (I'm afraid we will never see such an an upgrade, given that, until now, all OS "upgrades" have nothing to do with the CAS...)
There has been already an Addin called "PRGM Conv", which can convert a "program" with multiple expressions into a funtion (certainly return value) . You can download it at www.classpad.org site.
#26
Posted 06 September 2005 - 08:31 AM
I know that Add-In, but it doesn't work. As far as I can tell, it only forces a program (PRGM) to become a function (FUNC), without changing anything, except probably the header of the file. The result is a file that is marked as a "function" in the variable manager, but it cannot be used. Even the sample program given in the Add-In does not work as expected: you can convert it to a "function", but if you call that function in the "Main" appilication (or in a program), it returns "Undefined".There has been already an Addin called "PRGM Conv", which can convert a "program" with multiple expressions into a funtion (certainly return value) . You can download it at www.classpad.org site.
But even if it worked, this Add-In has many limitations: ReadMe says that only a few statements can be used (If,For,While,Do), and you have no access to other variables stored in memory. As it is now, it is totally useless; even if it worked, it will be almost useless. CP Basic is a poor language, its function support is primitive, and this Add-In is not the solution, definitely.
#27
Posted 06 September 2005 - 12:35 PM
I know that, but it doesn't work. As far as I can tell, this Add-In only forces a program (PRGM) to become a function (FUNC), without changing anything except probably the header of the file. The result is a file that is marked as a "function" in the variable manager, but it cannot be used. Even the sample program given in the Add-In does not work as expected: you can convert it to a "function", but if you call that function in the "Main" appilication (or in a program), it always return "Undefined".
That sounds strange. It work well on my ClassPad.
Example: make a function that calculates n! (n is the parameter), name gt():
Local i,kq
1=>kq
For 1=>i To n
kq*i=>kq
Next
Return kq
Do necessary thing with PRGM Conv. Then go to Main app, input gt(5) EXE, you will get 120, which equals 5!.
Another example: define f(x)=1 if x<0, f(x)=x if 0<=x<2, f(x)=sin(x) if x>=2:
...
If x<0: Then: Return 1
Else If x<2: Then: Retuen x
Else: Return sin(x)
IfEnd.
...
Then drag f(x) into Graph window, you will get right graph.
and you have no access to other variables stored in memory
I don't understand, please explain if you have time.
#28
Posted 07 September 2005 - 09:29 PM
Strange, it doesn't work on mine. Maybe I'm doing something wrong?That sounds strange. It work well on my ClassPad.
Well, even if this Add-In works, it does not let you to have access to other variables stored in memory. This means that a function cannot call another function stored in ClassPad. Furthermore, a function cannot call itself (the well-known "recursion"). There is another problem: only a few CP commands can be used. These are serious limitations. I cannot imagine a serious program written this way. And, of course, it is annoying to use this Add-In everytime you define a function.I don't understand, please explain if you have time.
Anyway, I'm very-very suspicious about this Add-In. What it claims it can do is very nice to be true. As I said before, I suspect that it is a very simple Add-In that makes ClassPad to "see" a program (PRGM) as a function (FUNC), without changing anything else. That is, perharps, the reason for the limitations concerning the "functions" defined this way. Maybe the Add-In makes use of an OS bug to do that, I don't know, and I'm not really interested. Many users complained about the primitive function support in ClassPad, and nobody said that this Add-In is the solution. I'm almost sure that this is true.
I decided to forget CP Basic, because it is unusable, as it is now. I will consider to reuse it if (and only if) Casio will release an OS with a huge CP Basic upgrade. The CAS has also many limitations, but still, you can do something useful with it. I started this topic for discussing CAS problems, not CP Basic...
#29
Posted 16 September 2005 - 12:40 AM
CASIO BELIEVES THAT ONLY THE CHILDS ON THE SCHOOL USES THEIR CALCS !!!!, A LOT OF THINGS, THAT CAUSE WE GO TO HP OR TI, NO ENGINEERING, NO BETTER CAS (THEY COULD DO THIS ) , , IF THEY HAVE THE POWER (CASIO HAVE A FERRARI ENGINE IN A CHILD CAR!!), WHY NOT SQUASHES THE COMPETITORS!!! THANKS. this was a moment of fury, because i could buy a CP in this winter
I PROPOSE TO SEND A MEGA E-MAIL TO CASIO, IN ORDER TO OBTAIN THE BEST ONE OS 2.40..WITH IMPROVEMENTS IN THE NAME OF ALL CASIO FORUM MEMBERS, WE ARE THE BIGGEST COMUNITY OF CASIO USERS, AND WE HAVE RIGHTS, NOT ONLY THE CHILDS IN THE CLASSROOM!!
THANKS...
#30
Posted 16 September 2005 - 07:45 AM
Actually, my intention is not to discover the CAS weaknesses. I started this topic in order to discuss how CP CAS can be used effectively. You are right, the CP CAS has many limitations, some of them are very annoying, but, still, it can be used to solve problems, even difficult problems. I also started this topic because I have seen some posts reporting CAS "bugs" where, actually, there is not a bug. Many CP users cannot use the CAS effectively just because they don't know how to use a computer algebra system: they cannot solve a particular problem, and they easily conclude that the CAS has a bug. In several cases, this is not true. I'm not saying that CP CAS is perfect nor that it is better than the competitors. On the contrary, symbolic computation seems to be weak, compared to the competitors. But I want to be fair: despite its limitations, the CP CAS can solve difficult algebraic problems, you just need to know how to do this.very good topic PAP, you are the Sherlock Holmes of the CP300 CAS weaknesses!...
There is probably an email address for this, but I'm afraid that they will answer something like "dear customer, blah blah, blah...".Exist any form of contact with casio?
I'm afraid that you are right. It seems that Casio's priority isn't the CAS developement.there are LOT of problems in the CAS that casio would solve. WHY NOT?.it seems that the preoccupation of CASIO isn?t the CAS (The Ultimate 9860g havn?t CAS)
I have created an eActivity containing several CAS problems that CP should be able to solve, but it cannot, due to the CAS limitations. The CAS in OS 2.2 fails to solve all these problems. As far as I know, the CAS is exactly the same as before.OS 2.20 could be a solution, Im not sure, you have an idea of this?, OS 2.20 solves any CAS problem?.
Again, you are right. CP has the potential to become a really great calculator. It is not, due to the OS. Indeed, we have a Lamborghini engine who needs better sparks.NO ENGINEERING, NO BETTER CAS (THEY COULD DO THIS ) , , IF THEY HAVE THE POWER (CASIO HAVE A FERRARI ENGINE IN A CHILD CAR!!), WHY NOT SQUASHES THE COMPETITORS!!!
I'm not sure that we will have any useful response. I can imagine something like "as its name implies, ClassPad is mainly a calculator for education". This is true, but I cannot see how this implies a weak CAS, and a very poor Basic.I PROPOSE TO SEND A MEGA E-MAIL TO CASIO, IN ORDER TO OBTAIN THE BEST ONE OS 2.40..WITH IMPROVEMENTS IN THE NAME OF ALL CASIO FORUM MEMBERS, WE ARE THE BIGGEST COMUNITY OF CASIO USERS, AND WE HAVE RIGHTS, NOT ONLY THE CHILDS IN THE CLASSROOM!!
PS: I like your logo. Half-Life 2 is the best game I have even seen.
#31
Posted 16 September 2005 - 10:10 PM
P.D:yeah HALF LIFE IN ALL THE SIDES IS AMAZING SO FAR THAN THE COMPETITORS (BILLY GATES,THIS HURTS YOU), I VOTE FOR A CHANGE IN THE CASIO I+D TEAM, BY THE VALVe SOFTWARE TEAM!! THEIR WORK ROCKS!!, SOURCE ENGINE FOR CALCS! (this was a joke moment sponsored by the HL comunity)
#32
Posted 16 September 2005 - 10:37 PM
Plus, you may not forget that there is a development kit for the ClassPad, and this had never happen before. It is true that there weren't much contacts between Casio and the users in the past, but things are getting better now By the way, your example with Martin Poupe's mail is a little bit old: It was on 15 May 1997, and the exact mail and response from Casio's customer service was
Source: http://prg.rkk.cz/~m...nuals/CASIO.TXT> Dear CASIO !
> I have got your product - color graphics calculator 9850 G.
> I wrote some programs and I found some bugs in this "Basic" language
> interpretter.
> Example:
>
> Lbl 0
> While 0
> 1=0=>Goto 0
> WhileEnd
>
> Can I correct these bugs ??
> I have read somewhere, that it is possible programming
> calculator CASIO direct in assembler language, can you
> send me some informations about it ?
> (If it is NOT CASIO security)
> Yours sincerely
> Martin Poupe
> E-mail XPOUPE AT HWLAB.FELK.CVUT.CZ
We have no information on programming Casio calculators directly into
assembler language. Also, I dont understand what the bug is? What
is it supposed to do?
#33
Posted 22 September 2005 - 07:56 PM
f'(x,y)=df/dx+df/dy*y'
#34
Posted 22 September 2005 - 11:09 PM
Easy: diff(f(x,y),x) will compute the partial derivative of f(x,y) with respect to x, diff(f(x,y),y) will defferentiate with respect to y. You can also include a third argument to diff, which gives the order of differentiation. Examples:Please explain How I can use Classpad for partial differentiation ?
diff(x^2 y^3,x) = 2 x y^3
diff(x^2 y^3,y) = 3 x^2 y^2
diff(x^2 y^3,y,2) = 6 x^2 y
diff(x^2 y^3,y,4) = 0
If you need mixed derivatives, you can nest several diff functions. For example, diff(diff(f(x,y),y,2),x) will compute the third partial derivative (one time with respect to x and two times with respect to y):
diff(diff(x^2 y^3,y),y,2),x) = 12 x y
#35
Posted 23 September 2005 - 09:21 PM
Easy: diff(f(x,y),x) will compute the partial derivative of f(x,y) with respect to x, diff(f(x,y),y) will defferentiate with respect to y. You can also include a third argument to diff, which gives the order of differentiation. Examples:
diff(x^2 y^3,x) = 2 x y^3
diff(x^2 y^3,y) = 3 x^2 y^2
diff(x^2 y^3,y,2) = 6 x^2 y
diff(x^2 y^3,y,4) = 0
If you need mixed derivatives, you can nest several diff functions. For example, diff(diff(f(x,y),y,2),x) will compute the third partial derivative (one time with respect to x and two times with respect to y):
diff(diff(x^2 y^3,y),y,2),x) = 12 x y
by paitial differentiation I mean this :
f= 1/x^2 - y/x -y^2
f'x,y= -2/x^3 - y'/x + y/x^2 - 2yy'
f= x^2 y^3
f'x,y= 2xy^3 + 3x^2y^2y'
#36
Posted 23 September 2005 - 09:34 PM
Hmm, this is not partial differentiation, since y depends on x only. It's easy to do it, anyway: just tell ClassPad that y is a function of x: use y(x) instead of y. For example, the expression diff(x^2 y(x)^3,x) gives what you expect. Try it.by paitial differentiation I mean this :
f= 1/x^2 - y/x -y^2
f'x,y= -2/x^3 - y'/x + y/x^2 - 2yy'
f= x^2 y^3
f'x,y= 2xy^3 + 3x^2y^2y'
#37
Posted 24 September 2005 - 08:06 AM
Hmm, this is not partial differentiation, since y depends on x only. It's easy to do it, anyway: just tell ClassPad that y is a function of x: use y(x) instead of y. For example, the expression diff(x^2 y(x)^3,x) gives what you expect. Try it.
PAP !
are you Wakeful ?
your expression is like to write diff(x^2 y x^3 ,x)=5x^4 y
I know that I shloud say classpad : (hey , y is a function of x) , but I don,t know how .
using y(x) instead of y is not the solution, believe me,
the parenthesis just change the order of calculation .
I tryed several ways , but I became disappointed !
maybe I,m stupid or maybe the classpad is stupid
or maybe we are stupid together !
but , we know the fact !
#38
Posted 24 September 2005 - 08:22 AM
EXCUSE ME?PAP! are you Wakeful ?
You are wrong. Here is the output I get in my ClassPad:your expression is like to write diff(x^2 y x^3 ,x)=5x^4 y
I know that I shloud say classpad : (hey , y is a function of x) , but I don,t know how .
using y(x) instead of y is not the solution, believe me,
the parenthesis just change the order of calculation .
I tryed several ways, but I became disappointed !
diff(x^2 y(x)^3,x) --> 3 x^2 (y(x))^2 diff(y(x),x) + 2 (y(x))^3 x
As you can see, I does the right thing: y(x) is treated as an (unknown) function, as it should. Maybe you have typed it incorrectly. TRY IT AGAIN!
#39
Posted 24 September 2005 - 08:41 AM
EXCUSE ME?
You are wrong. Here is the output I get in my ClassPad:
diff(x^2 y(x)^3,x) --> 3 x^2 (y(x))^2 diff(y(x),x) + 2 (y(x))^3 x
As you can see, I does the right thing: y(x) is treated as an (unknown) function, as it should. Maybe you have typed it incorrectly. TRY IT AGAIN!
excuse me PAP !
but when I try your expression :
Error : Domain
please explain more .
Or If it is possible give your expression within an Eactivity . thanks .
Excuse me again !
#40
Posted 24 September 2005 - 09:07 AM
I don't think that there is need to send you an eActivity containing that expression. It's correct, as it is written here.but when I try your expression :
Error : Domain
See if there is a variable named "y" in your current directory. If it is, ClassPad cannot treat y(x) as an unknown function. I bet that this is the reason for your error. Try another name for that function, or delete the variable "y" from your current directory (if you are writing the expression in an eActivity, the current directory is "eAct").
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users