HP Forums
Bug? using define - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: Bug? using define (/thread-606.html)



Bug? using define - Mickpc - 02-04-2014 12:41 AM

So tried to define the equation:

Vmean = Int(0,pi,Vmax*sin(theta)dtheta

I was suprised that it evaluated it from within the define, but it gives the wrong answer. For V = 10 I should get Vmean = 3.18. Instead I get 63.66. I have zero in theta.

It evaluates it correctly in the home view.

Any ideas?

Regards

Mick C


RE: Bug? using define - Han - 02-04-2014 03:21 AM

(02-04-2014 12:41 AM)Mickpc Wrote:  So tried to define the equation:

Vmean = Int(0,pi,Vmax*sin(theta)dtheta

I was suprised that it evaluated it from within the define, but it gives the wrong answer. For V = 10 I should get Vmean = 3.18. Instead I get 63.66. I have zero in theta.

It evaluates it correctly in the home view.

Any ideas?

Regards

Mick C

Just a few things on my checklist that may applicable to you:

1. Are you in radian or degree mode
2. Are you in RPN mode? If so, did you quote the algebraic expression? Or did you leave it unquoted?
3. Are the variables in the formula defined (as in, did you store values in them yet)?


RE: Bug? using define - Mickpc - 02-04-2014 09:08 AM

Han,

I had the Prime in radians mode.
I tried both RPN and Textbook in Home view.
I tried it with both quoted and unquoted versions.
V is a built in variable, to my knowlede it cannot be cleared.

It seem to totally ignore the V passed into it and uses the stored variable.

I was suprised it even allowed a intergral that needs to be evaluated to be used in the define.

Regards,

Mick C


RE: Bug? using define - Mickpc - 02-04-2014 09:11 AM

I just realised it is because theta is defined as zero.

Regards

Mick C