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
- :
- Re: polynomial with multiple solutions

Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- 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
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

11-19-2013
09:50 AM

11-19-2013
09:50 AM

Hi, I am quite new to mathcad and need help with the following problem:

a*u+b*v-c*w+d*uv = y

a=1.4

b=0.3

c=0.5

d=0.2

u, v, w are variables that fulfill some constraints:

0.2<u<0.8

0.1<v<0.5

0<w<0.7

and

u+v+w=1

and

u, v, w can only have values like u = 0.2, 0.3, 0.4, ... but not 0.25 or 0.21. (I am sure there is a mathematical term for numbers as such, sorry)

Now, I want mathcad to give me all possible solutions (all different compositions of u, v, w) that fulfill y > 2.

Thanks for any help.

Max

Solved! Go to Solution.

Labels:

1 ACCEPTED SOLUTION

Accepted Solutions

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

11-19-2013
10:48 AM

11-19-2013
10:48 AM

Here you are, but with more variables and maybe a wider range a brute force approach can be a problem - at least with respect to calculation time.

As you didn't specify the datastructure of your results I chose a nested vector. Each vector element is a 1x3 matrix consisting of the three values for u, v and w.

BTW, the testproblem you had set up has no solution as you can see here:

12 REPLIES 12

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

11-19-2013
09:58 AM

11-19-2013
09:58 AM

Re: polynomial with multiple solutions

d*uv should be d*u*v ???

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

11-19-2013
10:02 AM

11-19-2013
10:02 AM

Re: polynomial with multiple solutions

yes, not a differentiation

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

11-19-2013
10:03 AM

11-19-2013
10:03 AM

Re: polynomial with multiple solutions

ehh, deduction

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

11-19-2013
10:05 AM

11-19-2013
10:05 AM

Re: polynomial with multiple solutions

Max Muehle wrote:

ehh, deduction

derivative, derivation

(Differential, Ableitung)

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

11-19-2013
10:04 AM

11-19-2013
10:04 AM

Re: polynomial with multiple solutions

Do you have three different values for v as you wrote (0.1<v<0.5) are do you mean 0.1<=v<=0.5 ?

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

11-19-2013
10:10 AM

11-19-2013
10:10 AM

Re: polynomial with multiple solutions

🙂 derivative, ok.

no, not three different values, but five:

v= 0.1, 0.2, 0.3, 0.4, 0.5

u has six values:

u= 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8

and w has seven values.

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

11-19-2013
10:12 AM

11-19-2013
10:12 AM

Re: polynomial with multiple solutions

so, yes:

0.1<=v<=0.5

but with the constraint that it can only be a full decimal

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

11-19-2013
10:17 AM

11-19-2013
10:17 AM

Re: polynomial with multiple solutions

So you should have written <= instead of <.

What version of Mathcad are you using. What have you tried so far?

I don't think that Mathcad's built-in solver facilities would help. The numeric solvers will give you the first solution thea will find and stop and symbolic evaluation will probably ignore or choke at constraints like "trunc(10*u)=10*u" to ensure that the tenfold of your variables is an integer.

So all I could think of at the moment is writing a small program in Mathcad (or any other programming language) to try all possibilities. This brute force attack should not be to bad here as you only have 280 combinations to try.

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

11-19-2013
10:32 AM

11-19-2013
10:32 AM

Re: polynomial with multiple solutions

I am using mathcad 15 and so far I've been watching a whole lot of youtube-videos about solve-blocks that don't help.

The equation and the constraints are only placeholders - the real equation actually has 10-15 variables. And I wouldn't know where to start with writing a program to run through the combinations.

Thank you for your time,

Max

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

11-19-2013
10:48 AM

11-19-2013
10:48 AM

Here you are, but with more variables and maybe a wider range a brute force approach can be a problem - at least with respect to calculation time.

As you didn't specify the datastructure of your results I chose a nested vector. Each vector element is a 1x3 matrix consisting of the three values for u, v and w.

BTW, the testproblem you had set up has no solution as you can see here:

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

11-20-2013
04:10 AM

11-20-2013
04:10 AM

Re: polynomial with multiple solutions

Thank you very much.

I will try to adapt your solution to my equation tonight.

Max

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

11-20-2013
07:56 AM

11-20-2013
07:56 AM

Re: polynomial with multiple solutions

Max Muehle wrote:

Thank you very much.

I will try to adapt your solution to my equation tonight.

Max

Good luck!

As you have a more complex problem it may help to reduce calculation time if you replace the if loops with while-loops or use break inside the if. For instance in the example above my program will try w=0.1 to 0.7 even when u+v equals already 1. So if u+v+w>1 the w-loop can be breaked immedeatly.

Implementing that kind of shortcuts make the program much mor cluttered (and failure prone) but may reduce calc time heavily.

Even with the simple example we get a speed improvement of 10-20% by just inserting two simple break commands. Depending on the real problem and the constraints there there might be much more potential for improvements.