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

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Translate the entire conversation x

Solution over a range (Mathcad Prime 9.0)

ptc-1681201
4-Participant

Solution over a range (Mathcad Prime 9.0)

Hi,

I have an equation like

ptc1681201_0-1741912325615.png

Where Q(x) is some complicated complex function of x. This way f (or sol, if you prefer) is a function of x.

I would like to make x a range so that I can plot f as a function of this range.

Is it possible to do that?

Thanks

 

 

ACCEPTED SOLUTION

Accepted Solutions
Werner_E
25-Diamond I
(To:ptc-1681201)

Write sol(x):=... instead of sol:=... and delete the equal sign at the end of this expression.

Also delete the assignment x:=737.3 Hz.

That way you turned the solve block into a function of x.

 

You may also consider to use a non-real guess value instead of the 10-6 just to be on the save side.
Normally Prime will refuse to return non-real results if the guess value is real. In your case it works because of the factor 1i used in your equation.

 

Of course you could also use the name f instead of sol by writing f(x):=find(f). There should be no conflict between the function name f and the variable name f in the find function.

 

From Prime's help: Parameterizing Solve Blocks

 

For further help you would have to attach your worksheet.

View solution in original post

4 REPLIES 4
Werner_E
25-Diamond I
(To:ptc-1681201)

Write sol(x):=... instead of sol:=... and delete the equal sign at the end of this expression.

Also delete the assignment x:=737.3 Hz.

That way you turned the solve block into a function of x.

 

You may also consider to use a non-real guess value instead of the 10-6 just to be on the save side.
Normally Prime will refuse to return non-real results if the guess value is real. In your case it works because of the factor 1i used in your equation.

 

Of course you could also use the name f instead of sol by writing f(x):=find(f). There should be no conflict between the function name f and the variable name f in the find function.

 

From Prime's help: Parameterizing Solve Blocks

 

For further help you would have to attach your worksheet.

ptc-1681201
4-Participant
(To:Werner_E)

Thanks! It works (quite) perfectly. Very nice and very fast!

There are some numerical instabilities but they are at frequencies higher than those I take into consideration in my experiments.

All that is related to the study made by Prof. Munjal on lined (circular or rectangular) ducts, a study that I'm trying to use in my models for Transmission Line speakers.

Bessel functions mean circular ducts. Tomorrow I shall use the same technique to explore the corresponding equation for rectangular ducts (tan functions).

Thanks again!

Werner_E
25-Diamond I
(To:ptc-1681201)

As of the numerical inaccuracies: While you never can eliminate them completely when working numerically and not symbolically, it might be wort a try to experiment with different guesses and maybe also with different values for the system variables TOL and CTOL. Default value for both is 10^-3. Not sure if decreasing this value would help, though.

ptc-1681201
4-Participant
(To:Werner_E)

The numerical instability disappears by writing the equation differently:

ptc1681201_0-1741978445619.png

Same for the equation to be used when dealing with a rectangular lined duct:

ptc1681201_1-1741978637093.png

The original form was suggested in the Munjal book.

Thanks again!

Announcements

Top Tags