I need this function in MATLAB or MAPPLE ITS AN EMERGENCY y\' = x^2 +y^2 , y(0)
ID: 3348439 • Letter: I
Question
I need this function in MATLAB or MAPPLE ITS AN EMERGENCY y' = x^2 +y^2 , y(0) = 0 ; 0 ? x ? 1 and downhere are the poitns !!
0.1 0.02 2 0.4 0.030022207 0.5 0.055112341 0.6 0.091416078 0.7 0.141251768 0.8 0.207246974 0.9 0.292542105 0.3 0.002800021 0.4 0.006000178 0.5 0.011000898 0.6 0.018203318 0.7 0.028009945 0.8 0.040825636 0.9 0.057058971 1 0.077124086 1.1 0.101443048 1.2 0.130448862 0.8 0.008160205 0.9 0.011400471 1.1 0,538188329 1.2 0.711152997 1.3 0.930726856 1.4 1.213352104 1.5 1.585574436 1.6 2.092979066 1.7 2.820035203 1.8 3.939295057 1.9 5.852099612 2 9.676806599 1.4 0.204330992 1.5 0.250166015 1.6 0.302617676 1.7 0.362249225 1.8 0.429673715 1.9 0.505566105 2 0.590678047 1.1 0.02024194 1.2 0.026003579 1.3 0.032766284 1.4 0.040610578 1.5 0.049617175 1.6 0.059867023 1.7 0.071441359 1.8 0.084421774 1.9 0.098890282 1.5 0.009920137 1.6 0.011968216 1.7 0.014280331 1.8 0.016872494Explanation / Answer
clc;
clear all;
f=@(x,y)x^2+y^2; % function
a=0;% lower limit
b=1;% upper limit
h=0.1 ;% step size
N=(b-a)/h; % number pf steps
x=a:h:b;
y(1)=0; %Intial condition
for i=1:N
y(i+1)=y(i)+h*f(x(i),y(i)); %Euler method formula
end
disp(' x (y) Euler method ' )
disp('___________________________________________________________________')
for i=1:N+1
fprintf('%f %10f ', x(i),y(i))
end
%%% Solution
x (y) Euler method
___________________________________________________________________
0.000000 0.000000
0.100000 0.000000
0.200000 0.001000
0.300000 0.005000
0.400000 0.014003
0.500000 0.030022
0.600000 0.055112
0.700000 0.091416
0.800000 0.141252
0.900000 0.207247
1.000000 0.292542
>>
h =
0.0200
x (y) Euler method
___________________________________________________________________
0.000000 0.000000
0.020000 0.000000
0.040000 0.000008
0.060000 0.000040
0.080000 0.000112
0.100000 0.000240
0.120000 0.000440
0.140000 0.000728
0.160000 0.001120
0.180000 0.001632
0.200000 0.002280
0.220000 0.003080
0.240000 0.004048
0.260000 0.005201
0.280000 0.006553
0.300000 0.008122
0.320000 0.009923
0.340000 0.011973
0.360000 0.014288
0.380000 0.016884
0.400000 0.019778
0.420000 0.022986
0.440000 0.026524
0.460000 0.030411
0.480000 0.034661
0.500000 0.039293
0.520000 0.044324
0.540000 0.049771
0.560000 0.055653
0.580000 0.061987
0.600000 0.068792
0.620000 0.076086
0.640000 0.083890
0.660000 0.092223
0.680000 0.101105
0.700000 0.110557
0.720000 0.120602
0.740000 0.131261
0.760000 0.142557
0.780000 0.154516
0.800000 0.167161
0.820000 0.180520
0.840000 0.194620
0.860000 0.209489
0.880000 0.225159
0.900000 0.241661
0.920000 0.259029
0.940000 0.277299
0.960000 0.296509
0.980000 0.316699
1.000000 0.337913
>>
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.