Preben Alsholm

13471 Reputation

22 Badges

20 years, 214 days

MaplePrimes Activity


These are answers submitted by Preben Alsholm

Go to the Program Files/Maple 14/ETC. Copy the files in that folder and put them where you got your tex-file.

 

Instead of using `` as suggested by pagan you could use the inert operator &* in the following way.

restart;

#Defining FactorOut:
FactorOut:=proc(u::algebraic,d::algebraic,f::{procedure,name}:=expand,{force::boolean:=false}) local u1;
     u1:=u/d;
     if force then d&*f(u1) else d*f(u1) end if
end proc:

#Extending value:
`value/&*`:=proc() `*`(args) end proc:

F:=1 + Q*x^2 + P*x^3;
FactorOut(F,x^2/L^2);
FactorOut(F,x^2/L^2,force);
FactorOut(F,6,force);
value(%);

By default f is the procedure expand, but the optional third argument could be another procedure.

Similarly I have used an extended version of value for inert matrix multiplication &. in linear algebra.

You want Maple to say that x = 2 when there is no solution? Why not x = 3?

eq:=(x-1)/(2*(x-2)) = 2/(x^2-4)+1/2:
normal((lhs-rhs)(eq))=0;
normal(eq*(x-2));
solve(%,x);

normal(eq*(x-3));
solve(%,x);

Here are a few ways.

eq:=diff(z(t),t,t)=-sin(z(t))-cos(t):

#Output default = procedurelist:

sol:=dsolve({eq,z(0)=0,D(z)(0)=0},numeric):
sol(7);
subs(sol(7),z(t));
#Make a function:
X:=s->rhs(sol(s)[2]);
X(7);
#Alternative method
X:=s->subs(sol(s),z(t));
X(7);
#My preferred output is listprocedure:
sol2:=dsolve({eq,z(0)=0,D(z)(0)=0},numeric,output=listprocedure);
X:=subs(sol2,z(t));
X(7);
plot(X,0...50);

The answer is no!

And by the way, who says that k is real?

Try experimenting with this:

solve(randpoly(x)=0,x):
evalf(%);

and you will find that the answer is no.

#mylist[3] refers to the third element of the list mylist, thus in your second example mylist[3] is 25.

mylist:=[1,2,25]:

#Your do loop could run like this:

for x in mylist do convert(x,binary) end do;

                               1
                               10
                             11001

#or like this:

for x from 1 to nops(mylist) do convert(mylist[x],binary) end do;

# Using map instead:

map(convert,mylist,binary);
                         [1, 10, 11001]

#Using elementwise operation (Maple 13 and 14):

convert~(mylist,binary);
                         [1, 10, 11001]


 

If you want to avoid using the LinearAlgebra package (RowOperation and ColumnOperation) you can use elementwise multiplication *~ (introduced in Maple 13):

restart;
A:=Matrix(3,4,symbol=a):
A[1]:=s*~A[1];
A;
A[1..3,2]:=t*~A[1..3,2];
A;

This way A is changed, however.

From the plottools help page:

"Because most plottools commands produce a single plot object such as a curve rather than a complete plot, the options accepted are limited to those applicable to the object.  Examples are color, linestyle and transparency.  Options that affect an entire plot, such as axes or title, are ignored."

I think this goes for coords=polar as well.

# Assuming that the outout has the form {x = 60., y = 40.};
subs(%,[x,y]);
plot([%],style=point,symbol=solidcircle,symbolsize=20);

Another solution.

L:=[[name,4,3,6,5],[3,5,name],[3,6,1,2,9,8]] :
eval(L,name=NULL);
           [[4, 3, 6, 5], [3, 5], [3, 6, 1, 2, 9, 8]]
eval(L,3=NULL);
         [[name, 4, 6, 5], [5, name], [6, 1, 2, 9, 8]]

The short answer is yes.

You should really use 'Matrix' instead of 'matrix'.

To retain a copy of the matrix a use LinearAlgebra:-Copy.

restart;
a := Matrix(2, 2, [1, 2, 3, 4]);
b := a;
c:=LinearAlgebra:-Copy(a);
for i to 2 do for j to 2 do b[i, j] := (1/3)*b[i, j] end do end do;
b;
a;
c;

In the standard interface for Maple in Tools/Options/Display/Input display (in the Windows version), you find a choice between Maple Notation and 2-D Math Notation.

Presumably, by "Maple 1-D expressions" is meant Maple Notation.

The term "Maple Notation" is also somewhat odd. However, it just means using ordinary text input (or output), like

int( x^2, x=0..sqrt(2))

I should add that I don't know anything about MapleNET.

There has been a change from Maple 13 to 14 in that area:

Maple 14:

seq(time(plot(csc(k*x), x = 0 .. 2*Pi, -3 .. 3, discont = true)), k = 1 .. 6);
          0.078, 0.046, 17.706, 0.078, 0.093, 106.080

and now with usefdiscont=true (new in Maple 14):

seq(time(plot(csc(k*x), x = 0 .. 2*Pi, -3 .. 3, discont = true,usefdiscont=true)), k = 1 .. 6);
            0.015, 0.078, 0.031, 0.046, 0.093, 0.093

Maple 13:

seq(time(plot(csc(k*x), x = 0 .. 2*Pi, -3 .. 3, discont = true)), k = 1 .. 6);
                  0.031, 0.015, 0.046, 0.046, 0.046, 0.031

It seems that the problem with Maple 14 is the introduction of the new feature, showremovable=true/false.

Have you looked at the CurveFitting package?

Doesn't this work:

plot([sin,cos],0..Pi,legend=[sin,cos],legendstyle = [font = ["HELVETICA", 9], location = right]);

It works on my Maple 14.

First 149 150 151 152 153 154 155 Page 151 of 158