symbolic pkg help for degree

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

symbolic pkg help for degree

Doug Stewart-4

Function File: n = degree (p)
Function File: n = degree (px)

Extract numerator and demoninator of symbolic expression.

Examples:

syms x
degree(x^2 + 6)
   ⇒ (sym) 2


This function does not "extract numerator and denominator from"
It finds the highest power of a variable.
 
--
DAS

Reply | Threaded
Open this post in threaded view
|

Re: symbolic pkg help for degree

Svante Signell-4
On Sun, 2016-01-03 at 09:54 -0500, Doug Stewart wrote:

>
> Function File: n = degree (p)
> Function File: n = degree (p, x)
> Extract numerator and demoninator of symbolic expression.
> Examples:
> syms x
> degree(x^2 + 6)
>    ⇒ (sym) 2
>
>
> This function does not "extract numerator and denominator from"
> It finds the highest power of a variable.

Well, it returns the degree of the numerator polynomial, which is two.
In this example, there is no denominator polynomial defined (note the
spelling, the help text is wrong!)

Reply | Threaded
Open this post in threaded view
|

Re: symbolic pkg help for degree

nrjank


On Jan 3, 2016 10:09 AM, "Svante Signell" <[hidden email]> wrote:
>
> On Sun, 2016-01-03 at 09:54 -0500, Doug Stewart wrote:
> >
> > Function File: n = degree (p)
> > Function File: n = degree (p, x)
> > Extract numerator and demoninator of symbolic expression.
> > Examples:
> > syms x
> > degree(x^2 + 6)
> >    ⇒ (sym) 2
> >
> >
> > This function does not "extract numerator and denominator from"
> > It finds the highest power of a variable.
>
> Well, it returns the degree of the numerator polynomial, which is two.
> In this example, there is no denominator polynomial defined (note the
> spelling, the help text is wrong!)
>

This seems to be attempting to emulate the MATLAB mupad function degree which is not defined for rational polynomials. According to the help for that function it returns the degree of the symbolic polynomial. It certainly seems like it could be extended for rational polynomials, but I'm not sure if that's the intent here.

Reply | Threaded
Open this post in threaded view
|

Re: symbolic pkg help for degree

nrjank


On Jan 3, 2016 4:38 PM, "Nicholas Jankowski" <[hidden email]> wrote:
>
>
> On Jan 3, 2016 10:09 AM, "Svante Signell" <[hidden email]> wrote:
> >
> > On Sun, 2016-01-03 at 09:54 -0500, Doug Stewart wrote:
> > >
> > > Function File: n = degree (p)
> > > Function File: n = degree (p, x)
> > > Extract numerator and demoninator of symbolic expression.
> > > Examples:
> > > syms x
> > > degree(x^2 + 6)
> > >    ⇒ (sym) 2
> > >
> > >
> > > This function does not "extract numerator and denominator from"
> > > It finds the highest power of a variable.
> >
> > Well, it returns the degree of the numerator polynomial, which is two.
> > In this example, there is no denominator polynomial defined (note the
> > spelling, the help text is wrong!)
> >
>
> This seems to be attempting to emulate the MATLAB mupad function degree which is not defined for rational polynomials. According to the help for that function it returns the degree of the symbolic polynomial. It certainly seems like it could be extended for rational polynomials, but I'm not sure if that's the intent here.

Additionally, what the heck is MuPAD?  MATLAB seems to treat it as some stand alone program not part of core MATLAB or the core symbolic toolbox. Is it inside the scope that Octave tries to maintain compatibility with?

Reply | Threaded
Open this post in threaded view
|

Re: symbolic pkg help for degree

Doug Stewart-4


On Sun, Jan 3, 2016 at 4:40 PM, Nicholas Jankowski <[hidden email]> wrote:


On Jan 3, 2016 4:38 PM, "Nicholas Jankowski" <[hidden email]> wrote:
>
>
> On Jan 3, 2016 10:09 AM, "Svante Signell" <[hidden email]> wrote:
> >
> > On Sun, 2016-01-03 at 09:54 -0500, Doug Stewart wrote:
> > >
> > > Function File: n = degree (p)
> > > Function File: n = degree (p, x)
> > > Extract numerator and demoninator of symbolic expression.
> > > Examples:
> > > syms x
> > > degree(x^2 + 6)
> > >    ⇒ (sym) 2
> > >
> > >
> > > This function does not "extract numerator and denominator from"
> > > It finds the highest power of a variable.
> >
> > Well, it returns the degree of the numerator polynomial, which is two.
> > In this example, there is no denominator polynomial defined (note the
> > spelling, the help text is wrong!)
> >
>
> This seems to be attempting to emulate the MATLAB mupad function degree which is not defined for rational polynomials. According to the help for that function it returns the degree of the symbolic polynomial. It certainly seems like it could be extended for rational polynomials, but I'm not sure if that's the intent here.



I believe that Colin has fixed this already. 

 Doug

Additionally, what the heck is MuPAD?  MATLAB seems to treat it as some stand alone program not part of core MATLAB or the core symbolic toolbox. Is it inside the scope that Octave tries to maintain compatibility with?




--
DASCertificate for 206392

Reply | Threaded
Open this post in threaded view
|

Re: symbolic pkg help for degree

Colin Macdonald-2
In reply to this post by nrjank
On 03/01/16 13:40, Nicholas Jankowski wrote:
> Additionally, what the heck is MuPAD?  MATLAB seems to treat it as
> some stand alone program not part of core MATLAB or the core symbolic
> toolbox.

Mathworks bought MuPAD some years ago: it was a standalone CAS.
Mathworks use it in two ways:

1)  Last I checked, they maintain an essentially stand-alone "worksheet"
mode with its own GUI.  This uses the MuPAD language (i.e., not .m files)

2)  Using it as a backend for their Symbolic Math Toolbox.

> Is it inside the scope that Octave tries to maintain compatibility
> with?

No, we have no intention of being compatible with MuPAD.

More details: the Octave-Forge Symbolic Package uses SymPy as a backend.
 We have two goals:

A)  some compatibility with the Symbolic Math Toolbox.  In terms of
syntax at least.

B)  be a thin layer on top of SymPy.

Sometimes these goals are contradictory.  B) probably should win
long-term for maintenance reasons!  B) also implies we prefer to
fix/extend SymPy: there is no shortage of work to be done.

Colin