How to use Matlab to solve LOGISTIC equation As for the solution of Lyapunov equation, you can look it up. The following is a post I wrote, which explains in detail how to solve Lyapunov equation with MATLAB. You can refer to it
Matlab solutions of Lyapunov, Sylvester and Riati equations. /thread -539- 1- 1.
Dynamic percentage
% See also: Matt Labsky.
% contact me at matlabsky@gmail.
%2009.2.
%
Urgent ~ how to use MATLAB to solve the coefficient of higher order equation becomes the following equation according to the meaning of the question
%a+x( 1)*b+x( 1)^2*c+x( 1)^3*d=y( 1);
%a+x(2)*b+x(2)^2*c+x(2)^3*d=y(2);
%a+x(3)*b+x(3)^2*c+x(3)^3*d=y(3);
% is written in matrix form: xx (3 * 4) * aa (4 * 1) = y (3 * 1), where 3 *1represents 3 rows1columns.
x =; % coefficient matrix
b =;
y0=,); ? ? Execute the above code directly on the command line, which is an example that comes with matlab. In workspace, you will see an extra variable named sol. Yes, this is the return value of the solver. Is the structure of 1* 1. Double-click it and you will see its internal organization, various fields and their "shapes". You can double-click each one and continue to look at its structure. I only care about x, ysolverextdata, x, y, stats, idata = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =? The first thing, of course, is to get the results. ? ? deval(sol,x, 1)? ? Sol As mentioned above, the variable name written on the left of solving the equal sign is the returned handle. X is a set of vectors, which is the point you expect to evaluate. The number 1 indicates the value of the first line of y you want (this is the case when solving differential equations. If you don't know what the first line means, double-click sol and then double-click y). If 1 is removed, the matrix will be returned, that is, all y values. Run the following code on the command line of matlab: sol=ode45(@vdp 1,,); x=linspace(0,20, 100); y=deval(sol,x, 1); plot(x,y); ? ? In addition, we can extend it. matlab is called odextend. Expand what? ? ? odextend(sol,odefun,tfinal)? Look at the last variable name, t_final, which is obvious. That is to say, the differential equations I calculated before were originally calculated to t 1, and now I continue to calculate to the new t_final. By default, the final value of y calculated last time is taken as the initial value of this calculation. ? ? odextend(sol,odefun,tfinal,yinit)? ? Of course, if you want to give it an initial value, you can also add the parameter yinit. (Friendly tip: Get the final value of y calculated last time: y=sol.y (:,end))? ? sol=odextend(sol,@vdp 1,20); plot(sol.x,sol.y( 1,))= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =? ? 3. The parameter setting of the solver is an option. Since it is an option, you can set it by default. ? ? To set it, you can use the command odeset. How to use it? ? Option=odeset ('name 1', value 1,' name 2', value 2 ...)? (All the parameters of matlab are basically set in this form)? ? Names are naturally attribute names. Value is the value you give it. What parameters can the solver set, what are the effects of setting these parameters, and what should these parameters be set? Enter help odeset:D at the command line. What I saw was definitely more detailed than what I said. So I won't say much. (Friendly reminder, if you use ode 15 or something, you can set the parameter Jacobian for it to solve it faster, more accurately and better. How to set it? If you don't understand, I will post it later. )? ? O=odeget(option,' name ')? If you have compiled the GUI, these two commands are familiar: d