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

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

7-Bedrock

## Symbolic solution

How can I get only the positive solution for symbolic evaluated equation. I want to use the function "Z(a,s,x) in the equation for Max and return only result.

1 ACCEPTED SOLUTION

Accepted Solutions
24-Ruby V
(To:JB_10220769)

@JB_10220769 wrote:

How can I get only the positive solution for symbolic evaluated equation. I want to use the function "Z(a,s,x) in the equation for Max and return only result.

Prime cannot do so because the sign depends on the values of a and s. How should Prime decide for the symbolic expression to be positive or negative? Depending on a and s its sometimes the first and sometimes the second entry.

But if you are sure that both a and s will be only positive values you can tell the symbolics so using the "assume" modifier. Ever so often the symbolics will happily ignore it, but in  case of your example you are lucky and it works. Because we assume that a, s as well as x are positive, we can use "assume, ALL>0".

You may consider turning Max.T into a function of a and s.

The assume modifier was applied to the calculation of Max.T as well to avoid a result like

EDIT: Ah, I see that Valery was bit faster by suggesting the same modifier but in a different example. In his example, "assume, c>0" would probably have sufficed.

14 REPLIES 14
24-Ruby IV
(To:JB_10220769)

May be it is help

24-Ruby V
(To:JB_10220769)

@JB_10220769 wrote:

How can I get only the positive solution for symbolic evaluated equation. I want to use the function "Z(a,s,x) in the equation for Max and return only result.

Prime cannot do so because the sign depends on the values of a and s. How should Prime decide for the symbolic expression to be positive or negative? Depending on a and s its sometimes the first and sometimes the second entry.

But if you are sure that both a and s will be only positive values you can tell the symbolics so using the "assume" modifier. Ever so often the symbolics will happily ignore it, but in  case of your example you are lucky and it works. Because we assume that a, s as well as x are positive, we can use "assume, ALL>0".

You may consider turning Max.T into a function of a and s.

The assume modifier was applied to the calculation of Max.T as well to avoid a result like

EDIT: Ah, I see that Valery was bit faster by suggesting the same modifier but in a different example. In his example, "assume, c>0" would probably have sufficed.

7-Bedrock
(To:Werner_E)

Thanks @Werner_E  for the information But when I try to use the program  it does not let me evaluate conditional statement. Any thoughts?

23-Emerald III
(To:JB_10220769)

Yes, use the Heaviside step function, also known as the unit step function:

To test if, e.g. x>5, use:

If x<5 it will produce 0 (FALSE), if x>5 it will produce 1 (TRUE).

Be prepared for some strange results, since

Hmm, that was before looking at your sheet. After taking a peek, it would seem:

and

But this also gives no result.

Incidentally, what did you define R.R for? It is not used, you only use R.L...

Success!
Luc

24-Ruby V
(To:LucMeekes)

Using the step function may enable the symbolic to integrate or differentiate the function, but its doubtful that trying to solve for x will be crowned with success.
But in case of the present worksheet it can't work anyway! V.p actually is NOT dependent on x at all other than its a constant value if xis <= X and another constant value if x>X. If any of these two values is zero does not depend on x but only on X and/or S.

It doesn't make sense to solve this equation for x.

7-Bedrock
(To:Werner_E)

I tried to eliminate the step function and have the point load be a min width, that would eliminate the step. I still get the same error.

24-Ruby V
(To:JB_10220769)

As already mentioned, Primes symbolics will evaluate the expression before any specific values are substituted for the variables. So it does not (an cannot)  know anything about x and X and therefore is unable to evaluate the if x<=X statement. Thats what the error message "Unable to evaluate a conditional expression" is trying to tell you.

As I already suspected, using the Heaviside step function as suggested by Luc  does not solve the problem either:

BTW, your function V.Pz should not use the last argument "x" as seen in your sheet.

I also wonder what you expect as a solution for x??

Your function V.P is a step function which NEVER equals zero! The step occurs at x=X and you won't need a symbolic "solve" to arrive at this solution as this is simply the definition of V.P.

From a math point of view, your function does not look like

but rather like this:

7-Bedrock
(To:Werner_E)

Thank you for the information. I wanted to have x should be zero for Shear and X should return the result I am trying to make some generic function for such type any suggestion how can I achieve that it would return the result?

24-Ruby V
(To:JB_10220769)

As already explained its unclear for me which result you expect as in case of the function you showed there is no solution, no value where V.p would be zero.

7-Bedrock
(To:Werner_E)

The outcome for this specific solution I am expecting is ,
"The value of "x" where this statement is true is "X".

Mathcad has an error that it is "unable to evaluate a conditional expression."

The revised function VPoint has a unique value of V for every value of x, unlike the function at the top of the worksheet that did not have a unique solution at x=X. Therefore, I would expect Mathcad to find the solution x=X. Any thoughts how can i achieve that?

24-Ruby V
(To:JB_10220769)

You may use Primes numeric methods.

Either the "root" function, which can be used by

a) providing a guess value

or by

b) providing a range (here 5 ft to 15 ft)

or you may use (an uglier looking) solve block

7-Bedrock
(To:Werner_E)

I can understand the numeric methods. I am trying to get symbolic results can this not be solved symbolically?  Earlier there was a step function so it is understood but later it was eliminated and a sloping function was added I am confused why Mathcad cannot find symbolic solution

24-Ruby V
(To:JB_10220769)

The error message clearly states that the symbolic cannot evaluate that conditional expression. Reason behind is that the symbolic at first tries to symbolically evaluate an expression using generic variables just to put in the concrete variable values only afterwards. When evaluating a conditional branch using generic variables it cannot decide which branch to chose without using concrete values and so it fails.

Furthermore Primes symbolic would refuse to solve for a variable which is already assigned a value so you would have to define the range zz for plotting below or use a different variable name to solve for. But thats not the main problem in your case. The problem are the if's.

But of course your test function does not need any if-statement as a condition like x<=x-X/100 never can be true as long as X is a positive value. Similar for the other condition.

Of course the symbolic solve has no problems if the function is defined without using any if's

20-Turquoise
(To:JB_10220769)

In this case Prime 8 can do.

Announcements
Top Tags