Turn on suggestions

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

Showing results for

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

Showing results for

** Community Tip** - New to the community? Learn how to post a question and get help from PTC and industry experts!
X

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

May 12, 2024
06:48 PM

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

May 12, 2024
06:48 PM

Find a minimum of the function

Subject to:

Minimum lies in a range [0;2*π]

Write it for MathCad15 please.

Thank you

Solved! Go to Solution.

1 ACCEPTED SOLUTION

Accepted Solutions

May 12, 2024
09:57 PM

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

May 12, 2024
09:57 PM

Looks like homework, doesn't it?

Where are your attempts in MC15?

What have you already tried?

BTW, the condition f(x)>= sine is somewhat strange.

First task should be to make a plot (either by hand or via Mathcad) which shows that you are just looking for the minimum of the part of the curve plotted thick red. Fortunately this minimum (green dot) can be found easily using the zero of the first derivative ...

The name "arctg" is quite outdated and should no longer be used according to the current standard (ISO 80000-2)

In Mathcad this function is called "atan".

11 REPLIES 11

May 12, 2024
09:57 PM

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

May 12, 2024
09:57 PM

Looks like homework, doesn't it?

Where are your attempts in MC15?

What have you already tried?

BTW, the condition f(x)>= sine is somewhat strange.

First task should be to make a plot (either by hand or via Mathcad) which shows that you are just looking for the minimum of the part of the curve plotted thick red. Fortunately this minimum (green dot) can be found easily using the zero of the first derivative ...

The name "arctg" is quite outdated and should no longer be used according to the current standard (ISO 80000-2)

In Mathcad this function is called "atan".

May 22, 2024
12:01 PM

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

May 22, 2024
12:01 PM

And how do you find the solution of it?

May 22, 2024
01:04 PM

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

May 22, 2024
01:04 PM

@TT_11056782 wrote:

And how do you find the solution of it?

As already written - define the first derivative of the function, set it to zero and solve for x. The plot suggests that you have to look in the range from pi to 2*pi.

Fortunately the position you arrive at is within the intervals of interest. Otherwise you would have to examine the endpoints of the curve fragments of interest.

Give it a try! Set up a worksheet, define the function f, define its derivative and use the "root" function or a solve block with "find" to find the solution in the range (pi; 2 pi). Don't use the symbolic "solve" as it would not be able to find a solution.

If you experience a problem while working with Mathcad, come back here, ask your question and don't forget to attach your worksheet.

May 23, 2024
09:23 AM

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

May 23, 2024
09:46 AM

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

May 23, 2024
09:46 AM

What I meant was that you may rather use the numeric solve methods provided by Mathcad out of the box. These are solve block with "find" and the "root" function.

The root function can be used in two flavors, by providing a guess value or by providing a range. Here an example for the latter (I use a range from pi to 2 pi because the plot showed that the solution is somewhere in this interval).

If you don't want to use Mathcads own numeric iteration methods but rather want to program it yourself, you sure have to look up and study the chapter on programming in the help.

You can't type the program statements in separate regions but rather you have to enter them in the so called "programming operator" as described in more detail in the help

Furthermore there is only a limited set of programming operators

Mathcads does not know an "else" (it uses "otherwise" instead) and there also is no "endwhile".

You can simply type in the programming operators but rather must pick them from the programming toolbar (Menu: View-Toolbars-Programming) or use the appropriate keyboard shortcut.

Its well worth studying this help section and also to follow the link to "Tutorial - Programming" at the end of that section.

Here is what your program could look like (I used a much smaller value for eps to enhance accuracy):

As you see its not necessary to zip or rar the Mathcad worksheet - you can attach them directly.

May 24, 2024
08:52 AM

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

May 24, 2024
08:52 AM

Thank you!

and how does the constraint affects the function here?

May 24, 2024
09:00 AM

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

May 24, 2024
09:00 AM

@TT_11056782 wrote:

Thank you!

and how does the constraint affects the function here?

Which constraint?

And what do you mean by "here"? My approach using "root" or the program I posted, base on your attempt?

Bit ignore the constraint that f(x) should be larger than the sine function given because in the plot it can be seen that this constraint is fulfilled anyway.

My root-approach looks for a solution in the range pi to 2 pi.

The program based on your attempt start with a guess value of pi and so also finds the desired solution.

May 24, 2024
09:03 AM

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

May 24, 2024
09:03 AM

I mean the whole question since it's subjected to this

May 24, 2024
09:14 AM

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

May 24, 2024
09:14 AM

@TT_11056782 wrote:

I mean the whole question since it's subjected to this

I already edited my answer above.

After making the plot and seeing that this constrained is fulfilled anyway by the minimum we get when we set the first derivative to zero, its not further considered.

To be on the safe side you can, after finding the x.min value, make a check to see if this constrained is fulfilled.

May 24, 2024
09:17 AM

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

May 24, 2024
09:17 AM

Okay. Thank you!

May 16, 2024
01:44 AM

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

May 16, 2024
01:44 AM

Hello @TT_11056782,

It looks like you have a response from a community member. If it helped you solve your question please mark the reply as the Accepted Solution.

Of course, if you have more to share on your issue, please let the Community know so other community members can continue to help you.

Thanks,

Community Moderation Team.