nm

9718 Reputation

19 Badges

12 years, 61 days

MaplePrimes Activity


These are answers submitted by nm

you could see example in

https://rosettacode.org/wiki/Associative_array/Creation#Maple

"Maple tables are hashed arrays. A table can be constructed by using the table constructor."

T := table( [ (2,3) = 4, "foo" = 1, sin(x) = cos(x) ] );
          T := table(["foo" = 1, sin(x) = cos(x), (2, 3) = 4])
 
> T[2,3];
                                   4
 
> T[sin(x)];
                                 cos(x)
 
> T["foo"];
                                   1

 

if it for display, you could always do

a*z^``(-1)

I do not do plotting much in Maple, so this might not be the optimal solution. it seems to lose the minor ticks though.  There might be a way to also keep these there. I think the problem is that Maple needs a little bit more space, and so it added ticks by skipping every other value. that is why the odd values 5 and -5 do not show up.

 

R:=10:
r:=5:
plot3d( [ ( R+r(u,v)*cos(v))*sin(u),
          ( R+r(u,v)*cos(v))*cos(u),
            r*sin(v)
        ],
            u=0..2*Pi,
            v=0..2*Pi,style=patchnogrid,
            scaling=constrained,
            scaling=constrained,
coordinateview=[-15..15, -15..15,-5..5],tickmarks=[default,default, [seq(i,i=-5..5,2)]],
lightmodel=light3, viewpoint = circleleft);

 

Or you could increase the view to coordinateview=[-15..15, -15..15,-6..6] to give it more space? 

 

Maple uses last name evaluation for number of expressions. But this does not apply to things that are rtable based. This includes Matrix, Vector, and Array etc...

last name evaluations is what you are asking for. This means, when you write A:=C; and then assign some value to C, then when you use A again, you expect it to have same value you assigned to C. This is because Maple used last name evaluation to A.

But this does not work with rtables.  That is why when you print the matrix again, you did not see its value changed after you changed m

I do not know if it is possible to change this. But you can always use eval or subs

restart; 
u:=<-2+m,3+m>;
m:=5;
u;

type(u,'last_name_eval')

false

You can now use eval to force value of m to be used inside rtable

unassign('m');
u:=eval(u,m=5)

Look up last name evaluation in help for more information.

 

I get slighlty different result from that shown.

f:=t->862.979774+1825.011621/((1+1.54943476*e^(-677.0138344*t))^(131537/203808));
convert(f(t),rational)

Copied the integrand to Mathematica and it gives