longrob

Mr. Robert Long

1409 Reputation

18 Badges

15 years, 206 days
Leeds, United Kingdom

Social Networks and Content at Maplesoft.com

Business Consultant Data Scientist Statistician

MaplePrimes Activity


These are replies submitted by longrob

Just in case anyone happens to come to this thread with the same question/problem I had, the best solution is actually in the post linked by hirnyk above, but in case that gets overlooked, the answer is to use the diff command in the Physics package:

eg:

z := exp(-x)*sqrt(y(x)-exp(x)*diff(y(x),x)):

Physics:-diff(z,diff(y(x),x));
Physics:-diff(z,y(x)); 

Just in case anyone happens to come to this thread with the same question/problem I had, the best solution is actually in the post linked by hirnyk above, but in case that gets overlooked, the answer is to use the diff command in the Physics package:

eg:

z := exp(-x)*sqrt(y(x)-exp(x)*diff(y(x),x)):

Physics:-diff(z,diff(y(x),x));
Physics:-diff(z,y(x)); 

That's why I asked him to check :)

That's why I asked him to check :)

@hirnyk : yes you are right. I need to give this some more thought.

@hirnyk : yes you are right. I need to give this some more thought.

@hirnyk ...that one is easy.  Replace

tmp:=discont(f,x):

with

tmp:=discont(convert(f,exp),x):

on the 3rd line.

Next......

@hirnyk ...that one is easy.  Replace

tmp:=discont(f,x):

with

tmp:=discont(convert(f,exp),x):

on the 3rd line.

Next......

@hirnyk : I'm not sure you are right about that -  the case  f := 1/(exp(exp(exp(x)))-2) has no real discontinuity.

Anyway, I improved it a little:

rdiscont:=proc(f,x)

local tmp,rd,i,j,b,pp,qq,trap:

rd:=NULL:pp:=NULL:qq:=NULL:trap:=0:tmp:=discont(f,x):

for i from 1 to nops(tmp) do 

if type(tmp[i], realcons) then rd:=rd,tmp[i]

 elif tmp[i]=Re(tmp[i]) then rd:=rd,tmp[i]

 elif nops(indets(tmp[i],name))>0 then 

   for j from 1 to nops(indets(tmp[i],name)) do

     if not indets(tmp[i],name)[j] = Pi then

       pp:=pp,indets(tmp[i],name)[j]=a[j];

       qq:=qq,a[j]=0;

     end if;

   end do;

   b:=eval(tmp[i],{pp}); 

   for j from 1 to nops(indets(tmp[i],name)) do

     if not indets(tmp[i],name)[j] = Pi then

       if type(limit(b,a[j]=0),undefined) then trap:=1 end if;

     end if;

   end do;

   if trap=0 then    

     if type(eval(b,{qq}),realcons) then rd:=rd,eval(b,{qq}) end if;

   end if;

  end if;

end do;

{rd};

end proc:

 

f:=x/sin(x)+sin(x)/x+1/(exp(exp(x))-2)-tan(x);rdiscont(f,x);

rdiscont(f,x);

                       {0, Pi*_Z11, Pi*_Z14+(1/2)*Pi, ln(ln(2))}

@hirnyk : I'm not sure you are right about that -  the case  f := 1/(exp(exp(exp(x)))-2) has no real discontinuity.

Anyway, I improved it a little:

rdiscont:=proc(f,x)

local tmp,rd,i,j,b,pp,qq,trap:

rd:=NULL:pp:=NULL:qq:=NULL:trap:=0:tmp:=discont(f,x):

for i from 1 to nops(tmp) do 

if type(tmp[i], realcons) then rd:=rd,tmp[i]

 elif tmp[i]=Re(tmp[i]) then rd:=rd,tmp[i]

 elif nops(indets(tmp[i],name))>0 then 

   for j from 1 to nops(indets(tmp[i],name)) do

     if not indets(tmp[i],name)[j] = Pi then

       pp:=pp,indets(tmp[i],name)[j]=a[j];

       qq:=qq,a[j]=0;

     end if;

   end do;

   b:=eval(tmp[i],{pp}); 

   for j from 1 to nops(indets(tmp[i],name)) do

     if not indets(tmp[i],name)[j] = Pi then

       if type(limit(b,a[j]=0),undefined) then trap:=1 end if;

     end if;

   end do;

   if trap=0 then    

     if type(eval(b,{qq}),realcons) then rd:=rd,eval(b,{qq}) end if;

   end if;

  end if;

end do;

{rd};

end proc:

 

f:=x/sin(x)+sin(x)/x+1/(exp(exp(x))-2)-tan(x);rdiscont(f,x);

rdiscont(f,x);

                       {0, Pi*_Z11, Pi*_Z14+(1/2)*Pi, ln(ln(2))}

@pagan OK this is a little bit more robust, though  I guess you'll break it pretty easily - still, good fun for a Saturday afternoon :-)

rdiscont:=proc(f,x)

local tmp,rd,i,j,b,pp,qq:

rd:=NULL:pp:=NULL:qq:=NULL:tmp:=discont(f,x):

for i from 1 to nops(tmp) do 

if type(tmp[i], realcons) then rd:=rd,tmp[i]

 elif tmp[i]=Re(tmp[i]) then rd:=rd,tmp[i]

 elif nops(indets(tmp[i],name))>0 then 

   for j from 1 to nops(indets(tmp[i],name)) do

     if not indets(tmp[i],name)[j] = Pi then

       pp:=pp,indets(tmp[i],name)[j]=a[j];

       qq:=qq,a[j]=0;

     end if;

   end do;

   b:=eval(tmp[i],{pp}); 

   if not type(limit(b,{qq}),undefined) then    

 

     if type(eval(b,{qq}),realcons) then rd:=rd,eval(b,{qq}) end if;

   end if;

  end if;

end do;

{rd};

end proc:

 

f:=1/(exp(exp(x))-2):
rdiscont(f,x);
                                 {ln(ln(2))}

 

@pagan OK this is a little bit more robust, though  I guess you'll break it pretty easily - still, good fun for a Saturday afternoon :-)

rdiscont:=proc(f,x)

local tmp,rd,i,j,b,pp,qq:

rd:=NULL:pp:=NULL:qq:=NULL:tmp:=discont(f,x):

for i from 1 to nops(tmp) do 

if type(tmp[i], realcons) then rd:=rd,tmp[i]

 elif tmp[i]=Re(tmp[i]) then rd:=rd,tmp[i]

 elif nops(indets(tmp[i],name))>0 then 

   for j from 1 to nops(indets(tmp[i],name)) do

     if not indets(tmp[i],name)[j] = Pi then

       pp:=pp,indets(tmp[i],name)[j]=a[j];

       qq:=qq,a[j]=0;

     end if;

   end do;

   b:=eval(tmp[i],{pp}); 

   if not type(limit(b,{qq}),undefined) then    

 

     if type(eval(b,{qq}),realcons) then rd:=rd,eval(b,{qq}) end if;

   end if;

  end if;

end do;

{rd};

end proc:

 

f:=1/(exp(exp(x))-2):
rdiscont(f,x);
                                 {ln(ln(2))}

 

Just to demonstrate the absurdity of the current badge criteria, notice that Robert Israel has earned a total of 5 badges, whereas I have 8. Of course, there is the "quality vs quantity" argument, which is perfectly true, except that for the 5 badges that Robert has, I have 4 of them. Moreover, he is a professor, and I am an undergraduate with less than 1 year of experience with Maple, yet I am apparently worthy of the "tutor" badge ! If Robert Israel is not worthy of Maple Master and Great Answer badges, I can't imagine who is ! And I'm not trying to say that I am good - I consider myself just slighly above the beginner level.

So, whatever it is that badges are trying to achieve (and I'm not sure what that is to be honest) I don't think it is working.

Indeed. A few obvious ones are:

Maple Master: Answered 25 Maple-related questions with at least 5 up-votes each, however no one has been awarded the badge. 

Great Question: Question Up Voted 20 times - none awarded

Good Question: Question Up Voted 10 times - none awarded

Great Answer: Answer Up Voted 20 times - none awarded

Good Answer: Answer Up Voted 10 times - none awarded

Also, there is an apparent mistake with some of the badge icons themselves - presumably the numbers embedded in the icons reflect the number of times a question should be up-voted to earn it (ie the Great Question for which 20 up votes are needed has a "20" embedded in it) - yet the "Good Question" icon has a "5" embedded in it, while 10 votes are needed to earn it.  The same problem is evident with the "Good Answer" icon. 

To make Preben's point even clearer, there is no need to even re-type the input in 1D

I copied the 2D output from your worksheet into a Maple 13  classic (1D) worksheet. This comes along with all the hard-to-read 2D formatting thus

T := `#mfrac(mi("RL"),mrow(mi("j"),mo("⋅"),mi("ω",fontstyle = "normal"),mo("⋅"),mi("Cp")),linethickness = "1")`/((RL+1/(j*omega*Cp))*(`#mfrac(mi("R"),mrow(mi("j"),mo("⋅"),mi("ω",fontstyle = "normal"),mo("⋅"),msub(mi("C"),mi("s"))),linethickness = "1")`/(R+1/(j*omega*`#msub(mi("C"),mi("s"))`))+`#mfrac(mi("RL"),mrow(mi("j"),mo("⋅"),mi("ω",fontstyle = "normal"),mo("⋅"),mi("Cp")),linethickness = "1")`/(RL+1/(j*omega*Cp))));

But if you then copy the output of this to the next line, you get this

T := RL/(j*omega*Cp*(RL+1/(j*omega*Cp))*(R/(j*omega*C[s]*(R+1/(j*omega*C[s])))+RL/(j*omega*Cp*(RL+1/(j*omega*Cp)))));

which then simplifies to

(R*j*omega*C[s]+1)*RL/(R*RL*j*omega*Cp+R+RL*R*j*omega*C[s]+RL)

 

I also never use anything else than 1D input, because I find 2D hard to deal with and I learned using 1D, so I also don't know why 2D doesn't work.

First 6 7 8 9 10 11 12 Page 8 of 13