Quantcast
Channel: Latest Discussions - COMSOL Forums
Viewing all articles
Browse latest Browse all 5773

flip the sign of a variable

$
0
0

I am running a time dependent simulation and I want to change the sign of a variable when a certain event occurs. I have defined a variable called u and I need to be able to make the statement u=-u. I have tried many variations of this: u=if(event, -u,u) but this gives a circular dependency error. I have also tried adding 'withsol' to this statement but that does not work either. Does anyone know how I might accomplish this?


Viewing all articles
Browse latest Browse all 5773

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>