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
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.

Announcements