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

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

Solve Block

ELSID
4-Participant

Solve Block

Using MathCAD 14 M020
I can not get this simple solve block to work. If I manually change the subscript on "b" the correct solution appears. I would like to solve for all 3 solutions to distance new with respect to "b", simultaneously.

Thank you
24 REPLIES 24

Use functions and iterate the functions. You can't iterate the solve block itself, or it's contents.

You seem to have taken the hard way to add 10 log(2) to your decibel specification.
__________________
� � � � Tom Gutman
ELSID
4-Participant
(To:ELSID)

Thank you.

This is a subsection to a much larger calculation. Eventually, I would like to learn how to cross link one variable based on another.

The calculation is in US, but the manufacturer sent me the information in meters, hence the discrepancy.

BTW, why did you vectorize the solution? How did you input it (type it)? I copied and pasted into my calculation and it works, I just want o know how to do it next time.

I'm not sure what you mean by cross linking one variable with another. Any time you reference a variable in a calculation the value at that point in the sheet is used in the calculation. Thus you can have any value dependent on the values of any variables defined at that point in the sheet.

I vectorized the answer because the solve block is set up for a scalar calculation, for a single b. You wanted the values for all the individual b's, hence the vectorization. Without vectorization it would have attempted a solution for a vector valued b, and if you look at the equation (and consider the automatic vectorization done by some functions) you can see that there is no possible solution to that -- your constraint becomes a scalar equal to a vector, and a scalar is never equal to a vector.

The vectorization operator is entered using ctl--. You can also find it on the array tool bar.
__________________
� � � � Tom Gutman
ELSID
4-Participant
(To:TomGutman)

Thank you Tom.
What I meant by cross linking was not a variable but MathCAD files. I have a flow calculation which feeds the sound calculation. I want to verify that the values are with-in spec, if not, then Highlight or something. This will allow me to go to a mfg catalog, select new equipment and re-run the calculation. The caveat for this example is pressure of a fan. As I select a new attenuator based on the manufacturers data, the system pressure changes, thus changing the fan calculation.
Any advise would be greatly appreciated as well as an example and BOOK that could assist me.
Ruben

Mathcad has no good way to link sheets. You can use reference to embed one sheet in another, but that tends to be a bit clumsy and difficult to use. Biggest issue is that you cannot see, and debug, the calculations in the embedded sheet is situ. I suggest the use of collapsible areas instead. Put related computations into an area and collapse it while you work on different calculations.

How to set up the overall system depends on a variety of factors. Is this a one off design (e.g., you are building a factory and need to include a fan) or an ongoing process (e.g., you are in the business of designing factories and do one of these fan designs every week or so)? Are the catalogs paper (or electronic equivalent) or Excel (or similar) files?

You also need to decide what variables are to be made worksheet variables, with fixed values in the sheet and which are to be done as arguments to functions. Main decision is whether you will need only a sigle value in the sheet (either because it is specified as part of the requirements, or because it is a choice that you make only one at a time -- e.g., the choice of pump), or whether you will want to compare the results of different values within the same sheet.
__________________
� � � � Tom Gutman
ELSID
4-Participant
(To:TomGutman)

I will look into the collapsible areas (I've never used before).
I am working on a sheet that will be re-used (i.e. an on going process) from one project to the next.
Data comes from paper catalogs (for now). I may opt to use "a vendor" with multiple models to use as an equivalent.
A little lost on this comment
>You also need to decide what variables are to be made worksheet variables, with fixed values in the sheet and which are to be done as arguments to functions.
The problem is iterative, will try to explain as I have not seen an example in the collaboratory.
1. Calculate fan "A" parameters (flow and pressure) using generic components (e.g. attenuator "B")
2. Note dBA for calculation
3. Calculate attenuator requirements to meet NC criteria
4. Select new attenuator ("C") and use this new data and go to step 1
Hope this explains what I am trying to do. I would love to see an example of a worksheet that solves anything similarly to this so I can see the structure

With a sheet that will be reused repeatedly it is worthwhile spending the effort to minimize the user input for each use. If you had the catalog(s) as files from the vendor, it would be worthwhile working out how to read those catalogs in Mathcad rather than having the user type in the individual specifications. With paper catalogs that step is unavoidable. But even in this case, if you are in fact working with a fairly limited selection of fans and often reusing the same fan it may be worthwhile building your own data base (either as a separate file, perhaps in Excel, or embedded in the worksheet as tables) and having the user simply select a fan from a list.

On the worksheet variable vs. function parameter: You have a choice as to how you handle the attenuator parameters. You can make them worksheet variables. Then you define them at the top of the worksheet (or at least the section involving the attenuator calculations) and calculate the worksheet. At the bottom of the sheet you will get your answer. If you don't like it, you change the parameters at the top and recalculate the sheet. This is an inherently manual process.

Or you can define your answer as a function of the relevant attenuator parameter(s). Then you just evaluate that function for an attenuator and look at the result. Don't like it, try a different value. But as a function you can also have a list of attenuator parameters (as in your sample sheet) and evaluate the function for all of them, using iteration or vectorization. You can also have a program that tries the various possibilities and reports just the ones that meet your criteria. If the parameters are continuous (say you can built an attenuator of any desired length, or have any desired thickness of insulation) you can use Mathcad's optimization tools (minimize, maximize, minerr) to get an optimal design. If you make the fan parameters function arguments and have a list of fans you can have a program automatically try all the fans in the list, and if you have some figure of merit for the results report the best fan.
__________________
� � � � Tom Gutman
ELSID
4-Participant
(To:TomGutman)

Reviving one of my old topics. I am back at working on a sound calculation. I need to do two things. First, chart the dB. I've tried to divide the dB in the variable for the graph ... no plot. Second, I would like to input different values for the highlighted items. Values would come from an excel sheet instead of being hand input. Then
I need to run the calculation in parallel as I have more data off of an excel spread sheet.

Thank you

>I need to run the calculation in parallel<<br> That will depend upon the architecture of the machine. Is Windows Pentium a pipeline architecture ? or else "parallel machine" ? Is 23dB something in Mathcad ? does it prefer 23*dB ? No plot because no Bfrqc !!! and "This function is undefined at one or more points", your are in the log business, so what about log(0) ?

jmG


ELSID
4-Participant
(To:ptc-1368288)

On 10/20/2009 3:05:21 AM, jmG wrote:
>...No plot because no Bfrqc !!!

=>DUH! Thank you. It was late last night and I did not catch it

Now ... how do I import the data from excel to Mathcad?


I said to calculate in parallel ... I think Tom nailed it. I mis-stated what I need. I have multiple data sets and I want to run them through a program if possible. To me, it appears as calculating in parallel, but in fact it would be in series in some sort of a loop.

On 10/20/2009 12:03:13 PM, ElSid wrote:
>On 10/20/2009 3:05:21 AM, jmG
>wrote:
>...No plot because no Bfrqc
>!!!
=>DUH! Thank you. It was late last
>night and I did not catch it
Now ... how
>do I import the data from excel to
>Mathcad?

I said to calculate in
>parallel ... I think Tom nailed it. I
>mis-stated what I need. I have multiple
>data sets and I want to run them through
>a program if possible. To me, it
>appears as calculating in parallel, but
>in fact it would be in series in some
>sort of a loop.
____________________________

You import data from Excel by reading the qs. Pentium is not a "parallel machine", so it nails by itself. >I have multiple data sets and I want to run them through a program if possible< ... a programme doing what ?

jmG



Decibels are not a proper unit. It is a scale. In Mathcad, dBs are dimensionless and can just be plotted as is. You could apply the inverse decibel function (/dB), but that would usually generate a power density (as dB are defined as a scale for power density). That's not usually what you want.

If you have multiple data to process, you are generally better off processing them sequentially, in some sort of loop, rather than try to do them in parallel.
__________________
� � � � Tom Gutman
ELSID
4-Participant
(To:TomGutman)

How do you add the "scalar" values of dB?
See bottom of attached sheet. First value shoud be -26.2.
How do you define ΔdB? I can not find a good example for ΔF or ΔC (Temperatures) in order to create a user defined unit

The conversion 14 ==> 11 is scrap, "an internal error has occurred". In your last line = for result, remove dB and get some tabulated data. Just define db by an equation and get some other data.

jmG
ELSID
4-Participant
(To:ELSID)

On 10/20/2009 2:13:17 PM, ElSid wrote:
>values of dB? See bottom of
>attached sheet. First value
>shoud be -26.2.
Success! See attached sheet where I was able to work with the dB scale (addition too).

Can some one help me understand how to import the fan forward and reverse as well as well as silencer data from an excel sheet? I have one excel file with multiple sheets covering different fan/silencer combinations. I want to run the attached dB sheet to the data (existing format for excel data is above in message 9 (fannoise.xls)

You can read Excel data using the file input component, or the data import wizard (I used the file input because the import wizard has issues with files from the web).

But there is no simple way to programatically specify the sheet from a multi-sheet Excel file. You may want to use a scripted component for that purpose.
__________________
� � � � Tom Gutman
ELSID
4-Participant
(To:TomGutman)

I was afraid that is what you meant earlier.

I am attaching a revised Sound sheet. I decided to input the data as scalars for two fans. Eventually, I want to do for n # of fans. The linear math is correct and checks out with my predecessors values. Can some one push me in the right direction for programing this?

You don't like scripted components for input?

You don't actually need i for anything. You are better off plotting arrays than iterated expressions.

There's not much point to saving this file in MC11 format. The unit functions don't work in MC11.
__________________
� � � � Tom Gutman
ELSID
4-Participant
(To:TomGutman)

Thank you for cleaning up!
Scripted components for input? I'll need to look up in the help file.
I need to add two different arrays. Why does it store the results in a nested array? Any idea on how to avoid?

You are getting a nested array because you are assigning an array to an element of an array. What would you expect when you do this?
__________________
� � � � Tom Gutman
ELSID
4-Participant
(To:TomGutman)

I thought I played with "j" in the matrix column. DOH! Thank you for the help. I hope this clears up what I need to do with the remainder of this sheet. BTW, we do not need to vectorize the addition



Also, why are you multiplying L.Wf * Aweight? (your last equation). The result in the first transposed location is the SUM of the column followed by the values of Temp. I am confused as to the internal math results for this product.

You are correct that you do not need to vectorize the addition, as vector addition is done element by element. It was there and I left it in on the basis that it doesnt hurt, and it makes the meaning a bit clearer, as the intent is just an element by element addition rather than a true vector operation.

That last equation, multiplying by Aweight, is just the simple (and perhaps more correct) way of applying Aweight. As you can see, the result is the same as the more cumbersome formula using unit conversions and addition that you had in the preceding definition.

When you have gains or attenuations specified in dB and use the ΔdB unit the value actually stored is the power or intensity ratio. You can multiply an intensity by that ratio to get the amplified or attenuated intensity. Remember, using the provided unit functions you may think of and display the values in terms of decibels, but what is actually stored are intensities and intensity ratios.
__________________
� � � � Tom Gutman
ELSID
4-Participant
(To:TomGutman)

I am now working on "reverse engineering the numbers. I figured a solve block would be appropriate. As you can see at the bottom of the sheet, I am only solving for "column=0" to find a value of b. I can not get the solve block to work if I substitute "column=j" to solve for both b's in parallel.

You cannot use a range variable directly in a solve block. To apply a solve block to different values you need to make it a function, and then iterate the evaluation of that function.

You really should not be working so hard to convert everything to logs and then do addition. Much simpler to just do the implied multiplications originally. You should normally only use unit functions for inputting and displaying values, not for calculations.
__________________
� � � � Tom Gutman
Top Tags