latentcorpse

116 Reputation

2 Badges

16 years, 334 days

MaplePrimes Activity


These are answers submitted by latentcorpse

i'm a bit confused.

do you mean that because we are working in floating point, maple rounds these answers off?

what would be the reason for Maple giving us very small answers for tan(x)-x and not exactly zero? is it just because tan has to round the answer off?

thanks. that works for me as well.

i am confused as to what a ulps is. i looked it up, it units in last place. so this means that if the tan(this_soln) and this_soln are within a given tolerance (in this case 100 ulps) verify will come back true.

but what is the value of ulps? what is the last place?

take for example the 1st soln 4.493409458.

the last place is 8x0.000000001

so would 100 ulps = 100 x 0.000000001 = 0.0000001

and then if the two numbers are within 0.0000001 of each other verify will come back true?

thanks for the reply. i tried changing

evalb(simplify(tan(this_soln)-this_soln)=0);

to

verify(tan(this_soln),this_soln,float);

and it came up with an error

i also tried changing it to

evalb(fnormal(simplify(tan(this_soln)-this_soln))=0);

and this gave the first couple as true but the rest remained false.

 

This is excellent. Thank you so much. I' m trying to understand the printf bit though. printf("The remainder is %a with a remainder of %a", P[i-2]/Q[i-2], rlast);
 

so we have remainder is %a. the % sign means maple refers back to the last value assigned to a and prints it here. without it we would just get the remainder is a (i.e. a letter not a fraction). is that correct?

but then you say with a remainder of %a, P[i-2]/Q[i-2], rlast. surely we only want to print rlast here? what is the reason for the other terms? thanks again.

i'm not supposed to use shortcuts such as identify. i.e. i have to write a procedure that does it, hopefully i'm on the right lines so far.

 

thanks.

when i found the eigenvalues of one of my matrices earlier i was meant to print them out and show that they were purely imaginary.

however i got them to be things like 1.6x10^(-16) +2.7i.

clearly this is pretty much as close to purely imaginary as i'm going to get but the fact that the real part isn't quite zero is annoying. is there any way to tell maple to make it zero? or i could just explain it in a comment-is there some reason why maple isn't making it zero?

 

thanks again!

in my code i actually called it muset instead of set. the variable mu wasn't relevant to this part of the problem though so i thought it would be easier for people to understand if i removed it. sorry for the confusion there.

the copy(A) thing worked. thank you very much!

my other problem is now that i have this array of antihermitian matrices, i need to create another array where the ith entry is the imaginary part of the smallest eigenvalue of the entry in the array muset. (hope that made sense!)

perhaps my attempted code will help clear this up:

B:=Array(1..M)
  for i from 1 to M do
    B[i]:=copy(Eigenvalues(muset[i])
  end do:

this seems to work fine for getting me an array containing the eigenvalues of each matrix entry in muset

then i have:

C:=Array(1..M)
  for i from 1 to M do
    C[i]:=sort(abs(B[i]),numeric)
  end do:

this also appears to work for arranging the eigenvalues into order where the 1st entry in each entry in C is the smallest eigenvalue (the one we want)

and then i select this 1st entry as required

C2:=Array(1..M)
  for i from 1 to M do
    C2[i]:= (C[i])[1]
  end do:

(i) this also appears to work. so i've got a working code it's just that i had to create three or four seperate arrays to get there. is there any way of shortening this so that i can get it all into just the one array?

(ii) was i correct that i only needed a "copy" in the B array and not in C or C2

 

thanks again.

cheers. im not a maple computer just now but what command would u reccomend i use - is it something like dsolve for a differential equation like that?

Page 1 of 1