Robert Israel

6577 Reputation

21 Badges

18 years, 211 days
University of British Columbia
Associate Professor Emeritus
North York, Ontario, Canada

MaplePrimes Activity


These are replies submitted by Robert Israel

The first thing you should know is that assigning a value to a variable removes any previous assumptions on that variable. 

I'm not sure why about(P) doesn't work here.  But Maple really does know that P < 0.  For example:

> restart;
   assume(g > 0);
   P:= -g;
   signum(P);
                       -1

 

> rationalize( -1/((z+1+I)*(-z-1+I)));

1/(z^2+2*z+2)

> rationalize( -1/((z+1+I)*(-z-1+I)));

1/(z^2+2*z+2)

In this case, one solution is _Z = 0.  However, that doesn't work for your system of equations, because you'd have d -> infinity.  There don't seem to be any other real solutions.

In this case, one solution is _Z = 0.  However, that doesn't work for your system of equations, because you'd have d -> infinity.  There don't seem to be any other real solutions.

Velocity (as the term is usually used in physics) is a vector quantity.  The magnitude of the velocity is the speed

Velocity (as the term is usually used in physics) is a vector quantity.  The magnitude of the velocity is the speed

There is no way that collect would produce a result containing lists unless lists were present in the input.  So you should take a closer look at your La.

There is no way that collect would produce a result containing lists unless lists were present in the input.  So you should take a closer look at your La.

Actually it seems to be wrong except for _Z2 = -1 or 1.  Branch cut problems.

> eq:= -ln(1-x)/x-x+2 = 0;
   shouldbe := eval(eq, x = solve(eq, x, AllSolutions));
   [seq(evalf[20](traperror(eval(shouldbe,_Z2=j))), j=-10 .. 10)];
[5.2049707240995594251-3.7706064121630124956*I = 0., 
-2.6326734703584719931+3.2723319236118533566*I = 0., 
4.8099687621160570724-3.3314463279425902525*I = 0., 
-2.1700228302109924482+2.7751195944259940559*I = 0., 
4.3691885969554688280-2.8259690272781035975*I = 0., 
-1.6290579922541131780+2.1807825380228797609*I = 0., 
3.8635721553217173198-2.2109953536872775992*I = 0., 
-.9522458026752997077+1.3999135424388421580*I = 0., 
3.2687987773813298909-1.3612997717890983965*I = 0., 
.1e-18+.9e-19*I = 0., 
"numeric exception: division by zero", 
.1e-18-.9e-19*I = 0., 
3.2687987773813298909+1.3612997717890983965*I = 0., 
-.9522458026752997077-1.3999135424388421580*I = 0., 
3.8635721553217173198+2.2109953536872775992*I = 0., 
-1.6290579922541131780-2.1807825380228797609*I = 0., 
4.3691885969554688280+2.8259690272781035975*I = 0., 
-2.1700228302109924482-2.7751195944259940559*I = 0., 
4.8099687621160570724+3.3314463279425902525*I = 0., 
-2.6326734703584719931-3.2723319236118533566*I = 0., 
5.2049707240995594251+3.7706064121630124956*I = 0.]

 The situation seems to be this.  Multiply eq by x, and take the exponential of both sides, you get

exp(-x^2+2*x)/(1-x) = 1

What Maple returned was the general solution of this equation.  However, when you go back to the original, for _Z2 = 0 you get a division by 0 error, while for _Z2 >= 2 or <= -2 you would need to use a non-principal branch of the logarithm to make it work.

 

It works for me.  For example:

> resizeit:= proc()
   local s,f;
   s:= Maplets:-Tools:-Get('TF2'::posint,corrections);
   f:= Maplets:-Tools:-Get('TF1'::algebraic,corrections);
   Maplets:-Tools:-Set(PL1('height')=s);
   Maplets:-Tools:-Set('PL1'=plot(f,x=0..10));
  end proc;
  maplet := Maplet([
    ["Enter a function of 'x':", TextField['TF1']("sin(x)")],
    Plotter['PL1']( plot(sin(x), x = 0..10),height=200,width=200 ),
    ["New size ",TextField['TF2']("200")],
    [
       Button("Plot", Evaluate('PL1' = 'plot(TF1, x = 0..10)') ),
       Button("Resize",Evaluate('function'="resizeit")),
       Button("OK", Shutdown(['TF2']))
    ]
   ]):

  Maplets[Display](maplet);

It works for me.  For example:

> resizeit:= proc()
   local s,f;
   s:= Maplets:-Tools:-Get('TF2'::posint,corrections);
   f:= Maplets:-Tools:-Get('TF1'::algebraic,corrections);
   Maplets:-Tools:-Set(PL1('height')=s);
   Maplets:-Tools:-Set('PL1'=plot(f,x=0..10));
  end proc;
  maplet := Maplet([
    ["Enter a function of 'x':", TextField['TF1']("sin(x)")],
    Plotter['PL1']( plot(sin(x), x = 0..10),height=200,width=200 ),
    ["New size ",TextField['TF2']("200")],
    [
       Button("Plot", Evaluate('PL1' = 'plot(TF1, x = 0..10)') ),
       Button("Resize",Evaluate('function'="resizeit")),
       Button("OK", Shutdown(['TF2']))
    ]
   ]):

  Maplets[Display](maplet);

I think you just have to replot after resizing.  For example:

> with(Maplets[Elements]):
 maplet := Maplet([
    ["Enter a function of 'x':", TextField['TF2d']("sin(x)")],
    Plotter['PL1']( plot(sin(x), x = 0..10),height=200,width=200 ),
    [
       Button("Plot", Evaluate('PL1' = 'plot(TF2d, x = 0..10)') ),
       Button("Shrink",Action(SetOption(PL1('height')=100),
                              Evaluate('PL1'='plot(TF2d, x = 0..10)'))),
       Button("OK", Shutdown(['TF2d']))
    ]
 ]):
 result := Maplets[Display](maplet);

However, if you want to expand the plot, you'll probably also have to expand the window it's in.  For example:

> maplet := Maplet(Window[W]([
    ["Enter a function of 'x':", TextField['TF2d']("sin(x)")],
    Plotter['PL1']( plot(sin(x), x = 0..10),height=200,width=200 ),
    [
       Button("Plot", Evaluate('PL1' = 'plot(TF2d, x = 0..10)') ),
       Button("Expand",Action(SetOption(W('height')=550),
                              SetOption(PL1('height')=400),
                              Evaluate('PL1'='plot(TF2d, x = 0..10)'))),
       Button("OK", Shutdown(['TF2d']))
    ]
 ])):
 result := Maplets[Display](maplet);

I think you just have to replot after resizing.  For example:

> with(Maplets[Elements]):
 maplet := Maplet([
    ["Enter a function of 'x':", TextField['TF2d']("sin(x)")],
    Plotter['PL1']( plot(sin(x), x = 0..10),height=200,width=200 ),
    [
       Button("Plot", Evaluate('PL1' = 'plot(TF2d, x = 0..10)') ),
       Button("Shrink",Action(SetOption(PL1('height')=100),
                              Evaluate('PL1'='plot(TF2d, x = 0..10)'))),
       Button("OK", Shutdown(['TF2d']))
    ]
 ]):
 result := Maplets[Display](maplet);

However, if you want to expand the plot, you'll probably also have to expand the window it's in.  For example:

> maplet := Maplet(Window[W]([
    ["Enter a function of 'x':", TextField['TF2d']("sin(x)")],
    Plotter['PL1']( plot(sin(x), x = 0..10),height=200,width=200 ),
    [
       Button("Plot", Evaluate('PL1' = 'plot(TF2d, x = 0..10)') ),
       Button("Expand",Action(SetOption(W('height')=550),
                              SetOption(PL1('height')=400),
                              Evaluate('PL1'='plot(TF2d, x = 0..10)'))),
       Button("OK", Shutdown(['TF2d']))
    ]
 ])):
 result := Maplets[Display](maplet);

Are you saying f(e) is quadratic in w?  So let f(e) =   A*w^2 + B*w + C.

> e := ((w-b)/b)^lambda;
  prof:= f(e) - w*L;
  prof1:= eval(prof, f(e) = A*w^2 + B*w + C);

Now you say the derivative of this wrt w is 0 at w = -b/(lambda - 1).

> eval(diff(prof1, w), w = -b/(lambda-1));

That being 0 gives you a relation between A and B, which you can solve for either of these, let's say for B.

> B0:= solve(%, B);

B0 := (2*A*b+L*lambda-L)/(lambda-1)

The maple tag is acting up again: that should be

    B0 := (2*A*b+L*lambda-L)/(lambda-1)

So now f(e) = A*w^2 + B0 * w + C.  Now.we can express w in terms of e.  But since I defined e as an expression in w, I'll use E instead.

> wE:= solve(e=E, w);

 

    wE := exp(ln(E)/lambda)*b+b

 

And then the function f is

> f(E) =  simplify(A*wE^2 + B0*wE + C);

f(E) = (A*b^2*E^(2/lambda)*lambda-A*b^2*E^(2/lambda)+2*A*b^2*E^(1/lambda)*lambda+A*b^2*lambda+A*b^2+b*L*lambda*E^(1/lambda)+b*L*lambda-b*L*E^(1/lambda)-b*L+C*lambda-C)/(lambda-1)

 

Is that what you had in mind?

First 68 69 70 71 72 73 74 Last Page 70 of 187