Quantcast
Channel: PTC Community: Message List
Viewing all articles
Browse latest Browse all 12488

Re: ODE Solve Blocks with conditional statements used to switch equations

$
0
0

So to (hopefully) finish it up - this really was a tough one.

 

I don't think that the function you provided are correct. I doubt about the step at 10cm in Q_SCout(H_SC) and especially I am pretty sure that your Q_LCout is wrong - for H_LC only slighty higher than H_SC I would expect a very low flow rate. Your functions doesn't take in acount H_SC at all.

 

I finally got the whole sh....eet to work but its pretty instable. If I only multiply all IN_SC(t) values by 1.1 the solve block fails again - probably because of wrong formulas(?) used. Multiplying by 1.05 works and shows, that h_LC can also rise above the spill level.

 

What did I change to make it work:

1) I assured that your functions will return 0 if a height is negative (which it will be and thats one reason the block failed)

2) I modified your Q_LCout so that your routine is fed with the height difference of the two chamber rather than just with the height of the large compartment. I don't think that this is correct, but it seems at least more reasonable than what you provided (see above). I don't fully understand what you do with your QSorifice, but I guess its a difference if two chambers, both filled with water, are connected by a valve, or if a chamber is emptied by a drainage. You use the very same formula for both.

3)  I made a wrapper for IN_SC(t) to assure that only positive input is applied, negative values are set to 0. This is not absolutely necessary to make the block work but it seems to be reasonable and disabling that warpper shows a strange effect in that the large chamber never gets fully emptied - see yourself.

 

So now you have a working sheet and you can play around with the various functions yourself to hopefully find the best ones describing the physics behind the scenario.

25.03.png


Viewing all articles
Browse latest Browse all 12488

Trending Articles