Adri van der Meer

Adri vanderMeer

1350 Reputation

18 Badges

14 years, 244 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 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

If you want i to be a genuine local variable, put it in a procedure:

i := something:
f := proc()
  local i;
  for i to 4 do print(i^2) end do
end proc:
f();
                               1
                               4
                               9
                               16
i;
                           something

simplify(DC,zero);

seq(abs(g[i]), i=1..nops([g])) assuming positive;

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