Matrix input for Delayed Differential Equations
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Bearbeitet: d7366431 am 25 Dez. 2018
Hello, could you please help me with solving system of Delayed Differential equations with matrix input?
Initially my equation is looks like
τ - constant delay
X - is vector of n elements
c - constant
- diag. matrix of n elements
- vector of zeros, only first element is equal to
I decided to choose DDE23 solver, but I'm not sure is it correct or not. Would be great to here some comments.
I put "lags" as constant = , I'm not sure is it correct or not, my idea was to get data from previous timestep which is in my case is 1 as I put in tspan vector.
Also I decrease order of differential equation as
Could you please tell me is it correct solver for this task? I noticed that nothing is changes with changing delay value.
How can I display movement of last element of my system (n th element). Is it correct way how I did below?
Below is my Matlab Code with some comments:
tspan = 1:1:5;
%%sol = dde23( ddefile, lags, history, tspan);
sol = dde23( @dde, , @history, tspan);
ax1 = subplot(2,1,1);
ax2 = subplot(2,1,2);
xplot = 1:1:10;
yplot = deval(sol,xplot,size(n));
function xdot=dde(t,x,Z) % x - state of system (position of each block)
n=3; %number of elements for simplicity put 3 for now
% c matrix
% D Matrix
% M Matrix
%% The differential equations:
xlag = Z(1:n,1);
x1 = zeros(n,1);
x2 = zeros(n,1);
x1dot = zeros(n,1);
x2dot = zeros(n,1);
xdot = zeros(2*n,1);
x1 = xdot(1:n);
x2 = xdot(n+1:end);
x1dot = x2;
x2dot = v0*t-M*xlag-D*x1-C*x2;
xdot = [x1dot; x2dot];
function s = history(t)
Find more on Programming 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!