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

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

Solve Block With Bessel Function Not matching With Reference Solutions

NovaStark
4-Participant

Solve Block With Bessel Function Not matching With Reference Solutions

Hello All,

 

I am trying to recreate the solutions in Prime 10 to a 'characteristic equation' from a technical paper involving the Bessel functions.

The equation to be solved is shown below

Screenshot 2024-11-23 085012.png

The first 10 solutions is given as:

NovaStark_0-1732379441696.png

 

However it appears that the solve block essentially just returns my inputs

NovaStark_2-1732379498652.png

 

 I have removed all units as I recall in the older versions of Prime that units in the solve block tend result in errors.

 

I have never had to use the Bessel functions, so I am not sure if I am overlooking something or making a simple error given how the equation is stated. Can anyone review and provide some guidance ?

ACCEPTED SOLUTION

Accepted Solutions

Hi,

Solve blocks to find 5 results needs 5 equations where the solve block in question has only one.

 

What is needed is the root function like this

Capture.JPG

Cheers

Terry

View solution in original post

8 REPLIES 8

Hi,

Solve blocks to find 5 results needs 5 equations where the solve block in question has only one.

 

What is needed is the root function like this

Capture.JPG

Cheers

Terry

Thank you for the clarification on the solve block.

 

Then when using the root function, changing the interval to (F(b),b,1,15) would not produce all of the results within the interval. Is there a way to do this without having to manually input each interval ? 

 

For example, if I change the values of a,b, h and k I may not be able to easily tell where the intervals lie.

Hi,

AFAIK you need to use the function a number of times to find the roots using different ranges.  You can use the root function in a Prime program.

You need to plot the equation to get a gauge of what ranges to use.

Capture.JPG

Cheers

Terry


@terryhendicott wrote:

Hi,

Solve blocks to find 5 results needs 5 equations where the solve block in question has only one.

 

Yes, and you get the necessary five equations (one for each element in vector ß) if you use vectorization 😉

Werner_E
25-Diamond I
(To:NovaStark)

You have to use vectorization (the arrow over the expression, to get what you are looking for

Werner_E_0-1732387319060.png

Vectorization can be done from within the menu or using the appropriate keyboard shortcut.

 

Personally I would rather prefer to setup a function which gets the solution for its scalar  argument beta and then call that function vectorized with your vector as function argument.

You may either turn a solve block into a function

Werner_E_4-1732388010907.png

or use the root function to do so

Werner_E_5-1732388051329.png

A numeric method in Prime will always just return one result depending on the given guess value and finding good guesses may be tricky sometime. A guess near to an expected solution might return another solution which is far away. And of course different guesses might result in the same solution.

 

 

Which way you choose, vectorization is always the key to success. Vectorization means that an equation or function which is written to deal with one single scalar argument can be used with a vector instead of the scalar and the elements of this vector are used as the scalar value

 

 

 

Werner_E
25-Diamond I
(To:Werner_E)

According finding all solutions of an equation within a given range, you sometime may have luck using the symbolics.

Sometimes its necessary to provide all values with integers only (83/100 instead of 0.83, etc.),

sometimes adding the modifier "fully" helps, sometime using the modifier "assume" (e.g. assume, 2<x<7) helps to get all solutions within a given range.

I had no luck doing so with your equation (or I was not patience enough to let the symbolic calc finish - it seems to run endless).

 

Here is a function which tries (no guarantee for success) to find all zeros of a function within a given range by using the root function with a lot of guess values (the last argument of that function), collecting all results, sorts the result and deletes duplicate value and also values which are outside of the given range.

 

The function works pretty well and fast with your equation.

Werner_E_0-1732392146036.png

NovaStark
4-Participant
(To:Werner_E)

Thank you very much for the detailed explanations. I guess it may be a bit easier to plot the graph and review.

 

However, I think I'll need to research some more into your other function to fully understand it.

LucMeekes
23-Emerald III
(To:NovaStark)

 

You define a value for kappa, but it's not used.
LucMeekes_0-1732576015324.png

 

The roots to your equation appear to lie at a distance of about 1.5, starting around 1, so we can generate the guess values for beta:

LucMeekes_1-1732576096419.png

Note that these values are (slightly) different from the ones in your table. Accepting the symbolic result (2.665....) as truth for the second root, I had to set TOL to 10-14 to get a matching numeric result.

 

Success!
Luc

Announcements

Top Tags