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

Translate the entire conversation x

Solving for unknown variable

IA_12699372
3-Newcomer

Solving for unknown variable

Could anyone suggest how I can setup a function within Mathcad to resolve the attached expression where I am looking to find theta? 

ACCEPTED SOLUTION

Accepted Solutions

Hi,

Can  you upload the Prime file please?

Cheers

Terry

View solution in original post

11 REPLIES 11

Hi,

Can  you upload the Prime file please?

Cheers

Terry

Hi

Capture.JPG

Hi Terry, 

 

See attached Mathcad sheet, refer to page 12. 

 

Many thanks,

Iain 

Hi,

see the file

Cheers

Terry

Thank you Terry, 

Are you able to send a screenshot of your solution? Can't open your mathcad file using the version I have (Prime 10.0.0.0). 

Kind regards,

Iain 

Hi,

Version 10 of file

Thanks Terry, 

Changing the variables seems to have no impact on theta - strange, I'll need to revisit my expression. 

Kind regards,

Iain 

Werner_E
25-Diamond I
(To:IA_12699372)

Your result sure is dependent on F.ave and m only, h cancels.

You can use the symbolic solve before you define any variables (or after you use the clear.sym command on them)

Werner_E_0-1756831969614.png

These are the two basic solution and you get all other solutions by adding or subtracting multiples of 2 pi (360!).

Primes symbolics should be able to show this by using the "fully" modifier, but unfortunately is not capable to do so in a clear way:

Werner_E_1-1756832083975.png

Old real Mathcad is doing better here:

Werner_E_2-1756832131785.png

Its necessary to tell the symbolics that g, m and also F.ave are real and positive values. As already written in my first reply, the symbolics does not know anything about units and pre-defined constants.

 

 

 

Werner_E
25-Diamond I
(To:IA_12699372)

Its always a good idea to attach the Prime sheet itself and also state which version you are using (especially if you don't use the latest current version).

In the meantime you provided your sheet and also told us that you are using P10.

 

Actually what you did in your sheet worked, even though the result seems to look somewhat strange. The reason for this is that the symbolic engine in Prime unfortunately does not know anything about units and treats units as unknown variables. So it can't simplify the result.

A numeric evaluation (a simple = at the end) can do the job:

Werner_E_0-1756828886795.png

For this numeric evaluation to work you have to activate "Units/Constants in Symbolics" in the Calculation Options and then recalc the worksheet (Ctrl+F5). The symbolics still does not know anything about units but this option should ensure that units and constants (like g) remain labeled as units or constants.

Werner_E_1-1756828985205.png

As we can see returns the symbolics two different solutions and both are correct. Actually your equation has an infinite number of solutions.
The "assume" modifier should be able to select the solutions within a desired range, but this usually does not work as expected and in your case we have the additional problem of the units which the symbolics can't handle.

 

As you are just after a numeric result, I would second Terry's suggestion to use a numeric method like the "root" function. To be able to do so you have to get rid of the red errors (which affect the numeric engine but not the symbolic) by turning the expressions into function of the unknown angle theta as shown by Terry.

Then based on the equation you want to solve define a function f(theta) with the solutions as its zeros.

This function can now be used in the "root" function to get the solution within a desired range. You may be interested in the solution which is greater than zero but smaller than 360°

Werner_E_4-1756830293794.png

 

The "root" can also be used in a second way by providing a guess value:

Werner_E_3-1756830099760.png

As the last example shows there is no guarantee that the solution found will be near the guess, though.

 

Prime 10 sheet attached

 

 

Many thanks Werner,

How have you prepared this graph? 

Kind regards, 

Iain 

Werner_E
25-Diamond I
(To:IA_12699372)


@IA_12699372 wrote:

Many thanks Werner,

How have you prepared this graph? 

?? There is nothing hidden and you can see in the sheet how its done.

 

EDIT: Ahh, actually there is something hidden! 😉

I used the so called quickplot feature which allows to use an undefined variable (in this case q) at the abscissa and as function argument.

Normally Prime would choose a range from -10 to +10 for q which is far to less if we use degree for the unit (has to be manually typed in in the appropriate place holder). To get a wider range for q we have to edit the plot. We can edit the first, second and last value on each of the two axis. I used -240, -180 and 400 (Prime automatically extends to 420) and did not change the automatically chosen values on the ordinate axis (but I had chosen MN*m for the unit instead of the default Joule).

 

A suitable (and often preferable) alternative to using the quickplot feature is to provide a range variable for the abscissa. It gives better and more visible control over the range to be plotted. But you can't set the scale step width (60 in the example I posted, the difference between the second and first value) that way.

Werner_E_0-1756833504392.png

 

Announcements


Top Tags