Get Help

Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Community
- :
- PTC Mathcad
- :
- PTC Mathcad
- :
- Polynomial, yes or not?

Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-04-2019
07:25 AM

09-04-2019
07:25 AM

Polynomial, yes or not?

Hello everyone,

I would like to create a Mathcad program that distinguishes whether the denominator of a given fraction is a polynomial or not, returning 0 or 1 for example. How do I do this?

Thank you.

14 REPLIES 14

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-04-2019
10:12 AM

09-04-2019
10:12 AM

Re: Polynomial, yes or not?

Examples please.

Note sin (x) generally isn't viewed as a polynomial in x. But it can be written as such.

Luc

Note sin (x) generally isn't viewed as a polynomial in x. But it can be written as such.

Luc

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-04-2019
01:30 PM

09-04-2019
01:30 PM

Re: Polynomial, yes or not?

Hi,

The function of the program should be something like this:

once the type has been identified, we pass to the transformation into a polynomial, if possible.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-04-2019
05:56 PM

09-04-2019
05:56 PM

Re: Polynomial, yes or not?

I got this far, so far:

I doubt whether this will (rather sure that this will not) work in Mathcad 15, but it does work in Mathcad 11.

Success!

Luc

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-04-2019
07:33 PM

09-04-2019
07:33 PM

Re: Polynomial, yes or not?

I am tempted to say that what you demand can't be done in Mathcad in a reasonable way as Mathcad does not provide the necessary tools.

Nonetheless here is a first attempt which may serve as a starting point for your own experiments.

There are a lot of drawbacks so far - you can only evaluate the function symbolically, its only working for functions in one variable and otherwise constants, ...

A few of the adverse effects could probably be corrected by some further investigations, but presumably not all. And I guess it will remain an uncertain, unreliable thing.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-05-2019
04:32 AM

09-05-2019
04:32 AM

Re: Polynomial, yes or not?

Mathcad 15 returns this error:

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-05-2019
04:35 AM

09-05-2019
04:35 AM

Re: Polynomial, yes or not?

it would be better if the circled functions are not considered an error by mathcad. How to do?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-05-2019
05:09 AM

09-05-2019
05:09 AM

Re: Polynomial, yes or not?

I don't think there is a way.

You can switch off signalling of certain (types of) warnings.

You cannot switch off errors.

Luc

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-05-2019
12:28 PM

09-05-2019
12:28 PM

Re: Polynomial, yes or not?

We could at least avoid the error(s) in "IsPoly2" by adding additional arguments and providing an alternative result in case the equality condition is not met. The value does not matter as we never arrive at the last line - if the equality condition is not met an error is thrown.

You may add two additional dummy arguments when you call "IsPoly2" from within "IsDenomPoly", but its not necessary to do so.

Not sure if we also could avoid the error in "IsDenomPoly" - in fact I don't understand the reason for the error message "This value must be a scalar".

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-05-2019
01:16 PM

09-05-2019
01:16 PM

Re: Polynomial, yes or not?

Werner,

I'd expect an error message "This function needs more arguments." for your call of IsPoly2(v) inside the function IsDenomPoly(f).

IsPoly2 requires 3 parameters, you call it with only 1...

Or have you found a way to define functions with optional parameters?

Luc