73 Reputation

4 Badges

17 years, 300 days

MaplePrimes Activity

These are answers submitted by susan_likes_math

Hello, all! Thank you very much for your earlier help. Unfortuneatly, I am still not quite getting the results that I want. Right now, I have: I have a list of polynomials: P := (v[1])^3 - 1, (v[2])^4 + 1; and a procedure eval_poly(P) eval_poly := proc(P) v := [1,2,3]; P; end proc; If I do this in the maple window, the list P automatically becames a list of numbers, because the variable v has been assigned numeric values. But in the procedure, v is just a local variable, and so the variables in the polynomial don't seem to be in the same place in memory and thus they are not evaluated. Inside the procedure, I've tried subs(v=[1,3],P[1]); and also eval(P[1],v = [1,3]); but nothing seems to work, and the polynomial is not evaluated. Any ideas on how to set the variable v inside a procedure so that the polynomial is evaluated? Thank you very much!! Any and all comments are appreciated! I wanted to try and avoid changing the form of the polynomial... I am given them as a list and don't have too much control over them at the moment. Take care, Susan
Page 1 of 1