Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Solving ODE's problem using the Galerkin's method by Yi-Hsin Ma

ma6036tp
March 12, 2019

Solving ODE's problem using the Galerkin's method by Yi-Hsin Ma

ma6036tp

March 12, 2019
Tweet

Other Decks in Science

Transcript

  1. INTRODUCTION: Consider the ODE: + + = () With boundary

    condition: y(L0) = B0 y(L1) = B1 Since we are going to use the Galerkin’s method, splitting the whole domain into n elements evenly before the computation is necessary. In this report, I am going to find out the relations of (a, ), (b, ), (n, ), where is the maximum difference of the approximation () and the exact solution () along all ∈ [0, 1]. Hence, define as: ≡ ∈[ , ]{|() − ()|} In order to make more efforts in the variables a, b, n, which we are interested about, fix c=1 and f(x)=x, L0=0, L1=1, B0=B1=0. So the ODE’s problem becomes: + + = y(0) = 0 y(1) = 0 A demonstration of Galerkin’s method.
  2. the following contains data of: 1. a= (0.01,0.1,1,10,100), b=1, c=1,

    and changing n. 2. a=(1,2 , 2 ,2 , 2 , 2 ), b=1, c=1, and changing n. 3. a=1, b= (0.01,0.1,1,10,100), c=1, and changing n. 4. a=1, b= (1,2 , 2 ,2 , 2 , 2 ), c=1, and changing n. DATAS: for a=1, b=1, c=1 compute for n=2 , 2 .. 2 , 3 , 3 . . 3 ,4 , 4 . . 4 n ratio 2 2.2091e-02 - 2 5.5664e-03 2.5197e-01 2 1.4101e-03 2.5332e-01 2 3.5376e-04 2.5087e-01 2 8.8517e-05 2.5022e-01 2 2.2134e-05 2.5005e-01 2 5.5338e-06 2.5001e-01 2 1.3835e-06 2.5000e-01 2 3.4587e-07 2.5000e-01 2 8.6468e-08 2.5000e-01 3 9.9214e-03 - 3 1.1170e-03 1.1259e-01 3 1.2435e-04 1.1132e-01 3 1.3819e-05 1.1113e-01 3 1.5355e-06 1.1111e-01 3 1.7061e-07 1.1111e-01 4 5.5664e-03 - 4 3.5376e-04 6.3553e-02 4 2.2134e-05 6.2567e-02 4 1.3835e-06 6.2506e-02 4 8.6468e-08 6.2499e-02 Observation: 2.5000e-01=0.25= 1.1111e-01=0.1111= 6.2499e-02=0.062499≅ 0.0625= Claim1: (n*r)/ (n)~ for n is sufficient large.
  3. Changing ‘a’ for a=100, b=1, c=1 compute for n=2 ,

    2 .. 2 , 3 , 3 . . 3 ,4 , 4 . . 4 n ratio 2 2.3435e-04 - 2 6.8254e-05 2.9124e-01 2 1.8267e-05 2.6763e-01 2 4.7167e-06 2.5822e-01 2 1.1979e-06 2.5397e-01 2 3.0182e-07 2.5195e-01 2 7.5747e-08 2.5097e-01 2 1.8973e-08 2.5048e-01 2 4.7479e-09 2.5024e-01 2 1.1876e-09 2.5012e-01 3 1.1562e-04 - 3 1.4538e-05 1.2574e-01 3 1.6778e-06 1.1540e-01 3 1.8873e-07 1.1249e-01 3 2.1056e-08 1.1156e-01 3 2.3427e-09 1.1126e-01 4 6.8254e-05 - 4 4.7167e-06 6.9105e-02 4 3.0182e-07 6.3990e-02 4 1.8973e-08 6.2862e-02 4 1.1876e-09 6.2594e-02 Claim1 is satisfied.
  4. Changing ‘a’ for a=10, b=1, c=1 compute for n=2 ,

    2 .. 2 ,3 , 3 . . 3 , 4 , 4 . . 4 n ratio 2 2.3407e-03 - 2 6.7283e-04 2.8745e-01 2 1.7869e-04 2.6558e-01 2 4.5952e-05 2.5716e-01 2 1.1646e-05 2.5344e-01 2 2.9311e-06 2.5168e-01 2 7.3522e-07 2.5083e-01 2 1.8411e-07 2.5041e-01 2 4.6066e-08 2.5021e-01 2 1.1521e-08 2.5010e-01 3 1.1452e-03 - 3 1.4209e-04 1.2408e-01 3 1.6318e-05 1.1484e-01 3 1.8324e-06 1.1230e-01 3 2.0432e-07 1.1150e-01 3 2.2728e-08 1.1124e-01 4 6.7283e-04 - 4 4.5952e-05 6.8296e-02 4 2.9311e-06 6.3786e-02 4 1.8411e-07 6.2813e-02 4 1.1521e-08 6.2577e-02 Claim1 is satisfied.
  5. Changing ‘a’ for a=0.1, b=1, c=1 compute for n=2 ,

    2 .. 2 ,3 , 3 . . 3 ,4 , 4 . . 4 n ratio 2 3.2616e+00 - 2 1.9072e-01 5.8476e-02 2 7.0270e-02 3.6844e-01 2 2.4792e-02 3.5282e-01 2 7.6057e-03 3.0678e-01 2 2.1329e-03 2.8043e-01 2 5.6570e-04 2.6523e-01 2 1.4574e-04 2.5762e-01 2 3.6990e-05 2.5381e-01 2 9.3181e-06 2.5191e-01 3 2.5658e-01 - 3 5.9726e-02 2.3278e-01 3 1.0249e-02 1.7161e-01 3 1.3648e-03 1.3316e-01 3 1.6149e-04 1.1832e-01 3 1.8329e-05 1.1350e-01 4 1.9072e-01 - 4 2.4792e-02 1.2999e-01 4 2.1329e-03 8.6032e-02 4 1.4574e-04 6.8330e-02 4 9.3181e-06 6.3936e-02 Claim1 is satisfied.
  6. Changing ‘a’ for a=0.01, b=1, c=1 compute for n=2 ,

    2 .. 2 ,3 , 3 . . 3 ,4 , 4 . . 4 n ratio 2 1.3523e+00 - 2 2.4501e+00 1.8119e+00 2 1.4093e+00 5.7521e-01 2 5.2583e-01 3.7311e-01 2 2.6395e-01 5.0197e-01 2 1.1207e-01 4.2456e-01 2 4.2906e-02 3.8287e-01 2 1.3765e-02 3.2081e-01 2 3.9932e-03 2.9010e-01 2 1.0787e-03 2.7012e-01 2 2.8054e-04 2.6007e-01 3 8.8810e-01 - 3 5.8544e-01 6.5920e-01 3 3.2494e-01 5.5503e-01 3 8.2991e-02 2.5541e-01 3 1.5043e-02 1.8126e-01 3 2.0621e-03 1.3708e-01 4 2.4501e+00 - 4 5.2583e-01 2.1461e-01 4 1.1207e-01 2.1313e-01 4 1.3765e-02 1.2283e-01 4 1.0787e-03 7.8365e-02 Claim1 is satisfied. Note that in this case the ratios marked in yellow are not very close to the numbers in the claim compare to previous cases. It is because of the shrinking of ‘a’ makes the stiffness matrix less symmetric. To continue the process, these ratios would converge to .
  7. for a= (0.01,0.1,1,10,100), b=1, c=1 compute for n=2 , 2

    .. 2 ,3 , 3 . . 3 n (a=0.01) (a=0.1) (a=1) (a=10) (a=100) 2 1.3523e+00 3.2616e+00 2.2091e-02 2.3407e-03 2.3435e-04 2 2.4501e+00 1.9072e-01 5.5664e-03 6.7283e-04 6.8254e-05 2 1.4093e+00 7.0270e-02 1.4101e-03 1.7869e-04 1.8267e-05 2 5.2583e-01 2.4792e-02 3.5376e-04 4.5952e-05 4.7167e-06 2 2.6395e-01 7.6057e-03 8.8517e-05 1.1646e-05 1.1979e-06 2 1.1207e-01 2.1329e-03 2.2134e-05 2.9311e-06 3.0182e-07 2 4.2906e-02 5.6570e-04 5.5338e-06 7.3522e-07 7.5747e-08 2 1.3765e-02 1.4574e-04 1.3835e-06 1.8411e-07 1.8973e-08 2 3.9932e-03 3.6990e-05 3.4587e-07 4.6066e-08 4.7479e-09 2 1.0787e-03 9.3181e-06 8.6468e-08 1.1521e-08 1.1876e-09 n (a=0.1)/ (a=0.01) (a=1)/ (a=0.1) (a=10)/ (a=1) (a=100)/ (a=10) 2 2.41189 0.00677 0.10596 0.10012 2 0.07784 0.02919 0.12087 0.10144 2 0.04986 0.02007 0.12672 0.10223 2 0.04715 0.01427 0.12990 0.10264 2 0.02881 0.01164 0.13157 0.10286 2 0.01903 0.01038 0.13243 0.10297 2 0.01318 0.00978 0.13286 0.10303 2 0.01059 0.00949 0.13308 0.10305 2 0.00926 0.00935 0.13319 0.10307 2 0.00864 0.00928 0.13324 0.10308 10*ratio 0.08638 0.09280 1.33240 1.03081 Observation: For each fixed n, compare . The second table shows the ratio of (10*a) and (a), it seems that when ‘a’ becomes larger, ratio*10 would become nearer to 1. Claim2: ℎ ∗ (a*h)/ (a)~1 when n and a is sufficient large, where h is a real number.
  8. for a= (2 , 2 , 2 , 2 ,

    2 , 2 , 2 ), b=1, c=1 compute for n=2 , 2 .. 2 n (a=2) (a=4) (a=8) (a=16) (a=32) (a=64) (a=128) 2 1.1533e-02 5.8303e-03 2.9245e-03 1.4638e-03 7.3219e-04 3.6616e-04 1.8309e-04 2 3.1268e-03 1.6396e-03 8.3759e-04 4.2307e-04 2.1259e-04 1.0655e-04 5.3341e-05 2 8.0313e-04 4.2996e-04 2.2197e-04 1.1272e-04 5.6791e-05 2.8503e-05 1.4278e-05 2 2.0293e-04 1.0983e-04 5.7018e-05 2.9036e-05 1.4650e-05 7.3580e-06 3.6872e-06 2 5.0970e-05 2.7739e-05 1.4442e-05 7.3653e-06 3.7188e-06 1.8685e-06 9.3651e-07 2 1.2770e-05 6.9692e-06 3.6338e-06 1.8546e-06 9.3674e-07 4.7074e-07 2.3596e-07 2 3.1959e-06 1.7466e-06 9.1135e-07 4.6529e-07 2.3506e-07 1.1814e-07 5.9220e-08 2 7.9937e-07 4.3718e-07 2.2820e-07 1.1653e-07 5.8875e-08 2.9591e-08 1.4834e-08 2 1.9989e-07 1.0936e-07 5.7095e-08 2.9158e-08 1.4733e-08 7.4047e-09 3.7120e-09 2 4.9980e-08 2.7348e-08 1.4279e-08 7.2927e-09 3.6848e-09 1.8521e-09 9.2845e-10 n (a=2)/ (a=1) (a=4)/ (a=2) (a=8)/ (a=4) (a=16)/ (a=8) (a=32)/ (a=16) (a=64)/ (a=32) (a=128)/ (a=64) 2 0.52207 0.50553 0.50160 0.50053 0.50020 0.50009 0.50003 2 0.56173 0.52437 0.51085 0.50510 0.50249 0.50120 0.50062 2 0.56956 0.53536 0.51626 0.50782 0.50382 0.50189 0.50093 2 0.57364 0.54122 0.51915 0.50924 0.50455 0.50225 0.50111 2 0.57582 0.54422 0.52064 0.50999 0.50491 0.50245 0.50121 2 0.57694 0.54575 0.52141 0.51037 0.50509 0.50253 0.50125 2 0.57752 0.54651 0.52179 0.51055 0.50519 0.50260 0.50127 2 0.57779 0.54691 0.52198 0.51065 0.50523 0.50261 0.50130 2 0.57793 0.54710 0.52208 0.51069 0.50528 0.50259 0.50130 2 0.57802 0.54718 0.52212 0.51073 0.50527 0.50263 0.50130 2*ratio 1.15603 1.09436 1.04424 1.02146 1.01054 1.00526 1.00259 Claim2 is satisfied.
  9. Changing ‘b’ for a=1, b=100, c=1 compute for n=2 ,

    2 .. 2 ,3 , 3 . . 3 n ratio 2 6.4471e-02 - 2 1.4649e-02 2.2722e-01 2 4.2792e-03 2.9212e-01 2 2.5516e-03 5.9627e-01 2 1.2997e-03 5.0938e-01 2 5.6193e-04 4.3234e-01 2 2.1546e-04 3.8342e-01 2 6.9192e-05 3.2114e-01 2 2.0087e-05 2.9031e-01 2 5.4282e-06 2.7024e-01 3 4.3075e-03 - 3 3.1214e-03 7.2465e-01 3 1.5952e-03 5.1106e-01 3 4.1635e-04 2.6100e-01 3 7.5608e-05 1.8160e-01 3 1.0375e-05 1.3723e-01
  10. Changing ‘b’ for a=1, b=10, c=1 compute for n=2 ,

    2 .. 2 ,3 , 3 . . 3 n ratio 2 3.4755e-02 - 2 8.9486e-03 2.5747e-01 2 3.8442e-03 4.2959e-01 2 1.3545e-03 3.5234e-01 2 4.1696e-04 3.0783e-01 2 1.1723e-04 2.8117e-01 2 3.1147e-05 2.6569e-01 2 8.0320e-06 2.5787e-01 2 2.0397e-06 2.5394e-01 2 5.1394e-07 2.5197e-01 3 1.2415e-02 - 3 3.2637e-03 2.6289e-01 3 5.6149e-04 1.7204e-01 3 7.5069e-05 1.3370e-01 3 8.8995e-06 1.1855e-01 3 1.0108e-06 1.1358e-01
  11. Changing ‘b’ for a=1, b=0.1, c=1 compute for n=2 ,

    2 .. 2 ,3 , 3 . . 3 n ratio 2 2.5672e-02 - 2 7.1212e-03 2.7739e-01 2 1.8417e-03 2.5861e-01 2 4.6632e-04 2.5321e-01 2 1.1721e-04 2.5134e-01 2 2.9373e-05 2.5061e-01 2 7.3517e-06 2.5029e-01 2 1.8390e-06 2.5014e-01 2 4.5987e-07 2.5007e-01 2 1.1498e-07 2.5003e-01 3 1.2297e-02 - 3 1.4596e-03 1.1870e-01 3 1.6448e-04 1.1269e-01 3 1.8346e-05 1.1154e-01 3 2.0409e-06 1.1124e-01 3 2.2686e-07 1.1115e-01
  12. Changing ‘b’ for a=1, b=0.01, c=1 compute for n=2 ,

    2 .. 2 ,3 , 3 . . 3 n ratio 2 2.5937e-02 - 2 7.2708e-03 2.8032e-01 2 1.8911e-03 2.6010e-01 2 4.8025e-04 2.5395e-01 2 1.2088e-04 2.5171e-01 2 3.0317e-05 2.5079e-01 2 7.5909e-06 2.5038e-01 2 1.8991e-06 2.5019e-01 2 4.7496e-07 2.5009e-01 2 1.1876e-07 2.5005e-01 3 1.2509e-02 - 3 1.4998e-03 1.1989e-01 3 1.6960e-04 1.1308e-01 3 1.8939e-05 1.1167e-01 3 2.1077e-06 1.1129e-01 3 2.3431e-07 1.1117e-01
  13. for a=1, b= (0.01,0.1,1,10,100), c=1 compute for n=2 , 2

    .. 2 n (b=0.01) (b=0.1) (b=1) (b=10) (b=100) 2 2.5937e-02 2.5672e-02 2.2091e-02 3.4755e-02 6.4471e-02 2 7.2708e-03 7.1212e-03 5.5664e-03 8.9486e-03 1.4649e-02 2 1.8911e-03 1.8417e-03 1.4101e-03 3.8442e-03 4.2792e-03 2 4.8025e-04 4.6632e-04 3.5376e-04 1.3545e-03 2.5516e-03 2 1.2088e-04 1.1721e-04 8.8517e-05 4.1696e-04 1.2997e-03 2 3.0317e-05 2.9373e-05 2.2134e-05 1.1723e-04 5.6193e-04 2 7.5909e-06 7.3517e-06 5.5338e-06 3.1147e-05 2.1546e-04 2 1.8991e-06 1.8390e-06 1.3835e-06 8.0320e-06 6.9192e-05 2 4.7496e-07 4.5987e-07 3.4587e-07 2.0397e-06 2.0087e-05 2 1.1876e-07 1.1498e-07 8.6468e-08 5.1394e-07 5.4282e-06 n (b=0.1)/ (b=0.01) (b=1)/ (b=0.1) (b=10)/ (b=1) (b=100)/ (b=10) 2 0.98978 0.86051 1.57327 1.85501 2 0.97942 0.78167 1.60761 1.63702 2 0.97388 0.76565 2.72619 1.11316 2 0.97099 0.75862 3.82887 1.88379 2 0.96964 0.75520 4.71051 3.11709 2 0.96886 0.75355 5.29638 4.79340 2 0.96849 0.75272 5.62850 6.91752 2 0.96835 0.75231 5.80557 8.61454 2 0.96823 0.75210 5.89730 9.84802 2 0.96817 0.75203 5.94370 10.56193 Claim3: (b*k)/ (b)~1 when n is sufficient large and b is sufficient small, where k is a real number.
  14. n (b=2 ) (b=2 ) (b=2 ) (b=2 ) (b=2

    ) (b=2 ) (b=1) 2 2.5921e-02 2.5876e-02 2.5785e-02 2.5595e-02 2.5190e-02 2.4278e-02 2.2091e-02 2 7.2615e-03 7.2356e-03 7.1838e-03 7.0794e-03 6.8680e-03 6.4376e-03 5.5664e-03 2 1.8880e-03 1.8794e-03 1.8622e-03 1.8280e-03 1.7600e-03 1.6268e-03 1.4101e-03 2 4.7937e-04 4.7694e-04 4.7210e-04 4.6249e-04 4.4360e-04 4.0720e-04 3.5376e-04 2 1.2065e-04 1.2001e-04 1.1873e-04 1.1620e-04 1.1124e-04 1.0185e-04 8.8517e-05 2 3.0258e-05 3.0092e-05 2.9764e-05 2.9114e-05 2.7845e-05 2.5464e-05 2.2134e-05 2 7.5757e-06 7.5339e-06 7.4507e-06 7.2862e-06 6.9653e-06 6.3663e-06 5.5338e-06 2 1.8953e-06 1.8848e-06 1.8639e-06 1.8225e-06 1.7418e-06 1.5916e-06 1.3835e-06 2 4.7400e-07 4.7136e-07 4.6611e-07 4.5574e-07 4.3551e-07 3.9790e-07 3.4587e-07 2 1.1852e-07 1.1786e-07 1.1655e-07 1.1395e-07 1.0888e-07 9.9475e-08 8.6468e-08 n (b=1)/ (b=1/2) (b=1/2)/ (b=1/4) (b=1/4)/ (b=1/8) (b=1/8)/ (b=1/16) (b=1/16)/ (b=1/32) (b=1/32)/ (b=1/64) 2 0.90992 0.96380 0.98418 0.99263 0.99648 0.99826 2 0.86467 0.93733 0.97014 0.98547 0.99284 0.99643 2 0.86679 0.92432 0.96280 0.98163 0.99085 0.99544 2 0.86876 0.91794 0.95916 0.97964 0.98985 0.99493 2 0.86909 0.91559 0.95731 0.97869 0.98933 0.99470 2 0.86923 0.91449 0.95641 0.97816 0.98910 0.99451 2 0.86923 0.91400 0.95596 0.97792 0.98896 0.99448 2 0.86925 0.91377 0.95572 0.97779 0.98891 0.99446 2 0.86924 0.91364 0.95561 0.97775 0.98886 0.99443 2 0.86924 0.91362 0.95551 0.97769 0.98889 0.99443 Claim3 is satisfied.
  15. Conclusion: 1. Suppose r is a natural number, then ∗

    (n*r)/ (n)~ 1 for n is sufficient large. 2. Assume n is sufficient large. Fixed n. Suppose h is a real number, then ℎ ∗ (a*h)/ (a)~1 For a is sufficient large. 3. Assume n is sufficient large. Fixed n. Suppose k is a real number, then (b*k)/ (b)~1 For b is sufficient small