cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

No Sharp Corners Allowed

HarveyHensley
3-Visitor

No Sharp Corners Allowed

The ODE and PDE routines don't like abrupt changes (i.e. corners) when the routine includes an error criteria.  One of two things may happen: the integration stops with an error, or the step size gets very, very small.  This can happen even when the change is just a linear ramp between two values, not a step change.  To most integration routines, the change to a ramp from a constant value is still an abrupt change in slope.  As has been mentioned elsewhere (can't find it now), the real world doesn't have as many abrupt changes as we often believe.  There is often a capacitance in the system or a lag in the controller elements that make the variable of interest change smoothly to the new value. 

Long ago I got tired of inputing a series of points that made the variable take on an "S" shape in the transition.  I finally settled on a cubic function that works well.  The function is dimensionless, so it can be applied to any system.  After using it for several years just to change a single variable, such as a flow rate to a pipeline or reactor, I decided to try using it to transition between two functions.  It worked!  Now I could transition between one viscosity relationship above the cloud point and another relationship below the cloud point.  Or, I could use it to transition between the laminar and turbulent friction factors.  This latter example is shown in the graph below and also in the document provided here.

Capture.JPG

This function can be used to come very close to a step change without causing a problem for the integration routine.  I use it so much I usually can copy it from the last worksheet that I built instead of going to my template folder.

0 REPLIES 0
Top Tags