Pseudomodo

255 Reputation

8 Badges

14 years, 46 days

 

Istra balagina kish kish karia.

MaplePrimes Activity


These are replies submitted by Pseudomodo

The Online Help also has the What's New pages for Maple 16.

I look forward to looking through the new commands as well as the enhanced packages.

@Christopher2222 You could fprintf directly to a .txt file, and then print that.

Given what you wrote of the level of math needed, you could change

          (A>B or gcd(A,B)>1)

to

          (A>B and irem(A,B)=0)

@Christopher2222 You could fprintf directly to a .txt file, and then print that.

Given what you wrote of the level of math needed, you could change

          (A>B or gcd(A,B)>1)

to

          (A>B and irem(A,B)=0)

Another example can illustrate that (as presented so far) using `discrim` involves manual work (whether explicitly stated or written down, or performed mentally), which makes that use a lessautomated approach.

In this next example intervention is again required (not difficult, but necessary nonetheless) to figure exactly how to use `discrim` to get the right answer. I'm sure that the result from calling `solve` against `discrim` results could be further tuned and made more fully automatic, but that is not yet shown. And RootFinding:-Parametric provides some of the facilities to make that easier.

The question for this newly introduced example, is: for what values of parameter `m` does polynomial `p` have exactly 2 distinct roots?

with(RootFinding:-Parametric):

p:=(x^2+m*x+4)*(x^2-2*m*x+5*m-6):

Z:=CellDecomposition([p=0],[x],[m]):
Nsols:=NumberOfSolutions(Z):
Q:=[seq(CellDescription(Z,i),i=1..nops(Nsols))]:
for i from 1 to nops(Q) do
  if type(Q[i][1][4],polynom(rational,m)) and Q[i][1][5]<>0 then
    b[i]:=eval(m,(op(Q[i][1][5],[solve({Q[i][1][4]},Q[i][1][3])])));
  else b[i]:=Q[i][1][4];
  end if;
  if type(Q[i][1][1],polynom(rational,m)) and Q[i][1][2]<>0 then
    a[i]:=eval(m,(op(Q[i][1][2],[solve({Q[i][1][1]},Q[i][1][3])])));
  else a[i]:=Q[i][1][1];
  end if;
end do;

`or`(seq(`if`(Nsols[i][2] = 2, x>a[i] and x<b[i],NULL), i=1..nops(Q)));

              -4 < x and x < 2 or 3 < x and x < 4

And apart from the "= 2" to match exactly two solutions, the above is the same general code that might be used to determine ">= 3" solutions for the original question.

p:=(x-2)*(x^2-2*m*x+5*m-6):

Z:=CellDecomposition([p=0],[x],[m]):
Nsols:=NumberOfSolutions(Z):
Q:=[seq(CellDescription(Z,i),i=1..nops(Nsols))]:
for i from 1 to nops(Q) do
  if type(Q[i][1][4],polynom(rational,m)) and Q[i][1][5]<>0 then
    b[i]:=eval(m,(op(Q[i][1][5],[solve({Q[i][1][4]},Q[i][1][3])])));
  else b[i]:=Q[i][1][4];
  end if;
  if type(Q[i][1][1],polynom(rational,m)) and Q[i][1][2]<>0 then
    a[i]:=eval(m,(op(Q[i][1][2],[solve({Q[i][1][1]},Q[i][1][3])])));
  else a[i]:=Q[i][1][1];
  end if;
end do;

`or`(seq(`if`(Nsols[i][2] > = 3, x>a[i] and x<b[i],NULL), i=1..nops(Q)));

       -infinity < x and x < 2 or 3 < x and x < infinity

And once again, it is pretty easy to figure out, in your head, how to use `discrim` for this 2nd example as well. But that is not fully programmed, if some of the work is performed mentally and not all done via code.

Another example can illustrate that (as presented so far) using `discrim` involves manual work (whether explicitly stated or written down, or performed mentally), which makes that use a lessautomated approach.

In this next example intervention is again required (not difficult, but necessary nonetheless) to figure exactly how to use `discrim` to get the right answer. I'm sure that the result from calling `solve` against `discrim` results could be further tuned and made more fully automatic, but that is not yet shown. And RootFinding:-Parametric provides some of the facilities to make that easier.

The question for this newly introduced example, is: for what values of parameter `m` does polynomial `p` have exactly 2 distinct roots?

with(RootFinding:-Parametric):

p:=(x^2+m*x+4)*(x^2-2*m*x+5*m-6):

Z:=CellDecomposition([p=0],[x],[m]):
Nsols:=NumberOfSolutions(Z):
Q:=[seq(CellDescription(Z,i),i=1..nops(Nsols))]:
for i from 1 to nops(Q) do
  if type(Q[i][1][4],polynom(rational,m)) and Q[i][1][5]<>0 then
    b[i]:=eval(m,(op(Q[i][1][5],[solve({Q[i][1][4]},Q[i][1][3])])));
  else b[i]:=Q[i][1][4];
  end if;
  if type(Q[i][1][1],polynom(rational,m)) and Q[i][1][2]<>0 then
    a[i]:=eval(m,(op(Q[i][1][2],[solve({Q[i][1][1]},Q[i][1][3])])));
  else a[i]:=Q[i][1][1];
  end if;
end do;

`or`(seq(`if`(Nsols[i][2] = 2, x>a[i] and x<b[i],NULL), i=1..nops(Q)));

              -4 < x and x < 2 or 3 < x and x < 4

And apart from the "= 2" to match exactly two solutions, the above is the same general code that might be used to determine ">= 3" solutions for the original question.

p:=(x-2)*(x^2-2*m*x+5*m-6):

Z:=CellDecomposition([p=0],[x],[m]):
Nsols:=NumberOfSolutions(Z):
Q:=[seq(CellDescription(Z,i),i=1..nops(Nsols))]:
for i from 1 to nops(Q) do
  if type(Q[i][1][4],polynom(rational,m)) and Q[i][1][5]<>0 then
    b[i]:=eval(m,(op(Q[i][1][5],[solve({Q[i][1][4]},Q[i][1][3])])));
  else b[i]:=Q[i][1][4];
  end if;
  if type(Q[i][1][1],polynom(rational,m)) and Q[i][1][2]<>0 then
    a[i]:=eval(m,(op(Q[i][1][2],[solve({Q[i][1][1]},Q[i][1][3])])));
  else a[i]:=Q[i][1][1];
  end if;
end do;

`or`(seq(`if`(Nsols[i][2] > = 3, x>a[i] and x<b[i],NULL), i=1..nops(Q)));

       -infinity < x and x < 2 or 3 < x and x < infinity

And once again, it is pretty easy to figure out, in your head, how to use `discrim` for this 2nd example as well. But that is not fully programmed, if some of the work is performed mentally and not all done via code.

@Markiyan Hirnyk You make a false claim about my "solution", due to making a false interpretation. My point about doing it in your head is that some steps to a "solution" may be neither written down or coded. For this example, I wrote down only part of what I needed as a justification of the "answer". That was the point. It's a pity that you misunderstood that.

@Markiyan Hirnyk You make a false claim about my "solution", due to making a false interpretation. My point about doing it in your head is that some steps to a "solution" may be neither written down or coded. For this example, I wrote down only part of what I needed as a justification of the "answer". That was the point. It's a pity that you misunderstood that.

Of course, if you don't need it fully automatic then you could work it out by doing this in your head

solve(discrim( x^2 - 2*m*x + 5*m - 6, x )>0);

  RealRange(-infinity, Open(2)), RealRange(Open(3), infinity)

Of course, if you don't need it fully automatic then you could work it out by doing this in your head

solve(discrim( x^2 - 2*m*x + 5*m - 6, x )>0);

  RealRange(-infinity, Open(2)), RealRange(Open(3), infinity)

@serena88 You might want a wider or taller view than is necessary. But for your example you don't have to guess upper end of the `view`, or plot it twice to gauge, in order to have it match the upper ends of your points' domain and range.

 

plot(< theta/Pi | FSE/A >, style=point, view=[0..max(theta)/Pi, 0..max(FSE)/A]);

@serena88 You might want a wider or taller view than is necessary. But for your example you don't have to guess upper end of the `view`, or plot it twice to gauge, in order to have it match the upper ends of your points' domain and range.

 

plot(< theta/Pi | FSE/A >, style=point, view=[0..max(theta)/Pi, 0..max(FSE)/A]);

@Christopher2222 "So either no one knows how, or it can't be done." That implies that anyone who knew would answer. Not everyone reads this list. And someone who read it might know and still not answer.

It might well be impossible at present. But the fact that nobody has showed you how is insufficient grounds to conclude that.

@icegood Instead of "start /b <emac_path>" could you do something like "cmd /c start /b <emac_path>"?

@Christopher2222 

> with(StringTools):
> with(PatternDictionary):

> kernelopts(opaquemodules=false):
> showstat(StringTools:-PatternDictionary:-Create,3..3);

StringTools:-PatternDictionary:-Create := proc(dict::{list(string), identical(builtin), identical(ospd3)})
local _get, _search, _size, _free, did;
       ...
   3     if type(dict,{('identical')('builtin'), ('identical')('ospd3')}) then
           ...
         end if;
       ...
end proc


> bid1:= Create(`builtin`):
> Size(bid1)-1;
                             25950

> words1:= {seq}(Get(bid1,i),i=1..Size(bid1)-1):
> nops(words1);
                             25950

> bid2:= Create(`ospd3`):
> Size(bid2)-1;
                             80611

> words2:= {seq}(Get(bid2,i),i=1..Size(bid2)-1):
> nops(words2);
                             71378

> diff1:=words1 minus words2:
> nops(diff1);
                               0

> diff2:=words2 minus words1:
> nops(diff2);
                             45428

> member("acted",words1);
                             false

> member("acted",words2);
                              true

@TommySnowman Thanks for clearing that up. I misunderstood which you expected.

1 2 3 4 5 6 Page 2 of 6