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

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

Symbolic solution

JB_10220769
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


@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.

Werner_E_1-1663701322871.png

 

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".

Werner_E_2-1663702847323.png

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

Werner_E_0-1663701731304.png

 

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.

 

View solution in original post

14 REPLIES 14

May be it is help

All.png


@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.

Werner_E_1-1663701322871.png

 

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".

Werner_E_2-1663702847323.png

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

Werner_E_0-1663701731304.png

 

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.

 

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

LucMeekes
23-Emerald III
(To:JB_10220769)

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

LucMeekes_0-1663943875807.png

LucMeekes_2-1663943892515.png

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

LucMeekes_4-1663943971839.png

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

Be prepared for some strange results, since

LucMeekes_1-1663943884134.png

 

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

LucMeekes_0-1663945311377.png

and

LucMeekes_1-1663945323298.png

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

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.

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.

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:

Werner_E_1-1664810992436.png

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

Werner_E_2-1664811877293.png

but rather like this:

Werner_E_3-1664811908385.png

 

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?

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.

 

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?

You may use Primes numeric methods.

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

a) providing a guess value

Werner_E_0-1666298133467.png

or by

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

Werner_E_1-1666298178902.png

 

or you may use (an uglier looking) solve block

Werner_E_2-1666298219196.png

 

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 

JB_10220769_0-1666374372157.png

 

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

Werner_E_0-1666377491548.png

 

 

ttokoro
20-Turquoise
(To:JB_10220769)

In this case Prime 8 can do.

image.png

 

Top Tags