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
Hi,
I have an equation like
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
Solved! Go to Solution.
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.
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.
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!
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.
The numerical instability disappears by writing the equation differently:
Same for the equation to be used when dealing with a rectangular lined duct:
The original form was suggested in the Munjal book.
Thanks again!
 
					
				
				
			
		
