Robert Israel

6577 Reputation

21 Badges

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

MaplePrimes Activity


These are replies submitted by Robert Israel

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)

Are we using the same deq and ci?  What version of Maple are you using?

 deq := diff(x(t), t, t)+2*(diff(x(t), t))-5*x(t) = 0;
 ci := x(0) = 1, (D(x))(0) = -2;
 p:= dsolve({deq,ci},x(t),numeric, range=0..5, output= Array([0.1*j $ j=0..50]));
 

I tried several releases of Maple, and never got a warning.  In Maple 8 to Maple 10, something strange happened to the last row of the output:

> p[2,1][50..51, 1..3];

 [4.90000000000000034    359.488895369929650    521.075466325794764]
         [                                                                 ]
         [         ?                      ?                      ?         ]
 

In Maple 11 and 12, the result of this is

         [4.90000000000000034    359.488895369930104    521.075466325795332]
         [                                                                 ]
         [        5.             415.562142095951117    602.353062345626086]
 

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