How to choose lag value dde23 (lags)
이전 댓글 표시
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
답변 (2개)
Chin Wan Elijah
2014년 8월 26일
0 개 추천
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
카테고리
도움말 센터 및 File Exchange에서 Biotech and Pharmaceutical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!