MATLAB for solving delayed Differential Equations

Source: Internet
Author: User

MATLAB solves the delayed differential equation. dde23 call format:

Sol = dde23 (ddefun, lags, history, tspan );

-- Ddefun function handle, solving the Differential EquationY' = f (t, y (t), y (t-Tau 1),..., y (t-Tau k ))

It must be written in the following format:

Dydt = ddefun (T, y, z );

T corresponds to the current time t, and Y is the column vector, which is similar to Y (t); Z (:, j) is similarY (t-Tau J)

-- LagsIs the delay time, positive constant.

For example, if the equation contains y1 (t-0.2) and Y2 (t-1), it can be expressed as lags = [0.2, 1]

-- History T ≤ t0 value of the state variable

-- Tspan integral range T0 = tspan (1), TF = tspan (end ).

 

* Note: The structures Sol. X and Sol. y returned by this function are arranged in rows, which are different from those returned by ode45.

 

Take the following example:

Assume that the system state equation is dxdt = AX (t) + bX (t-0.23) + bX (t-0.56); A = [1,-1;], B =; 1, 4].

The procedure is as follows:

(1) Write latency Functions

function dx = ddefun(t,y,Z)A = [0,1;0,j];B = [0,0;-1,-3];tau1= Z(:,1);tau2= Z(:,2);v=A*y+B*ylag1; 

 

(1) Compile the main function

  

MATLAB for solving delayed Differential Equations

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.