Adri van der Meer

Adri vanderMeer

1400 Reputation

19 Badges

18 years, 300 days
University of Twente (retired)
Enschede, Netherlands

My "website" consists of a Maple Manual in Dutch

MaplePrimes Activity

These are answers submitted by Adri van der Meer

The exponential function a^b is defined as exp(b*ln(a)). If a<0, than ln(a) is the multi-valued complex function ln(-a)+πi+2kπi. You can find these by using the option allsolutions:



s := solve(diff(-1/x,x) = (-1/x)^(b), b, allsolutions);







For the second equation there seems do be no solution independent of x.

You may define the vectorfield [0,0] outside the ellipse:

restart; with(plots):

f := (x,y) -> if x^2+y^2/2 <= 1 then x^2+y^2 else 0 end if:

g := (x,y) -> if x^2+y^2/2 <= 1 then x+y else 0 end if:

fieldplot( [f,g], -1.5..1.5,-1.5..1.5, arrows=slim );






I suppose that you want to plot a parametrized surface, that is a list [x(u,v),y(u,v),z(u,v)].
This van be done ad follows:


S := (u,v) -> 10*u^2*v+20*u*v+15:

p:= proc(u,v) if u<v then S(u,v) else S(u,v)+10 end if end proc:

plot3d([40*u,80*v,'p(u, v)'], u = 0 .. 1, v = 0 .. 2*u); #use quotes to prevent premature evaluation





The inverse of unapply is apply. You have to provide a name for the independent variable:


a:=x -> x^2+sin(x);

proc (x) options operator, arrow; x^2+sin(x) end proc


b := apply(a,t);



or, simpler:

b := a(t);




First condition: F(exp(t)) = t, so F in the inverse of exp, that is F(t) = ln(t).

But ln(ln(exp(t))) = ln(t) ≠ 0

(1) Make vectors A := <2,-3,a>: etc.

(2) A is perpedicular on B and C , so A.B=0 and A.C=0. These are two equations in in the unknown a,b,c.

(3) Make the third equation and solve.

I suppose that you mean: y(t)=y'(t)=0 for all t<0. This can be implemented bij setting the initial condition at an arbitrary t<0:



eq := diff(y(t),t,t) + 9*y(t) = Dirac(t):

icon := y(-1)=0, D(y)(-1)=0:

dsolve( {eq,icon}, y(t) );

y(t) = (1/3)*Heaviside(t)*sin(3*t)


dsolve( {eq,icon}, y(t), method=laplace );

y(t) = (1/3)*Heaviside(t)*sin(3*t)



The second solution that Maple gives uses:

int(Dirac(t),t=0..infinity );





In the Optimization package you must use Maximize (capital M).

I suppose you want theta[1] and theta[2] in terms of p. Then there are only the trivial solutions (multiples of Pi):

evalc((M1.M2)(1,1)):  PP := evalc(Re(%)) assuming 0<p ,p<1:

             {theta[1] = Pi _Z2, theta[2] = Pi _Z1}


Use an auxiliary variable:

esp1 := -a^4+a^2*c^2:


You could make a procedure that rejects zero polynomials:

f := proc(x::evaln)
  local q:
  q := randpoly(x, dense, degree = 1, coeffs = rand(-2 .. 2)):
  if q=0 then f(x) else return q end if
end proc;

If you need a polynomial with only non-zero coefficients:

f := proc(x::evaln)
  local q:
  q := randpoly(x, dense, degree = 1, coeffs = rand(-2 .. 2)):
  if nops([coeffs(q)])=2 then return q else f(x) end if
end proc;


subs((D(f)) = (t -> 1-t), Ex1): expand(%);

I wonder why

expand(subs((D(f)) = (t -> 1-t), Ex1));

doesn't work.


Or use:

eval(Ex1,(D(f)) = (t -> 1-t));

if IT<20 then               
  if ZUM<(0.1)^(8) then IT=20             
    for i from 1 to 10 do YU[i]:=U[i] od;    
    for i from 2 to 9 do DU1:=YU[i+1]- YU[i-1] od:      
  end if;    
end if;


If you want to go on and extract the 3rd solution (number only), you could simply do:

sol:=solve([sin(t), 0 < t, t < 8*Pi], t, allsolutions, explicit):
subs( sol[3], t );

Use pi := 0.45;, because the constant π is represented as Pi (with capital P).

If you only need a sequence of position numbers:

L := [x,z,y]:
seq( ListTools:-Search(k,L), k=[x,y,z] );
                            1, 3, 2

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