Skip to main content
21-Topaz II
December 2, 2019
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-Answer
21-Topaz II
December 7, 2019

Hello everyone!
I solved the problem this way:

test 3+.gif

test 3++.gif

13 replies

23-Emerald IV
December 2, 2019

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-21-Topaz IIAuthor
21-Topaz II
December 3, 2019

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

Translate
23-Emerald IV
December 3, 2019

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

LM_20191203_Conditionally.png

Success!
Luc

Translate
23-Emerald IV
December 3, 2019

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-21-Topaz IIAuthor
21-Topaz II
December 4, 2019

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

 

 

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

Hello everyone!
I solved the problem this way:

test 3+.gif

test 3++.gif

Translate