C_R

2130 Reputation

19 Badges

4 years, 244 days

MaplePrimes Activity


These are questions asked by C_R

I want to make from a procedure call a single argument function that can be used in function composition.

To illustrate this with a simple example, below the function pow[3] performs a cube operation

pow[3]:=x-> `^`(x,3):
(evalf[4]@pow[3]@sin)(Pi/6)
                             0.1250

To make the use of pow a bit more generic, I though about doing definitions for other powers in a loop with an inline assignement

for i from -1/2 to 5 by 1/2 do (power[i]:=x-> `^`(x,i)) end do;

This does not work because the i in the rigthhand side of power[i]:=x-> `^`(x,i) does not evaluate to the acutal value of the loop counter. I tried eval and evaln without success. How do I get full evaluation of the inline assignement?

Both uses of evalf

evalf(Pi, 20);
evalf[20](Pi);

work, but only the latter is documented. Is there a reason behind (maybe historical)? Any reason not to use evalf(...,n) any more? I am also reluctant to update old worksheets if there is no need for the indexed version.

Only for my understanding. In the following I need to use expand to apply division to list elements when the divisor is a name:

[a, b]*(1/2)

[(1/2)*a, (1/2)*b]

(1)

[a, b]/c

[a, b]/c

(2)

expand([a, b]/c)

[a/c, b/c]

(3)

NULL

Does in this case automatic simplification make a difference between numbers and names? (Probably this is explained somewhere.)

Download div_of_list.mw

I cannot figure out which operand(?) is substituded here

subs(1 = 2, a*b);
                              2  2
                             a  b 

Same for

subs(1 = 3, a + b);
                           3 a + 3 b

but

subs(1 = 2, a/b);
                                2
                               a 
                               --
                               b 

subs(1 = 3, a - b);
                            3 a - b

Is this by design?

I very welcome this new feature Thumbs up - Free signs icons but here I am stuck

"restart; f(x):=( sin(x))/(x) :  plot(f(x),title=f(x))"

 

solve(f(x) = 0, x, allsolutions); about(_Z1)

Originally _Z1, renamed _Z1~:
  is assumed to be: integer
 

 

SolveTools:-DisplaySolutions(%)

%PIECEWISE([2*Pi*_Z1, ``])

(1)

Questions:
Q1: How to get also the uneven multiples of Pi?
Q2: Why is zero not excluded?
Q3: How to get the desirable output "{  Pi n        n in `&Zopf;` , n<>0"

 

DisplaySolutions.mw

 

 

1 2 3 4 5 6 7 Last Page 3 of 27