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 for N inputs

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

09-19-2017
09:50 AM

09-19-2017
09:50 AM

I'm wondering if there is a simple way to perform this, as I can't figure it out.

Let's saying we're using a solve block to develop a solution - in this case the flow through multiple orifices in series. Easy enough to enter the equations and solve as follows:

But if we have 10 orifices, that's a lot of typing. Is there a way to use indices or otherwise simplify this? I was thinking of something along these lines, but can't get it to work. Judging by the error maybe it's impossible.

This still shows N=2 orifii as a starting point, but the table could have 2, 3, .. N rows.

Any thoughts or solutions would be appreciated.

4.0 attached.

Thanks!

Solved! Go to Solution.

1 ACCEPTED SOLUTION

Accepted Solutions

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

09-19-2017
01:22 PM

09-19-2017
01:22 PM

See attached (PDF and Prime 3.1).

P_in is the pressure before the first orifice. P_out is the pressure after the last orifice.

Pin and Pout are vectors with the pressure before and after each orifice.

The guess values for Pin and Pout are multiplied by C just to make them vectors of the same size.

4 REPLIES 4

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

09-19-2017
12:38 PM

09-19-2017
12:38 PM

Re: Solve block for N inputs

Can you treat it ike a finite difference problem--define a vector of N=1 pressures, develop a cost function that computes the error in each step and use a solve block to find the correct values in the vector?

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

09-19-2017
12:43 PM

09-19-2017
12:43 PM

Re: Solve block for N inputs

I have used a programing tools in same case

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

09-19-2017
01:22 PM

09-19-2017
01:22 PM

See attached (PDF and Prime 3.1).

P_in is the pressure before the first orifice. P_out is the pressure after the last orifice.

Pin and Pout are vectors with the pressure before and after each orifice.

The guess values for Pin and Pout are multiplied by C just to make them vectors of the same size.

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

09-19-2017
03:59 PM

09-19-2017
03:59 PM

Re: Solve block for N inputs

Thank MJG, exactly what I was after. Very clever with the stack = stack constraint. I also think I could get there using Minerr, which is where Fred was headed, I think. But this solution is very compact. Will come in handy for this and other problems.