Skip to main content
-MFra-
21-Topaz II
Solved

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

-MFra-
-MFra-Answer
21-Topaz II

Hello everyone!
I solved the problem this way:

test 3+.gif

test 3++.gif

13 replies

23-Emerald V

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

Translate
-MFra-
-MFra-21-Topaz IIAuthor
21-Topaz II

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

Translate
23-Emerald V

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

LM_20191203_Conditionally.png

Success!
Luc

Translate
23-Emerald V

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

Translate
-MFra-
-MFra-21-Topaz IIAuthor
21-Topaz II

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

 

 

Translate
23-Emerald V
Sorry, I didn't want to suggest that changing it would solve your problem.
Luc
Translate
-MFra-
-MFra-21-Topaz IIAuthorAnswer
21-Topaz II

Hello everyone!
I solved the problem this way:

test 3+.gif

test 3++.gif

Translate