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

SOLVED
Garnet

## The command "if" in 3D solutions and graphs

I have problem with the command "if" in 3D solutions and graphs. In the sample you can find my mistake and please help what we can do with it.

1 ACCEPTED SOLUTION

Accepted Solutions

## Re: The command "if" in 3D solutions and graphs

You can't have a variable/constant and a function using the same name. Actually you can use the same name if you use different styles, but i would suggest that you use different names.

If you had in mind to just cut off negative values and replace them for zero, you may end the solve block with

and use something like

You could also use

but thats inefficient because the solve block is called twice that way.

14 REPLIES 14

## Re: The command "if" in 3D solutions and graphs

You can't have a variable/constant and a function using the same name. Actually you can use the same name if you use different styles, but i would suggest that you use different names.

If you had in mind to just cut off negative values and replace them for zero, you may end the solve block with

and use something like

You could also use

but thats inefficient because the solve block is called twice that way.

## Re: The command "if" in 3D solutions and graphs

Is possibility to solve equation with precision 1*10-6 or higher?Now is 1*10-2 if we use F and G new guidelines in sample.

## Re: The command "if" in 3D solutions and graphs

@ptc-3682623 wrote:

Is possibility to solve equation with precision 1*10-6 or higher?Now is 1*10-2 if we use F and G new guidelines in sample.

Not sure what you mean?

What you do does not make much sense to me as you set up a solve block to calculate a specific value but at the end you assign the value manually with just three valied digits (

How do you know that the precision isn't high enough and what do F and G have to do with the precision?

Mathcad like many other numeric math programs work by storing its number in IEEE format. So most programs suffer from the very same precision lack. Symbolic math usually is done with much higher precision but has its own drawbacks.

## Re: The command "if" in 3D solutions and graphs

This means we have solution only one of 3 equations in sample, one is solved by find and the otders are F and G. All must to be solved with higher precision. We looking for lambda of 3 eqantions. We have to 3 equantions where we looking for only one lambda. In otrer words we have plastic eqantion and equilibrium equations. All of it must be satisfy. This solusion what I have is in GPa (GigaPascal) and my mistake is in GPa. The load I have q = 72MPa and therefore I need to reset them. Now my solusion is not stable. We can do it with newton-raphson method but how??Look at sample.

## Re: The command "if" in 3D solutions and graphs

Three equations for just one variable usually have no solution at all. But you may try putting all three equations in the solveblock and use "MinErr" instead of "Find". Mathcad so will not try to find a perfect solution but kind of a best fit, trying to minimize the overall errors. Not sure if this would make the error much smaller in your case, but it may be worth a try.

As Mathcad works with the absolute values you provide and they are rather small as they mean GPa to you, it could also help to set up all the relevant numbers to represent MPa or even kPa. Working with larger numbers means that Mathcad also considers an error to be larger and its numeric algorithms may try harder to compensate. Mathcad sees the errors as absolute value and NOT relative to the other values in use.

## Re: The command "if" in 3D solutions and graphs

Thanks for it that's it:)

## Re: The command "if" in 3D solutions and graphs

I'm going to present only Sigmaxxp, for λ>0 How can I do?

## Re: The command "if" in 3D solutions and graphs

The function you define is dependent on THREE arguments (lambda, x and y). You can only plot functions dependent on TWO arguments with the 3D plot. Thats exactly what the error message is telling you.

Its still confusing that you use the very same name for a function and soon after for a variable.

## Re: The command "if" in 3D solutions and graphs

Now is ok, but I'm returning to my question how can I plot 3D graphs only for lambda >0. This means graphs of sigmaxx must to be similar to lambda where we plot only lambda>O. We need plot strees only in this parts where lambda >0. If this is not clear what I want to do ask me.

Tags (1)

## Re: The command "if" in 3D solutions and graphs

@ptc-3682623 wrote:

Now is ok, but I'm returning to my question how can I plot 3D graphs only for lambda >0. This means graphs of sigmaxx must to be similar to lambda where we plot only lambda>O. We need plot strees only in this parts where lambda >0. If this is not clear what I want to do ask me.

You would have to define an auxiliary function which returns the function value of sigma if lambda is positive and a dummy value otherwise. Unfortunately unlike 2D-plots we cannot use "NaN" as value in a 3D plot in Mathcad. So I guess you will have to settle with a dummy value which fits best. Note that the coloring will change if you use a dummy value outside the normal range of function values of sigma. So in the picture below I tried to use the maximum value of sigma for this dummy. You may experiment with other values.

MC15 sheet attached

## Re: The command "if" in 3D solutions and graphs

Thanks for it, but how present min max on the same graphs? Must be the same on the top as on the bottom but with the sign -

## Re: The command "if" in 3D solutions and graphs

@ptc-3682623 wrote:

Thanks for it, but how present min max on the same graphs? Must be the same on the top as on the bottom but with the sign -

Its not clear what you mean!?? Your question was to avoid the plotting where lambda is negative or zero and I suggested to replace the values with negative lambda by the max of the sigma values.

What do you mean with "present min max on the same graphs" and how does it relate to your question?

## Re: The command "if" in 3D solutions and graphs

Thanks for it:) Now I do not know what is wrong with it. I promise you it will be the last one question if all be ok. Look at attachment

Tags (1)

## Re: The command "if" in 3D solutions and graphs

I stopped at the first error shown-up in your sheet.