cancel
Showing results for
Search instead for
Did you mean:
cancel
Showing results for
Search instead for
Did you mean:

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

6-Contributor

## Find a minimum of the function

Subject to:

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

Write it for MathCad15 please.

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
24-Ruby V
(To:TT_11056782)

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
24-Ruby V
(To:TT_11056782)

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".

6-Contributor
(To:Werner_E)

And how do you find the solution of it?

24-Ruby V
(To:TT_11056782)

@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.

6-Contributor
(To:Werner_E)

Is it right? I'm sorry if everything is a mess here.

24-Ruby V
(To:TT_11056782)

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.

6-Contributor
(To:Werner_E)

Thank you!

and how does the constraint affects the function here?

24-Ruby V
(To:TT_11056782)

@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.

6-Contributor
(To:Werner_E)

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

24-Ruby V
(To:TT_11056782)

@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.

6-Contributor
(To:Werner_E)

Okay. Thank you!

Moderator
(To:TT_11056782)

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.

Announcements
Top Tags