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
- :
- Solve Block

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

08-05-2014
03:12 AM

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

08-05-2014
03:12 AM

Solve Block

please help to solve the problem.

for each TK i need solution.

for individual Tk, over range of n, i want minimum value.

Thanks in advance.

Regards

Prabhu

11 REPLIES 11

08-05-2014
03:23 AM

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

08-05-2014
03:23 AM

What does the the value n represent in your program and why have you started the for loop with a value of n = 2?

08-05-2014
04:19 AM

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

08-05-2014
04:19 AM

n should vary from 2 to 18, i want the lowest value from the loop for individual Tk.

08-05-2014
04:38 AM

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

08-05-2014
04:38 AM

Like the attached?

I would recommend not to redefine variables which have been designated to represent units, i.e. R in this case.

08-05-2014
04:54 AM

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

08-05-2014
04:54 AM

first case Tk=15mm

than n should vary from 2 to 16, for each value of n pressure_critical will be different

so, pressure_critical will have 15 values for one Tk, output should be least of the pressure_critical

than Tk will be 16mm, program repeats

i want output in the form of "Timo_Pcr(TK)", output will have 60 values

08-05-2014
05:48 AM

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

08-05-2014
05:48 AM

Like the attached?

i want output in the form of "Timo_Pcr(TK)", output will have 60 values

Why?

08-05-2014
06:06 AM

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

08-05-2014
06:06 AM

prabhu g wrote:

first case Tk=15mm

than n should vary from 2 to 16, for each value of n pressure_critical will be different

so, pressure_critical will have 15 values for one Tk, output should be least of the pressure_critical

than Tk will be 16mm, program repeats

i want output in the form of "Timo_Pcr(TK)", output will have 60 values

So write your function to work for 1 scalar input value and return 1 scalar and then call it with a vector as argument and use vectorization - thats what vectorization is for.

See attached

08-05-2014
06:28 AM

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

08-05-2014
06:28 AM

I can't seem to figure out why my sheet is returning different results to yours.

Although I do like your method better.

08-05-2014
06:51 AM

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

08-05-2014
06:51 AM

Mike Armstrong wrote:

I can't seem to figure out why my sheet is returning different results to yours.

Because you used a different formula 😉

You have n+2 instead of just n in the first denominator.

But I just realized that I, too, did not use prabhu's original sheet as I worked off one of your sheets and obviously you had changed his routine.

So here is the routine using his original sheet.

08-05-2014
07:41 AM

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

08-05-2014
07:41 AM

Werner Exinger wrote:

Because you used a different formula 😉You have n+2 instead of just n in the first denominator.

Oh so I did . The issue was that I didn't subtract CA from Tk. I also removed R and Tk from the program as I didn't seen the need to locally define them.

Werner Exinger wrote:

So here is the routine using his original sheet.

Here is my attempt using a nested FOR loop for completeness. Results now agree.

08-05-2014
09:10 AM

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

08-05-2014
09:10 AM

Mike Armstrong wrote:

Werner Exinger wrote:

Because you used a different formula 😉You have n+2 instead of just n in the first denominator.

Oh so I did . The issue was that I didn't subtract CA from Tk. I also removed R and Tk from the program as I didn't seen the need to locally define them.

Werner Exinger wrote:

So here is the routine using his original sheet.

Here is my attempt using a nested FOR loop for completeness. Results now agree.

Yes, and with your approach you may omit the local variable critical_pressure completely as its not needed for initialisation of the minimum.

08-05-2014
09:12 AM

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

08-05-2014
09:12 AM

Good spot