Professional Documents
Culture Documents
Practicle No:-8: Function Xdot F (T, X) Xdot t-0.1 X 2
Practicle No:-8: Function Xdot F (T, X) Xdot t-0.1 X 2
Ans:-
command
M file:-
function xdot=f(t,x)
xdot=t-0.1*x^2;
command window
solution
t=
0
0.0800
0.1600
0.2400
0.3200
0.4000
0.4800
0.5600
0.6400
0.7200
0.8000
x=
1.0000
0.9952
0.9969
1.0049
1.0191
1.0395
1.0658
1.0980
1.1361
1.1798
1.2290
>> plot(t,x);
>> xlabel(' t');
>> ylabel('x');
>> title('Graph of solution');
Graph of solution
1.25
1.2
1.15
1.1
x
1.05
0.95
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8
t