uiopen('/home/accounts/personale/clrmrc90/aa1112/equazioni_differenziali/rk2.m', true);
options.InitialStep=0.01
options =
InitialStep: 0.0100
options.AbsTol=1e-4
options =
InitialStep: 0.0100
AbsTol: 1.0000e-04
options.RelTol=1e-4
options =
InitialStep: 0.0100
AbsTol: 1.0000e-04
RelTol: 1.0000e-04
ese4rk2
tout
tout =
Columns 1 through 4
0 0.0500 0.1000 0.1500
Columns 5 through 8
0.2000 0.2500 0.3000 0.3500
Columns 9 through 12
0.4000 0.4500 0.5000 0.5500
Columns 13 through 16
0.6000 0.6500 0.7000 0.7500
Columns 17 through 20
0.8000 0.8500 0.9000 0.9500
Columns 21 through 24
1.0000 1.0500 1.1000 1.1500
Columns 25 through 28
1.2000 1.2500 1.3000 1.3500
Columns 29 through 32
1.4000 1.4500 1.5000 1.5500
Columns 33 through 36
1.6000 1.6500 1.7000 1.7500
Columns 37 through 40
1.8000 1.8500 1.9000 1.9500
Columns 41 through 44
2.0000 2.0500 2.1000 2.1500
Columns 45 through 48
2.2000 2.2500 2.3000 2.3500
Columns 49 through 52
2.4000 2.4500 2.5000 2.5500
Columns 53 through 56
2.6000 2.6500 2.7000 2.7500
Columns 57 through 60
2.8000 2.8500 2.9000 2.9500
Columns 61 through 64
3.0000 3.0500 3.1000 3.1500
Columns 65 through 68
3.2000 3.2500 3.3000 3.3500
Columns 69 through 72
3.4000 3.4500 3.5000 3.5500
Columns 73 through 76
3.6000 3.6500 3.7000 3.7500
Columns 77 through 80
3.8000 3.8500 3.9000 3.9500
Columns 81 through 84
4.0000 4.0500 4.1000 4.1500
Columns 85 through 88
4.2000 4.2500 4.3000 4.3500
Columns 89 through 92
4.4000 4.4500 4.5000 4.5500
Columns 93 through 96
4.6000 4.6500 4.7000 4.7500
Columns 97 through 100
4.8000 4.8500 4.9000 4.9500
Columns 101 through 104
5.0000 5.0500 5.1000 5.1500
Columns 105 through 108
5.2000 5.2500 5.3000 5.3500
Columns 109 through 112
5.4000 5.4500 5.5000 5.5500
Columns 113 through 116
5.6000 5.6500 5.7000 5.7500
Columns 117 through 120
5.8000 5.8500 5.9000 5.9500
Columns 121 through 124
6.0000 6.0500 6.1000 6.1500
Columns 125 through 128
6.2000 6.2500 6.3000 6.3500
Columns 129 through 132
6.4000 6.4500 6.5000 6.5500
Columns 133 through 136
6.6000 6.6500 6.7000 6.7500
Columns 137 through 140
6.8000 6.8500 6.9000 6.9500
Columns 141 through 144
7.0000 7.0500 7.1000 7.1500
Columns 145 through 148
7.2000 7.2500 7.3000 7.3500
Columns 149 through 152
7.4000 7.4500 7.5000 7.5500
Columns 153 through 156
7.6000 7.6500 7.7000 7.7500
Columns 157 through 160
7.8000 7.8500 7.9000 7.9500
Columns 161 through 164
8.0000 8.0500 8.1000 8.1500
Columns 165 through 168
8.2000 8.2500 8.3000 8.3500
Columns 169 through 172
8.4000 8.4500 8.5000 8.5500
Columns 173 through 176
8.6000 8.6500 8.7000 8.7500
Columns 177 through 180
8.8000 8.8500 8.9000 8.9500
Columns 181 through 184
9.0000 9.0500 9.1000 9.1500
Columns 185 through 188
9.2000 9.2500 9.3000 9.3500
Columns 189 through 192
9.4000 9.4500 9.5000 9.5500
Columns 193 through 196
9.6000 9.6500 9.7000 9.7500
Columns 197 through 200
9.8000 9.8500 9.9000 9.9500
Columns 201 through 204
10.0000 10.0500 10.1000 10.1500
Columns 205 through 208
10.2000 10.2500 10.3000 10.3500
Columns 209 through 212
10.4000 10.4500 10.5000 10.5500
Columns 213 through 216
10.6000 10.6500 10.7000 10.7500
Columns 217 through 220
10.8000 10.8500 10.9000 10.9500
Columns 221 through 224
11.0000 11.0500 11.1000 11.1500
Columns 225 through 228
11.2000 11.2500 11.3000 11.3500
Columns 229 through 232
11.4000 11.4500 11.5000 11.5500
Columns 233 through 236
11.6000 11.6500 11.7000 11.7500
Columns 237 through 240
11.8000 11.8500 11.9000 11.9500
Columns 241 through 244
12.0000 12.0500 12.1000 12.1500
Columns 245 through 248
12.2000 12.2500 12.3000 12.3500
Columns 249 through 252
12.4000 12.4500 12.5000 12.5500
Columns 253 through 256
12.6000 12.6500 12.7000 12.7500
Columns 257 through 260
12.8000 12.8500 12.9000 12.9500
Columns 261 through 264
13.0000 13.0500 13.1000 13.1500
Columns 265 through 268
13.2000 13.2500 13.3000 13.3500
Columns 269 through 272
13.4000 13.4500 13.5000 13.5500
Columns 273 through 276
13.6000 13.6500 13.7000 13.7500
Columns 277 through 280
13.8000 13.8500 13.9000 13.9500
Columns 281 through 284
14.0000 14.0500 14.1000 14.1500
Columns 285 through 288
14.2000 14.2500 14.3000 14.3500
Columns 289 through 292
14.4000 14.4500 14.5000 14.5500
Columns 293 through 296
14.6000 14.6500 14.7000 14.7500
Columns 297 through 300
14.8000 14.8500 14.9000 14.9500
Column 301
15.0000
yout
yout =
0.5000 2.0000 10.0000
0.3028 4.8285 5.7727
0.1867 4.4238 3.5042
0.1254 3.8491 2.3278
0.0890 3.3293 1.6394
0.0661 2.8931 1.2087
0.0508 2.5330 0.9253
0.0403 2.2350 0.7308
0.0328 1.9858 0.5926
0.0273 1.7750 0.4913
0.0231 1.5944 0.4152
0.0199 1.4377 0.3568
0.0174 1.3001 0.3110
0.0154 1.1780 0.2747
0.0137 1.0686 0.2454
0.0124 0.9697 0.2215
0.0113 0.8793 0.2018
0.0104 0.7963 0.1855
0.0097 0.7193 0.1718
0.0090 0.6474 0.1604
0.0085 0.5798 0.1508
0.0080 0.5159 0.1426
0.0077 0.4551 0.1358
0.0073 0.3970 0.1300
0.0071 0.3410 0.1253
0.0069 0.2869 0.1213
0.0067 0.2342 0.1181
0.0066 0.1827 0.1156
0.0064 0.1321 0.1137
0.0064 0.0822 0.1125
0.0063 0.0327 0.1117
0.0063 -0.0167 0.1116
0.0064 -0.0662 0.1120
0.0064 -0.1160 0.1129
0.0065 -0.1663 0.1145
0.0066 -0.2175 0.1166
0.0068 -0.2697 0.1194
0.0070 -0.3234 0.1229
0.0073 -0.3788 0.1272
0.0076 -0.4362 0.1323
0.0079 -0.4961 0.1385
0.0083 -0.5590 0.1459
0.0089 -0.6253 0.1546
0.0095 -0.6958 0.1650
0.0102 -0.7712 0.1773
0.0110 -0.8523 0.1920
0.0121 -0.9403 0.2097
0.0133 -1.0365 0.2311
0.0148 -1.1426 0.2571
0.0167 -1.2608 0.2893
0.0191 -1.3936 0.3294
0.0220 -1.5446 0.3802
0.0259 -1.7183 0.4458
0.0310 -1.9208 0.5320
0.0379 -2.1600 0.6483
0.0475 -2.4467 0.8096
0.0614 -2.7947 1.0410
0.0823 -3.2208 1.3862
0.1153 -3.7393 1.9253
0.1704 -4.3381 2.8086
0.2665 -4.8846 4.3115
0.4336 -4.7907 6.8100
0.6607 -2.2798 9.8685
0.6599 3.3870 9.0718
0.3780 4.6473 4.9532
0.2416 4.1851 3.1028
0.1659 3.6429 2.0988
0.1198 3.1612 1.4986
0.0901 2.7572 1.1173
0.0701 2.4222 0.8632
0.0561 2.1435 0.6871
0.0460 1.9092 0.5608
0.0385 1.7099 0.4675
0.0328 1.5383 0.3970
0.0284 1.3887 0.3426
0.0249 1.2569 0.2998
0.0221 1.1395 0.2656
0.0199 1.0339 0.2380
0.0180 0.9381 0.2154
0.0165 0.8504 0.1967
0.0152 0.7695 0.1812
0.0141 0.6944 0.1682
0.0132 0.6240 0.1573
0.0125 0.5578 0.1482
0.0119 0.4950 0.1404
0.0113 0.4352 0.1339
0.0109 0.3778 0.1284
0.0105 0.3225 0.1239
0.0102 0.2689 0.1202
0.0099 0.2167 0.1172
0.0098 0.1655 0.1149
0.0096 0.1152 0.1132
0.0095 0.0654 0.1120
0.0095 0.0160 0.1115
0.0095 -0.0334 0.1115
0.0096 -0.0829 0.1120
0.0097 -0.1329 0.1131
0.0098 -0.1835 0.1148
0.0100 -0.2350 0.1171
0.0103 -0.2877 0.1201
0.0106 -0.3419 0.1238
0.0110 -0.3979 0.1283
0.0115 -0.4562 0.1337
0.0121 -0.5170 0.1402
0.0127 -0.5810 0.1479
0.0135 -0.6487 0.1570
0.0145 -0.7207 0.1679
0.0156 -0.7979 0.1808
0.0170 -0.8813 0.1962
0.0186 -0.9719 0.2148
0.0206 -1.0713 0.2373
0.0231 -1.1813 0.2648
0.0261 -1.3041 0.2989
0.0299 -1.4428 0.3415
0.0348 -1.6011 0.3958
0.0411 -1.7841 0.4662
0.0496 -1.9985 0.5594
0.0611 -2.2533 0.6859
0.0774 -2.5605 0.8629
0.1012 -2.9359 1.1193
0.1377 -3.3980 1.5063
0.1966 -3.9611 2.1183
0.2970 -4.6011 3.1326
0.4763 -5.1242 4.8619
0.7880 -4.7179 7.6244
1.1610 -1.2930 10.2305
1.0015 3.9526 7.6287
0.5984 4.3232 4.2882
0.3967 3.8825 2.7465
0.2793 3.3960 1.8845
0.2057 2.9635 1.3607
0.1572 2.5980 1.0239
0.1240 2.2924 0.7972
0.1003 2.0359 0.6387
0.0831 1.8187 0.5241
0.0701 1.6327 0.4391
0.0601 1.4714 0.3744
0.0524 1.3301 0.3242
0.0462 1.2050 0.2846
0.0412 1.0930 0.2529
0.0372 0.9919 0.2271
0.0338 0.8997 0.2060
0.0311 0.8151 0.1886
0.0288 0.7368 0.1741
0.0268 0.6638 0.1619
0.0252 0.5953 0.1517
0.0238 0.5306 0.1431
0.0227 0.4692 0.1358
0.0217 0.4104 0.1297
0.0209 0.3540 0.1246
0.0202 0.2994 0.1203
0.0197 0.2464 0.1169
0.0192 0.1947 0.1141
0.0189 0.1439 0.1120
0.0187 0.0938 0.1105
0.0186 0.0442 0.1095
0.0185 -0.0052 0.1091
0.0186 -0.0546 0.1092
0.0187 -0.1043 0.1099
0.0190 -0.1545 0.1111
0.0193 -0.2055 0.1129
0.0198 -0.2575 0.1153
0.0203 -0.3108 0.1184
0.0210 -0.3658 0.1222
0.0219 -0.4228 0.1268
0.0229 -0.4821 0.1324
0.0241 -0.5443 0.1390
0.0255 -0.6098 0.1469
0.0272 -0.6794 0.1562
0.0292 -0.7536 0.1673
0.0316 -0.8334 0.1805
0.0345 -0.9199 0.1963
0.0380 -1.0143 0.2153
0.0422 -1.1183 0.2384
0.0475 -1.2338 0.2668
0.0540 -1.3635 0.3020
0.0623 -1.5108 0.3462
0.0729 -1.6801 0.4027
0.0869 -1.8772 0.4764
0.1058 -2.1102 0.5744
0.1319 -2.3900 0.7085
0.1695 -2.7316 0.8975
0.2258 -3.1555 1.1739
0.3146 -3.6873 1.5954
0.4631 -4.3511 2.2692
0.7289 -5.1296 3.3944
1.2336 -5.7987 5.2974
2.1764 -5.3605 8.1169
3.3737 -1.5441 9.6022
3.0245 2.8253 5.5936
2.0864 3.2435 3.1364
1.5078 3.0630 1.9727
1.1301 2.7730 1.3283
0.8739 2.4812 0.9429
0.6945 2.2167 0.6989
0.5653 1.9845 0.5370
0.4697 1.7824 0.4253
0.3975 1.6062 0.3454
0.3418 1.4517 0.2867
0.2981 1.3150 0.2424
0.2633 1.1932 0.2083
0.2352 1.0837 0.1816
0.2122 0.9844 0.1604
0.1933 0.8937 0.1432
0.1776 0.8101 0.1292
0.1645 0.7327 0.1176
0.1535 0.6604 0.1080
0.1442 0.5925 0.1000
0.1364 0.5283 0.0933
0.1298 0.4672 0.0876
0.1242 0.4088 0.0828
0.1196 0.3527 0.0788
0.1158 0.2984 0.0754
0.1127 0.2456 0.0725
0.1102 0.1941 0.0702
0.1084 0.1435 0.0682
0.1071 0.0936 0.0667
0.1064 0.0441 0.0656
0.1062 -0.0051 0.0647
0.1065 -0.0544 0.0642
0.1073 -0.1039 0.0641
0.1087 -0.1540 0.0642
0.1107 -0.2048 0.0647
0.1133 -0.2566 0.0654
0.1165 -0.3097 0.0665
0.1205 -0.3644 0.0680
0.1253 -0.4211 0.0698
0.1311 -0.4802 0.0721
0.1379 -0.5421 0.0749
0.1460 -0.6072 0.0782
0.1557 -0.6763 0.0821
0.1672 -0.7500 0.0868
0.1808 -0.8291 0.0922
0.1972 -0.9148 0.0987
0.2170 -1.0082 0.1064
0.2411 -1.1108 0.1156
0.2707 -1.2247 0.1266
0.3077 -1.3523 0.1398
0.3543 -1.4966 0.1559
0.4142 -1.6619 0.1756
0.4928 -1.8534 0.1999
0.5982 -2.0781 0.2301
0.7435 -2.3454 0.2682
0.9505 -2.6673 0.3164
1.2570 -3.0581 0.3771
1.7315 -3.5306 0.4521
2.5030 -4.0780 0.5383
3.8153 -4.6054 0.6162
6.0624 -4.6792 0.6222
9.2964 -2.8488 0.4393
10.2642 2.7039 0.1503
5.7101 5.2776 0.0763
3.4523 4.6684 0.0434
2.2887 4.0021 0.0252
1.6100 3.4324 0.0156
1.1862 2.9664 0.0104
0.9077 2.5875 0.0073
0.7168 2.2770 0.0053
0.5812 2.0192 0.0041
0.4819 1.8022 0.0032
0.4072 1.6170 0.0026
0.3499 1.4568 0.0022
0.3051 1.3166 0.0018
0.2695 1.1925 0.0016
0.2407 1.0814 0.0014
0.2173 0.9811 0.0012
0.1980 0.8897 0.0011
0.1820 0.8057 0.0010
0.1686 0.7280 0.0009
0.1574 0.6554 0.0008
0.1480 0.5874 0.0008
0.1400 0.5230 0.0007
0.1333 0.4619 0.0007
0.1277 0.4034 0.0006
0.1230 0.3472 0.0006
0.1191 0.2928 0.0006
0.1160 0.2399 0.0005
0.1136 0.1883 0.0005
0.1117 0.1376 0.0005
0.1105 0.0876 0.0005
0.1098 0.0380 0.0005
0.1097 -0.0114 0.0005
0.1100 -0.0609 0.0005
0.1110 -0.1106 0.0005
0.1125 -0.1609 0.0005
0.1146 -0.2120 0.0005
0.1174 -0.2642 0.0005
0.1208 -0.3177 0.0005
0.1251 -0.3729 0.0005
0.1302 -0.4301 0.0005
0.1363 -0.4898 0.0005
0.1435 -0.5523 0.0006
0.1522 -0.6183 0.0006
0.1624 -0.6884 0.0006
0.1746 -0.7632 0.0007
0.1891 -0.8437 0.0007
0.2066 -0.9310 0.0008
0.2277 -1.0263 0.0008
0.2534 -1.1314 0.0009
0.2852 -1.2482 0.0010
0.3249 -1.3795 0.0011
E=(yout(:,1).^2+yout(:,2).^2+yout(:,3).^2+1)./(2*yout(:,1));
E
E =
105.2500
95.3124
88.0727
84.7482
83.0055
82.0068
81.3939
80.9960
80.7256
80.5346
80.3953
80.2910
80.2110
80.1485
80.0989
80.0588
80.0262
79.9993
79.9769
79.9582
79.9425
79.9291
79.9179
79.9083
79.9002
79.8934
79.8877
79.8830
79.8792
79.8762
79.8740
79.8726
79.8718
79.8717
79.8724
79.8737
79.8758
79.8788
79.8825
79.8872
79.8930
79.9000
79.9084
79.9184
79.9303
79.9444
79.9613
79.9815
80.0059
80.0355
80.0717
80.1163
80.1722
80.2429
80.3335
80.4513
80.6062
80.8109
81.0767
81.3940
81.6484
81.3119
78.7207
72.1353
62.5392
58.3577
56.3788
55.3196
54.7027
54.3190
54.0672
53.8944
53.7714
53.6811
53.6130
53.5606
53.5194
53.4865
53.4599
53.4381
53.4200
53.4049
53.3923
53.3816
53.3725
53.3647
53.3581
53.3525
53.3477
53.3437
53.3403
53.3375
53.3353
53.3336
53.3324
53.3316
53.3313
53.3315
53.3321
53.3332
53.3349
53.3371
53.3399
53.3434
53.3477
53.3529
53.3591
53.3666
53.3755
53.3861
53.3988
53.4142
53.4328
53.4555
53.4834
53.5180
53.5612
53.6155
53.6837
53.7685
53.8686
53.9674
53.9918
53.6650
52.0393
46.8049
37.8540
32.1187
29.9653
28.9367
28.3820
28.0568
27.8532
27.7189
27.6262
27.5600
27.5111
27.4741
27.4454
27.4228
27.4047
27.3899
27.3778
27.3677
27.3592
27.3520
27.3458
27.3405
27.3360
27.3321
27.3287
27.3257
27.3232
27.3210
27.3191
27.3175
27.3162
27.3151
27.3143
27.3137
27.3133
27.3131
27.3132
27.3135
27.3141
27.3149
27.3160
27.3175
27.3193
27.3216
27.3244
27.3277
27.3318
27.3366
27.3424
27.3493
27.3575
27.3672
27.3786
27.3917
27.4057
27.4186
27.4243
27.4056
27.3137
27.0035
26.0246
23.0554
15.8535
8.1698
6.1614
5.4873
5.1901
5.0398
4.9561
4.9057
4.8735
4.8518
4.8365
4.8255
4.8172
4.8108
4.8058
4.8018
4.7985
4.7958
4.7936
4.7917
4.7901
4.7887
4.7875
4.7864
4.7855
4.7847
4.7840
4.7834
4.7828
4.7823
4.7818
4.7814
4.7811
4.7808
4.7805
4.7803
4.7801
4.7800
4.7799
4.7798
4.7798
4.7798
4.7799
4.7800
4.7802
4.7805
4.7808
4.7813
4.7819
4.7827
4.7838
4.7851
4.7868
4.7890
4.7921
4.7963
4.8027
4.8130
4.8312
4.8681
4.9514
5.1488
5.5381
5.3820
5.0277
4.8620
4.7744
4.7240
4.6928
4.6725
4.6586
4.6488
4.6417
4.6363
4.6322
4.6290
4.6264
4.6243
4.6227
4.6213
4.6202
4.6192
4.6184
4.6178
4.6172
4.6168
4.6164
4.6161
4.6158
4.6156
4.6155
4.6154
4.6153
4.6153
4.6153
4.6154
4.6155
4.6156
4.6158
4.6161
4.6164
4.6167
4.6172
4.6177
4.6183
4.6190
4.6198
4.6208
4.6220
4.6234
4.6252
4.6273
4.6298
plot(tout,E)
plot(tout,E,'.')
opzioni.InitialStep=0.01
opzioni =
InitialStep: 0.0100
ese4rk2
ese4rk2
2^(1/3)
ans =
1.2599
8^(1/3)
ans =
2
1^(1/3)
ans =
1
(-8)^(1/3)
ans =
1.0000 + 1.7321i
abs((-8)^(1/3))
ans =
2.0000
ese4rk23
time step rejected
time step rejected
time step rejected
time step rejected
time step rejected
time step rejected
time step rejected
time step rejected
time step rejected
time step rejected
ese4rk23
ese4rk23
ese4rk23
time step rejected
time step rejected
time step rejected
time step rejected
time step rejected
time step rejected
time step rejected
time step rejected
time step rejected
time step rejected
plot(tout,yout(:,1),'.')
plot(tout,yout(:,2),'.')
plot(tout,yout(:,3),'.')
% Modify expression to add input arguments.
% Example:
% a = [1 2 3; 4 5 6];
% foo(a);
ese4eulero
??? Undefined function or variable 'tout'.
Error in ==> ese4eulero at 15
plot(tout,E,'.')
% Modify expression to add input arguments.
% Example:
% a = [1 2 3; 4 5 6];
% foo(a);
ese4eulero
??? Error using ==> plot
Vectors must be the same lengths.
Error in ==> ese4eulero at 17
plot(tout,E,'.')
% Modify expression to add input arguments.
% Example:
% a = [1 2 3; 4 5 6];
% foo(a);
ese4eulero
% Modify expression to add input arguments.
% Example:
% a = [1 2 3; 4 5 6];
% foo(a);
ese4eulero
% Modify expression to add input arguments.
% Example:
% a = [1 2 3; 4 5 6];
% foo(a);
ese4eulero
% Modify expression to add input arguments.
% Example:
% a = [1 2 3; 4 5 6];
% foo(a);
ese4eulero
% Modify expression to add input arguments.
% Example:
% a = [1 2 3; 4 5 6];
% foo(a);
ese4eulero
diary off