Search found 4 matches

by alliecase
Thu Apr 09, 2020 3:06 pm
Forum: Vensim
Topic: using IF THEN ELSE for creating max/min values
Replies: 5
Views: 2337

Re: using IF THEN ELSE for creating max/min values

It's probably a parentheses nesting problem. It's better if you make the sin wave a separate variable, then clip it in another equation. Also, the parameters should be made into variables so that units balance. For example: sinwave = amplitude*SIN( (Time-PhaseShift)/period*2*3.1415926 ) clippedSinw...
by alliecase
Sun Apr 05, 2020 4:38 pm
Forum: Vensim
Topic: using IF THEN ELSE for creating max/min values
Replies: 5
Views: 2337

Re: using IF THEN ELSE for creating max/min values

I also tried nesting again this morning, with an error that I'm expecting an operator.

IF THEN ELSE(((sine wave*0.13852)+0.28775) <= 0.148 , 0.148, IF THEN ELSE(sine wave*0.13852)+0.28775) >= 1.0 , 1.0, (sine wave*0.13852)+0.28775)))
by alliecase
Sun Apr 05, 2020 4:23 pm
Forum: Vensim
Topic: using IF THEN ELSE for creating max/min values
Replies: 5
Views: 2337

Re: using IF THEN ELSE for creating max/min values

Will the min or max functions work? For example, value = max ( 0.148, min ( 1, sine wave ) ) Doing this resulted in the proper boundaries, but removed the sine wave increasing in amplitude over time. The sine wave will not hit these bounds until timestep = 50 or 60 years and the function is increas...
by alliecase
Fri Apr 03, 2020 8:34 pm
Forum: Vensim
Topic: using IF THEN ELSE for creating max/min values
Replies: 5
Views: 2337

using IF THEN ELSE for creating max/min values

I know this is a similar post to one that discussed how to create multiple IF THEN ELSE statements/also using LOOKUP functions, but I haven't had success with the solutions proposed yet. I have a sine wave that I am using to create a pattern of mortality rates. I do not want the mortality rate to re...