y 1 = dsolve(' D2y+4 * Dy+29 * y = 0 ',' Dy(0)= 15 ','? y(0)=0 ',' x ')
y 1=(3*sin(5*x))/exp(2*x)
y2 = dsolve(' D2y-2 * Dy+5 * y = sin(2 * x)')
y2=sin(2*x)/5? +? C5*cos(2*t)*exp(t)? +? C6 * sine (2 * t)* experience (t)
For the third question, then we can't find a general solution, and we can only solve it by numerical solution. The numerical solution adopts the method of ode45 function, and the specific process is as follows:
Write the differential equation function that requires solution first, and open the editor:
% Write the function expression of the differential equation group to be solved!
Function? dy? =? Stiffness (t, y)
dy? =? Zero (3,1); %? Define array functions!
dy( 1)? =? y(2)? *? y(3); % the first differential equation;
dy(2)? =? -y( 1)? *? y(3); % second order differential equation;
dy(3)? =? -0.5 1? *? y( 1)? *? y(2); % third order differential equation;
And save the function file with the default file name!
Write command line to solve differential equation;
Options? =? odeset('RelTol ', 1e-4,' AbsTol ',[ 1e-4? 1e-4? 1e-5]); The% definition solution option contains precision items!
[T,Y]? =? Ode 45(@ Rigid, [0? 12],[0? 1? 1], option); % use ode45 to solve the equations, and save the solution results in the array T, Y!
Plot (t,y(:, 1),' r-',t,y(:,2),' b-',t,y(:,3),' K.')% drawing!
Grid? Secondary% grid!
Run the above code to get the solution of the function:
Attach a picture!
Ask me questions! !