Preben Alsholm

13728 Reputation

22 Badges

20 years, 241 days

MaplePrimes Activity


These are answers submitted by Preben Alsholm

Use plotsetup.

Example:

plotsetup(bmp,plotoutput="F:/testplot.bmp",plotoptions="height=100,width=400");
plot(sin(x),x=-Pi..Pi);

I would stay away from indexed variables, unless you insist. The problem is that the simultaneous use of e.g. C and C[a] can confuse Maple quite a lot. Not to speak of D, which has a special meaning as you see:

(Did you mean the equation to be third order or second order in z?)

De*diff(Ca(z,t),z$2)-lambda*R*K-S=0;

BC:= Ca(0,t)=C, D[1](Ca)(-z0,t)=0;

product((k+a)*(k+b)/((k+c)*(k+a+b-c)), k = 1 .. infinity) assuming a > 0, b > 0, c > 0, c<a+b;

Answer: GAMMA(c+1)*GAMMA(a+b-c+1)/(GAMMA(a+1)*GAMMA(b+1))

eqs:={y= 2*x^2-5*x+ 3, y= x^3 + 4*x -3};
solve(eqs,{x,y},explicit);
evalf(%);

Numerical solution:

fsolve(eqs,{x,y});

I see no difference in Maple 12 (or 14) for the V you posted:

V:=Matrix([[0.2412702414,0.4868267037+4.770943828* 10^(-17)* I,-0.3582351644-3.597026404* 10^(-14)* I,0.8897131421,0.3035225208,0.2809455226],[0.5973344699,-1.205280722,1.019534434+1.083003890* 10^(-16) *I,0.3180937441* I,1.086504807,0.8732682510],[0.2412702414,0.4868267037+4.770943828 *10^(-17)* I,-1.684358576,-0.05461705659,0.3035225208,1.541076357],[513.8528507 *I,-1036.834415 *I,902.2703878 *I,1198.784852,265.8824916 *I,22.70515338 *I],[5282.465108 *I,10658.77442 *I,-9122.190610 *I,240.7412056 *I,-1264.792778 *I,-1175.059018 *I],[3753.443600 *I,-7573.567988 *I,25898.97068 *I,-9.080952395,-972.5394523 *I,-4271.851836 *I]]);
LinearAlgebra:-Determinant(V,method=float);
LinearAlgebra:-Determinant(V,method=minor);
LinearAlgebra:-Determinant(V);

In Maple 12 the answer is 1.541660422*10^11+1.601362493*10^11*I for the float version (and for the version where Maple decides  itself). For the minor version the answer is 1.541660423*10^11+1.601362493*10^11*I.

So except for some slight roundoff effect there is no difference.

Unless you have a reason to ask for a particular method, I would let Maple decide (as in the last version).

To check signs I looked at the possibility of a stationary solution:

bc:={D(Temp)(0)=sigma*(Temp(0)^4-T1^4)/K, D(Temp)(d)=-sigma*(Temp(d)^4-T2^4)/K};
ode:=K*diff(Temp(z),z,z)=0;
res:=dsolve({ode} union bc,numeric);
plots:-odeplot(res,[z,Temp(z)],0..1);

I guess that the plot is what you expected. I don't know what is going on in the solution of the pde.

But are your boundary conditions correct, physically?

Don't use with( package) in a procedure (compv). Use long names (package:-proc, or package[proc]), or the statement

uses package;

There is a colon in NeighborsV that is rather strange:

`union(`union`({Neighbors(G, u)[]}, {Neighbors(G, v)[]}):, {u,v})

(and why not only one `union`?)

You may try this homemade procedure, RemoveAllAssumptions:

restart;
RemoveAllAssumptions:=proc() local A,Ls,L,Lc,indx;
Ls:=map(convert,[anames('user')],string);
L:=ListTools:-Enumerate([anames('user')]);
Lc:=select(hastype,eval(L),`local`);
if Lc=[] then NULL
else
   indx:=map2(op,1,Lc);
   A:=[seq(Ls[i],i=indx)];
   unassign(op(map(parse,A)));
end if
end proc:

assume(a>0,b::real,c::posint);
about(a,b,c);
d:=87: e:=2+3*I: f:=x^2:

RemoveAllAssumptions();
about(a,b,c);
d,e,f;

However, I almost never use 'assume'. I use 'assuming' instead.

It seems that your problem is that you assign the plot to a variable p1. Nothing wrong with that, and often a good idea.

But then the plot is not shown, but the result of the assignment is, i.e. p1:=PLOT(...).

PLOT(...) contains the data for the plot, try e.g. lprint(p1);

Just mentioning p1, like p1; will print the plot. Alone or with other plots p2, p3, .. you can use display(p1,p2, ..); (from the plots-package).

The same happens here:

p1:=plot(sin(x),x=0..2*Pi);
p1;

@hirnyk

Since sqrt(z1)*sqrt(z2)/sqrt(z1*z2) is not necessarily equal to one (take z1 = z2 = -1) it is good to be cautious.

Maple is in this case (when as hirnyk points out 'symbolic' is not used).

So assumptions help as also hirnyk points out:

a:= (2*x-1)/sqrt(1-4*x^2); b:=sqrt(1-2*x)/sqrt(1+2*x);
combine(a/b,radical) assuming x>1/2;
combine(a/b,radical) assuming x<-1/2;
simplify(%);
combine(a/b,radical) assuming x>-1/2,x<1/2;
simplify(%);

Now even when x is complex the result is -1, but that is not obvious (or is it?).

What you need is some understanding of chemistry, I guess.

Why do you expect to find it here?

When I commented that I didn't have a problem I executed both of your plots without a restart in between.

I do indeed have a problem if I only execute the latter plot command (the one with typeset).

The following works. Execute the whole thing.

restart;
with(plots):
plotsetup('bmp', 'plotoutput' = "F://try2.bmp");
plot(0,0..1);
pointplot([seq([i,i^2],i=1..100)],legend=typeset(F[u]));


There is a syntax error in ICs. It is D(x)(0) (not Dx(0)).

But it is worse:

eq := diff(x(t), t,t)+326.1*diff(x(t),t)+3190*diff(x(t),t)^2-37500*sqrt(x(t)*(0.165e-2-x(t)))+2.825=0;

ICs := x(0)=0, D(x)(0)=0;

sol := dsolve({ICs, eq}, numeric);

Initially x''(0) = -2.825. Thus x'(t) should decrease initially from x'(0) = 0. Thus x(t) shoul decrease from x(0) = 0. But the square root will then be imaginary.

Are you trying to plot the graph of a function of 3 variables? Not quite possible, right?

Of course you can easily plot f = exp(-(r-4)^2/4) as a function of just r.

I believe I never heard of a procedure 'sphericalplot'.

For the fun of it you could try this (where the idea of introducing z_cylindrical can be found in the help:

?plot3d,coords

f:=exp(-(r-4)^2/4):
addcoords(z_cylindrical,[z,r,theta],[r*cos(theta),r*sin(theta),z]);
plot3d(f,r=0..10,theta=0..2*Pi,coords=z_cylindrical,axes=boxed);

Maybe 'indets' can do what you want.

If you provided an example more detail could be given.

First 145 146 147 148 149 150 151 Last Page 147 of 160