How to choose lag value dde23 (lags)
Show older comments
Hello,
I am attempting to get to grips with dde23 (and the ode solvers for that matter).
System being modeled: An oscillating force is applied to a piston which pressurises a liquid until a valve opens. Within the piston is a bag of gas which has a varying pressure and volume (this bag allows the piston to move even if valves are closed).
The system of equations are as follows:
% y1 = position
% y2 = velocity
% y3 = volume
% y1' = velocity
% y2' = acceleration = sum of forces / mass
% y3' = change in volume with respect to time = change in volume/ change in time
y1 ' = y2
y2' =(7.3e5 + 2e5*sin(t)-1.9e5./max(0.0733,min(Z(3)-((y(1)-Z(1))*0.12),0.1))^1.4*0.12)/6.7e5
if y3 > 0.1
y3' = 0
elseif y3 < 0.0733
y3' = 0
else 0.0733 < y3 < 0.1
y3' = -((y(1)-Z(1))*0.12)/lag
end
The issue: I feel like provided the time lag is small enough to capture changes in variables and large enough that rounding errors do not affect results, different lags should give the same results. however that is not the case and I cannot decide what lag to use. The following image shows the results for position (top axis) and volume (bottom axis). As you can see the results vary a lot in this small range of lags and also the location of the lines are not predictable.

lag=0.01 % middle line
lag=0.011 % top line
lag=0.012 % middle line
lag=0.013 % bottom line
lag=0.014 % middle line
lag=0.015 % middle line
Answers (2)
Leo
on 10 Jan 2014
0 votes
Chin Wan Elijah
on 26 Aug 2014
0 votes
I think it's 'dde23' that has constant lag, if you want to use continuous lags, you may want to use other function more information from here:http://www.mathworks.co.uk/help/matlab/delay-differential-equations.html
Categories
Find more on Biotech and Pharmaceutical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!