Christian Wolinski

MaplePrimes Activity


These are answers submitted by Christian Wolinski

Please post code in text or worksheet form, rather than printouts.

  restart;
  P := -lambda*exp(-Phi(xi)) - mu*exp(Phi(xi));
  u[0] := A[0] + A[1]*exp(-Phi(xi)) + A[2]*exp(-Phi(xi))*exp(-Phi(xi));
  u[1] := diff(u[0], xi);
  d[1] := -A[1]*P*exp(-Phi(xi)) - 2*A[2]*(exp(-Phi(xi)))^2*P;
  u[2] := diff(d[1], xi);
  d[2] := -A[1]*(lambda*P*exp(-Phi(xi)) - mu*P*exp(Phi(xi)))*exp(-Phi(xi))
   + A[1]*(-lambda*exp(-Phi(xi)) - mu*exp(Phi(xi)))*P*exp(-Phi(xi))
   + 4*A[2]*(exp(-Phi(xi)))^2*(-lambda*exp(-Phi(xi)) - mu*exp(Phi(xi)))*P
   - 2*A[2]*(exp(-Phi(xi)))^2*(lambda*P*exp(-Phi(xi)) - mu*P*exp(Phi(xi)));
  collect(
  expand(2*k*k*w*beta*d[2] - 2*alpha*k*k*d[1] - 2*w*u[0] + k*u[0]*u[0]), 
  exp(Phi(xi)));

  restart;
  solve({12*beta*k^2*lambda^2*w*A[2] + k*A[2]^2, 
  4*beta*k^2*lambda^2*w*A[1] - 4*alpha*k^2*lambda*A[2] + 2*k*A[1]*A[2], 
  4*beta*k^2*mu^2*w*A[2] - 2*alpha*k^2*mu*A[1] + k*A[0]^2 - 2*w*A[0], 
  4*beta*k^2*lambda*mu*w*A[1] - 4*alpha*k^2*mu*A[2] + 2*k*A[0]*A[1] - 2*w*A[1], 16*beta*
  k^2*lambda*mu*w*A[2] - 2*alpha*k^2*lambda*A[1] + 2*k*A[0]*A[2] + k*A[1]^2
   - 2*w*A[2]}, {A[0], A[1], A[2], k, w});
  set__1;
  {A[0] = (RootOf(100*_Z^2*lambda*mu + 1)*alpha)/(2*beta*RootOf(24*_Z^2*beta*
  lambda*mu - 1)), 
  A[1] = (alpha)/(10*beta*mu*RootOf(24*_Z^2*beta*lambda*mu - 1)), A[2] = -12*
  RootOf(24*_Z^2*beta*lambda*mu - 1)*lambda^2*RootOf(100*_Z^2*lambda*mu + 1)*
  alpha, k = RootOf(24*_Z^2*beta*lambda*mu - 1), 
  w = (RootOf(100*_Z^2*lambda*mu + 1)*alpha)/(beta)};

  restart;
  solve({24*Z^2*beta*lambda*mu - 1}, {Z});
  solve({100*Z^2*lambda*mu + 1}, {Z});

  restart;
  k := (sqrt(6))/(12*sqrt(beta*lambda*mu));
  w := - (alpha)/(10*sqrt(-lambda*mu)*beta);
  A[0] := - (3*alpha*sqrt(beta*lambda*mu))/(5*sqrt(-lambda*mu)*beta*sqrt(6));
  A[1] := (6*alpha*sqrt(beta*lambda*mu))/(5*beta*mu*sqrt(6));
  A[2] := (sqrt(6)*lambda^2*alpha)/(10*sqrt(beta*lambda*mu)*sqrt(-lambda*mu));
  lambda := 3;
  mu := 2;
  H := -ln(sqrt((lambda)/(mu))*tan(sqrt(lambda*mu)*(xi + C)));
  u[0] := A[0] + A[1]*exp(-H) + A[2]*exp(-H)*exp(-H);
  f := diff(u[0], xi);
  S := diff(f, xi);
  eq := 2*k*k*w*beta*S - 2*alpha*k*k*f - 2*w*u[0] + k*u[0]*u[0];
  value(%);
  simplify(%);

I think you can identify the tick values yourself. Instead of using integer values maybe convert them to string first?

This is not a problem with seq, but a problem with dsolve result. It is apparent it contains the original variable t, which is later affected. Use this for fix:
my_x:=subs(t=_t, eval(x, dsol));

Thumb if You like.

The condition is always satisifed.

vars:=[x,y,z];
for invars in vars do
[cat(invars, 1..nops(vars))]
end do;

or

for invars in vars do
[(n->n||(1..nops(vars)))(invars)]
end do;

or

(n->n||(1..nops(vars)))~(vars) 

Thumb if You like.

I think you want to do this:

map(proc(P, V)
   local c, C, v;
   coeffs(P, V, 'c');
   [seq([seq(type(C, dependent(v)), v = V)], C = [c])];
end proc, eq, incog);
subs([true = 1, false = 0], %);

#also
Matrix(map(op, %));


Thumb if You like.

 

That should be

f:=unapply(3*x+2, x);
g:=D(f);
g(3);

Thumb if You like.

Your vectors are always linearly dependent:

Matrix([[cos+I*sin, 1], [1, cos-I*sin]](t));
map(expand@convert, %, exp);
simplify(LinearAlgebra:-Determinant(%));

Thumb if You like.

Look under
?plot, options
?plot3d, options

Search for transparency

I wonder if the following is correct. This is the second formula:
 

T0 := proc(a, d) 1 - exp(-d*a^2) + 1/3*d*(2*a^3 - 3*a^2 + 1) end proc;
T1 := proc(d) if d <= 0 then 1 - exp(-d) else 1/3*d end if; end proc;
T2 := proc(d)
  if evalf(d < 3 + LambertW(-3*exp(-3))) then 1/3*d else 1 - exp(-d) end if;
end proc;
T3 := proc(d)
  map(T0, [Re(evalf(RootOf(exp(-d*_Z^2) + _Z - 1, (1)/(d) .. (2*LambertW(-1, - 1/2*exp((-1)/2)) + 1)/(2*LambertW(-1, - 1/2*exp((-1)/2)))
  ))), Re(evalf(RootOf(exp(-d*_Z^2) + _Z - 1, (2*LambertW(-1, - 1/2*exp((-1)/2)) + 1)/(2*LambertW(-1, - 1/2*exp((-1)/2))) .. 
  1)))], d);
  min(op(%));
end proc;
T4 := proc(d)
  if evalf(d < - (2*LambertW(-1, - 1/2*exp((-1)/2))^2)/(2*LambertW(-1, - 1/2*exp((-1)/2)) + 1)
    ) then
    T1(d)
  else
    min(T2(d), T3(d))
  end if;
end proc;

plot(T4,  2..5);
plot(T4,  -2..3);

#The above is
expr := exp(-d*a^2) - 1/3*d*(2*a^3 - 3*a^2 + 1);
sought := 1 - max(expr);
expr := 1 - expr;
sought := min(expr);
#where 0<=a<=1

Thumb if You like

For infinum you can use minimize:

minimize(exp(a*(d-1)), a = 0..1);
convert(1-minimize(exp(d*(a-1)), a = 0..1), piecewise, d);
plot(%, d = -2..2, thickness = 2);

 

Thumb if You like.

@mschneider What you've found is not a fix. The correct response in this situation is to use fnormal. For example:

a := exp(2);
b := (exp(1))^2;

for i to 25 do
precision := 10+i:
a-b=fnormal(evalf(a-b));
end do;

or

K:=2;
answer := 5*exp(7.5*t);
response := subs(a = exp(1), 5*a^(7.5*t));
a := evalf(subs(t = Pi, answer),Digits+K);
b := evalf(subs(t = Pi, response), Digits+K);
fnormal(a-b, Digits);

Thumb if You like.

Your low Digits settings is incurring this significant error. Increase it to 25.


  H := (-lambda + sqrt(-Omega)*{tan(sqrt(-Omega)*xi) + sec(sqrt(-Omega)*xi)})/(2*v - 2);
#should be 
  H := (-lambda + sqrt(-Omega)*(tan(sqrt(-Omega)*xi) + sec(sqrt(-Omega)*xi)))/(2*v - 2);

Thumb if You like.

Replace output='Q' with output=':-Q'.


Thumb if You like.

First 10 11 12 13 14 15 16 Last Page 12 of 22