Get Help

Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Community
- :
- PTC Mathcad
- :
- PTC Mathcad
- :
- Re: The command "if" in 3D solutions and graphs

Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

12-01-2020
06:06 AM

12-01-2020
06:06 AM

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.

Solved! Go to Solution.

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

12-01-2020
06:26 AM

12-01-2020
06:26 AM

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

12-01-2020
06:26 AM

12-01-2020
06:26 AM

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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

12-01-2020
07:46 AM

12-01-2020
07:46 AM

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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

12-01-2020
08:41 AM

12-01-2020
08:41 AM

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

@ptc-3682623 wrote:

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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

12-01-2020
09:16 AM

12-01-2020
09:16 AM

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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

12-01-2020
09:35 AM

12-01-2020
09:35 AM

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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

12-03-2020
07:57 AM

12-03-2020
07:57 AM

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

Thanks for it that's it:)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

12-07-2020
02:36 PM

12-07-2020
02:36 PM

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

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

12-07-2020
05:34 PM

12-07-2020
05:34 PM

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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

12-13-2020
07:34 AM

12-13-2020
07:34 AM

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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

12-13-2020
09:02 AM

12-13-2020
09:02 AM

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

@ptc-3682623 wrote:

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

12-13-2020
11:40 AM

12-13-2020
11:40 AM

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 -

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

12-13-2020
10:32 PM

12-13-2020
10:32 PM

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

@ptc-3682623 wrote:

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?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

12-17-2020
05:05 AM

12-17-2020
05:05 AM

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

12-17-2020
10:35 AM

12-17-2020
10:35 AM

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

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

You didn't made your function unitless!