Robert Israel

6582 Reputation

21 Badges

19 years, 52 days
University of British Columbia
Associate Professor Emeritus
North York, Ontario, Canada

MaplePrimes Activity


These are replies submitted by Robert Israel

What exactly do you mean by "it"?

Sorry about leaving that out:

newBCs := {F(0) = 0, T(10) = 0, D(F)(0) = 0, D(F)(10) = 0, D(T)(0) = -lambda};

Note that for lambda = 1 this gives the original boundary condition D(T)(0) = -1.  With D(T)(0) = lambda, as omabbasi tried, it would be attempting to solve the equation with D(T)(0) = 1.  I'm guessing that that BVP may not have a solution.

Sorry about leaving that out:

newBCs := {F(0) = 0, T(10) = 0, D(F)(0) = 0, D(F)(10) = 0, D(T)(0) = -lambda};

Note that for lambda = 1 this gives the original boundary condition D(T)(0) = -1.  With D(T)(0) = lambda, as omabbasi tried, it would be attempting to solve the equation with D(T)(0) = 1.  I'm guessing that that BVP may not have a solution.

I assume desp is talking about the ring Z[sqrt(7)], not a field.  PolynomialIdeals is for polynomial ideals over a field, so this won't help.
 

What will work is

> numtheory[factorEQ](30, 7);

``(-8+3*7^(1/2))*``(3+7^(1/2))^2*``(2+7^(1/2))*``(2-7^(1/2))*``(5)

 

I assume desp is talking about the ring Z[sqrt(7)], not a field.  PolynomialIdeals is for polynomial ideals over a field, so this won't help.
 

What will work is

> numtheory[factorEQ](30, 7);

``(-8+3*7^(1/2))*``(3+7^(1/2))^2*``(2+7^(1/2))*``(2-7^(1/2))*``(5)

 

I agree that it's better to use maximize or Optimization:-Maximize if those work.  The trouble is that they might not always work.  The plot, while far from perfect, is a rough-and-ready resource.   For example:

> g:= x*sum(i^(-5/2)*exp(-i*x),i=1..infinity);
> maximize(g,x=0..2,location);

maximize(x*sum(1/i^(5/2)*exp(-i*x),i = 1 .. infinity),x = 0 .. 2,location),{}

> Optimization:-Maximize(g,x=0..2);

Error, (in Optimization:-NLPSolve) summation variable previously assigned, second argument evaluates to 1. = 1 .. infinity
 

(Yes, a bug, which I'll report)

> Optimization:-Maximize(g,x=0..2,method=branchandbound);

Error, (in Optimization:-NLPSolve) method=branchandbound option is available for univariate unconstrained bounded problems only

(Possibly a different bug)

> plot(g, x = 0 .. 2);

> A:= op([1,1],%):
   maxvalue:= max(map2(op,2,A));

maxvalue := .3971541099

> select(has, A, maxvalue);

[[.9172052292, .3971541099]]

The y value is pretty close to the true maximum, I think; the x value is very rough, but further refinement is possible.

I agree that it's better to use maximize or Optimization:-Maximize if those work.  The trouble is that they might not always work.  The plot, while far from perfect, is a rough-and-ready resource.   For example:

> g:= x*sum(i^(-5/2)*exp(-i*x),i=1..infinity);
> maximize(g,x=0..2,location);

maximize(x*sum(1/i^(5/2)*exp(-i*x),i = 1 .. infinity),x = 0 .. 2,location),{}

> Optimization:-Maximize(g,x=0..2);

Error, (in Optimization:-NLPSolve) summation variable previously assigned, second argument evaluates to 1. = 1 .. infinity
 

(Yes, a bug, which I'll report)

> Optimization:-Maximize(g,x=0..2,method=branchandbound);

Error, (in Optimization:-NLPSolve) method=branchandbound option is available for univariate unconstrained bounded problems only

(Possibly a different bug)

> plot(g, x = 0 .. 2);

> A:= op([1,1],%):
   maxvalue:= max(map2(op,2,A));

maxvalue := .3971541099

> select(has, A, maxvalue);

[[.9172052292, .3971541099]]

The y value is pretty close to the true maximum, I think; the x value is very rough, but further refinement is possible.

OddEven := L -> [seq([L[],1$-(-1)^nops(L),L[2..-1][]][2*i-1],i=1..nops(L))];
OddEven := L -> [seq([L[],1$-(-1)^nops(L),L[2..-1][]][2*i-1],i=1..nops(L))];

A bit less elegant?:


OddEven := L -> [seq([L[],op(select(type,{nops(L)},odd)),L[2..-1][]][2*i-1],i=1..nops(L))];

A bit less elegant?:


OddEven := L -> [seq([L[],op(select(type,{nops(L)},odd)),L[2..-1][]][2*i-1],i=1..nops(L))];

The first method doesn't work correctly unless the length of the integer is divisible by 3.

> f(1234);

     [123, 4]

I would do it this way:

> h := n -> ListTools[Reverse](convert(n,base,1000));
> h(1234567890);

  [1, 234, 567, 890]

The first method doesn't work correctly unless the length of the integer is divisible by 3.

> f(1234);

     [123, 4]

I would do it this way:

> h := n -> ListTools[Reverse](convert(n,base,1000));
> h(1234567890);

  [1, 234, 567, 890]

The add and mul functions were introduced in Maple V Release 4: see the help page ?updatesR4,language.  I'm sure convert(...,`+`) goes way back, long before I became involved with Maple.  It's mentioned in the Maple V Library Reference Manual (that's for Maple V Release 1, copyright 1991)

The add and mul functions were introduced in Maple V Release 4: see the help page ?updatesR4,language.  I'm sure convert(...,`+`) goes way back, long before I became involved with Maple.  It's mentioned in the Maple V Library Reference Manual (that's for Maple V Release 1, copyright 1991)

First 113 114 115 116 117 118 119 Last Page 115 of 187