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

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

Translate the entire conversation x

Solving for unknown variable

BV_10792443
6-Contributor

Solving for unknown variable

BV_10792443_0-1757014880458.png

Trying to Solve for Va as a variable.  Used "Solve, Va" and tried using the find (Va) function but it wont give me anything. 
Does anyone know any Tricks to this? 

7 REPLIES 7
Werner_E
25-Diamond I
(To:BV_10792443)

You should post your worksheet, not just a picture.

 

The picture shows that you are using the free but limited Prime Express version.

Neither the symbolic "solve" nor a solve block with "find" are available in this version.

You may try the "root" function - look it up in the help.

 

ppal
17-Peridot
(To:BV_10792443)

You have a picture where you have cut off the units of Q - this is the classic "makes it difficult when you don't have the full picture."

Werner_E
25-Diamond I
(To:ppal)

Actually the unit of Q does not matter when the question is just about solving the equation. The unit of the solution Va is unit_of_Q/m^2.

 

Its quite likely that Q is volumetric flow rate with unit m^3/s and so Va ends up as velocity (e.g. unit m/s)

 

The equation in question is quadratic, so we have to expect two solutions.

A plot can help to determine suitable guesses or ranges to be used in the "root" function.

This solution works OK in Prime Express

Werner_E_0-1757025892521.png

As can be seen neither f(V1) nor f(V2) are exactly zero but only close. This is due to numerical inaccuracy and round off errors we get when we use numeric methods working on variables stored in IEEE format.

 

ppal
17-Peridot
(To:BV_10792443)

ppal_0-1757028531113.png

 

Werner_E
25-Diamond I
(To:ppal)

As already written, from the picture sent by the OP he/she is using Prime Express and so can't use a solve block.

Furthermore its questionable where you get your guess values from - its guess and check as well and in that case its always a good idea to plot and look where the solutions are to be expected..

Only a symbolic solve would give you both solutions without having to know in which range to look for them.

But your approach getting both values in one go is possible to do in Express as well. The "root" command can be used with a vector as a guess as in your approach with the solve block and the "root" function can be vectorized.

ppal
17-Peridot
(To:Werner_E)

I guess we could start from zero and  stop at the speed of light. Might cover the possibilities.

Werner_E
25-Diamond I
(To:ppal)

Again, if the OP is using Express. a solve block simply is not an option.

Furthermore I am not sure what you mean by "guess and check". Maybe you did not understand what I did.

Running with the guess value from zero to light speed in small steps could be done in Express using the "root" function as well. But there is no guarantee that you will get all zeros that way as there also is no guarantee that you always get a solution near a guess value. And yes, I would call that 'guessing' as well even if its done automatically in a loop or if you provide a huge guess vector and eliminate the duplicates in the result vector. And then, BTW, how did you know in your approach that you need guesses in the magnitude of a few thousand m/s ??

There is no 100% sure way to get all solutions of an equation using numeric algorithms - you have to solve it symbolically to achieve this goal and sure there are many equations which will withstand a symbolic solve.

So using numerics IMHO the best approach usually is to visualize the problem, make a plot (if possible), look at the approximate position of the solutions there and then choose the appropriate guesses or ranges for the numeric algorithm to do its job.

I sure posted here in the forum functions which try to automatically find all solutions, all zeros of a function within a given interval, some less, some more sophisticated. Most of them worked pretty well for "well-behaved" functions as we have it here, but none could really guarantee not to skip/overlook one solution ore more.

 

Announcements

Top Tags