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

problems with the conditional operator

SOLVED
-MFra-
Topaz I

problems with the conditional operator

Hello everyone,
why the program, reported below, does not work? There seem to be problems with conditional operators. In fact the program on the right, where no conditional operators appear, gives the required result.
I sincerely thank those who will find the error and all those who will try to solve it.

Attached is the worksheet.

test 3.jpg

1 ACCEPTED SOLUTION

Accepted Solutions

Re: problems with the conditional operator

Hello everyone!
I solved the problem this way:

test 3+.gif

test 3++.gif

View solution in original post

13 REPLIES 13

Re: problems with the conditional operator

The if() function and the if construct don't always work symbolically. The step function 'Phi()' may be a symbolic alternative:

LM_20191202_Conditional.png

Success!
Luc

Re: problems with the conditional operator

In this case, using the unit step is a real nonsense!

Re: problems with the conditional operator

You want something to work.... or not?

LM_20191203_Conditionally.png

Success!
Luc

Re: problems with the conditional operator

Incidentally, those simple theta's at the end of many of your if-blocks do not actually do something.

It's the final theta, at the end of the program that produces the result.

If you want your program to produce the result of the first if statement that is TRUE, you can use:

return theta

Where return is the programming construct, from the programming panel...

 

Success!
Luc

Re: problems with the conditional operator

... but it still doesn't work .....

 

 

Re: problems with the conditional operator

Sorry, I didn't want to suggest that changing it would solve your problem.
Luc

Re: problems with the conditional operator

The evaluation of the same logical equation in the comparisons takes on opposite values as seen in the photo, so nothing works.

test 4.jpg

Re: problems with the conditional operator

{Ah, picture cut & paste is back!}

Francesco, guarda qui:

LucMeekes_0-1575473105780.png

Successo!

Luc

 

Re: problems with the conditional operator

Luc,

thank you for the time and work dedicated to me, but your answer gives a different result from the one I expected and that you know what it is.

Re: problems with the conditional operator


@LucMeekes wrote:

{Ah, picture cut & paste is back!}

Yes and as I see you experience the same problem as I do: the inserted picture is far too small and of mediocre quality and looks rather bad. Its not inserted using the original dimension and is scaled differently compared to a pic inserted via "Insert Photo". 😞

 

!! The following is not contributing to this thread and is done for testing purposes only !!

Pic inserted via cut and paste:

Werner_E_0-1575488925347.png

 

Pic inserted using the "Insert Photos" button:

B.png

 

Pic inserted via cut & paste and the stretched to match approximately the size the above pic was automatically scaled to:

Werner_E_1-1575489041435.png

 

It looks like when we manually stretch the pic we get the a similar quality as when inserted via the button. Bad that we have to think about stretching the pic every time we insert one.

 

 

Re: problems with the conditional operator

I wanted to say that I also always use "insert photos" and it is not clear to me why the mentioned problem arises that is of poor quality of the photo.

insert photo.jpg

Re: problems with the conditional operator

This is what I get with Cut & Paste:

LucMeekes_0-1575566068117.png

In this case any difference in/issue with 'picture quality' could also be related to the type (resolution?) of the computer screen.

That is not the case when I select and copy a couple of regions from an active Mathcad sheet and paste that in this edit window:

LucMeekes_1-1575566316242.png

That's one method, actually the one I prefer since it does not require the intermediate steps required when I take a screenshot, paste it in a picture editing program (Paint) and select a rectangular part, copy that and  - finally - paste that in this edit box. The result of all that is:

LucMeekes_2-1575566451794.png

I find the first, simpler method to result in a sharper picture.

 

But, we're running off the topic of this thread... sorry.

Luc

Re: problems with the conditional operator

Hello everyone!
I solved the problem this way:

test 3+.gif

test 3++.gif

View solution in original post

Announcements
Check out the latest
Mathcad Tip
"PTC Mathcad 15 / Prime 1-6 Update."