Adri van der Meer

Adri vanderMeer

1420 Reputation

19 Badges

21 years, 154 days
University of Twente (retired)
Enschede, Netherlands

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:

 

restart;

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

2*(I*Pi*_Z1-ln(x))/ln(-1/x)

(1)

simplify(eval(s,_Z1=1),symbolic);

2

(2)

 

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:

restart;

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

 

 


 

Download SubSurface.mw

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

(1)

b := apply(a,t);

t^2+sin(t)

(2)

or, simpler:

b := a(t);

t^2+sin(t)

(3)

 

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:

 

restart;

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)

(1)

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

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

(2)

 

The second solution that Maple gives uses:

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

1/2

(1)

 

 

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:
solve({diff(PP,theta[1]),diff(PP,theta[2])},{theta[1],theta[2]},allsolutions);

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

 

Use an auxiliary variable:

esp1 := -a^4+a^2*c^2:
subs(q=a^2,factor(algsubs(a^2=q,esp1)));

 

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.

Edited:

Or use:

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

if IT<20 then               
  IT:=IT+1;     
  if ZUM<(0.1)^(8) then IT=20             
  else
    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;    
  ZUM:=U[1]-YU[1];  
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]:
ListTools:-Search(y,L);
                               3
seq( ListTools:-Search(k,L), k=[x,y,z] );
                            1, 3, 2

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