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
- :
- problem around solve blocks

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

05-07-2021
11:22 AM

05-07-2021
11:22 AM

Hi,

I'm using Mathcad 15 and I'm having problem in using solve block. What I'm trying to get is to find the values of PM.guess that will satisfy the LF.sum=1.

Appreciate if you can let me know how to fix this.

Thanks.

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

05-07-2021
10:53 PM

05-07-2021
10:53 PM

What Luc suggested sure is the way you should do it, even though its not forbidden to place assignments and guess values after the "given" keyword.

What you had misunderstood is that all those assingments are calculated only once with the initial guess values of PM and are not subject for nay iteration.

That said you must turn all your calculations into functions of PM and then use them in the solve block.

Here is an example how to do it.

I am not sure if its a problem, but you provided only positive guess values while the solution values are all negative.

MC15 worksheet attached

4 REPLIES 4

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

05-07-2021
11:44 AM

05-07-2021
11:44 AM

Re: problem around solve blocks

You should read the help info and study the examples of solve block usage.

There should be NO assignments between the Given and the Find. There can ONLY be constraints (those with a bold equals sign).

(You have a lot of assignments, those with := ).

The Guess values should be placed BEFORE the Given.

Success!

Luc

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

05-07-2021
10:53 PM

05-07-2021
10:53 PM

What Luc suggested sure is the way you should do it, even though its not forbidden to place assignments and guess values after the "given" keyword.

What you had misunderstood is that all those assingments are calculated only once with the initial guess values of PM and are not subject for nay iteration.

That said you must turn all your calculations into functions of PM and then use them in the solve block.

Here is an example how to do it.

I am not sure if its a problem, but you provided only positive guess values while the solution values are all negative.

MC15 worksheet attached

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

05-08-2021
01:19 PM

05-08-2021
01:19 PM

Re: problem around solve blocks

Thanks Werner_E. This is what I needed. I am not too concern about the negative values of the solutions at this moment.

Just for my understanding, what's is the reason to use the local assignment ("tmp") when defining the LOG_LD(PM)?

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

05-08-2021
02:36 PM

05-08-2021
02:36 PM

Re: problem around solve blocks

@MN_9927727 wrote:

Just for my understanding, what's is the reason to use the local assignment ("tmp") when defining the LOG_LD(PM)?

The reason for this local assignment is because we cannot vectorize the calculation for LOG_LD as is was provided because that way we would also vectorize the interpolation. So this interpolation is called not vectorized in first place and then its result is used vectorized in the following calculation.

For similar reasons I did NOT vectorize the calculations for LD (and subsequently also for LF, which calls LD). Vectorizing those functions would yield wrong results in a nested array as data structure and so the solve block would fail.