SHARE
TWEET

Untitled

a guest Jun 19th, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. list = {{1, 2}, 2, {3, 4, 8, 12}, 4, {2, 2, 2, 2, 2}}
  2. F[x_] = list[[x]]
  3.      
  4. err[Vinitphi_?NumberQ, l_?NumberQ, nc_?NumberQ, tauC_?NumberQ,
  5.   tauG_?NumberQ, D0_?NumberQ, k_] =
  6.  With[{model = (Rad /. pfun)[Vinitphi, l, nc, tauC, tauG, D0]},
  7.   Norm[rad[[k]][[2 ;; Length[rad[[k]]], 2]] -
  8.     model /@ rad[[k]][[2 ;; Length[rad[[k]]], 1]]]]
  9.  
  10. fit = FindMinimum[{Sum[
  11.     err[Vinitphi/2^(i - 1), l, nc, tauC, tauG, D0, i], {i, 1, 6, 1}],
  12.    3*10^7 < Vinitphi < 9*10^7, 15 < l < 30, 0.05 < tauC < 0.5,
  13.    0.2 < nc < 0.8,
  14.    4*10^(10) < D0 < 2*10^(11)}, {{Vinitphi, 4.5*10^7}, {l, 25}, {nc,
  15.     0.5}, {tauC, 0.2}, {tauG, 30}, {D0, 6*10^(10)}}]
  16.      
  17. rad={{{0., 117.705}, {3., 148.255}, {6., 176.81}, {9., 183.561}, {12.,
  18.    197.419}, {15., 210.672}, {18., 211.152}, {21., 209.889}, {24.,
  19.    207.741}, {27., 204.352}, {30., 201.79}, {33., 199.976}, {36.,
  20.    199.04}, {39., 197.151}, {42., 197.584}, {45., 196.198}, {48.,
  21.    195.153}, {51., 195.711}, {54., 194.088}, {57., 193.304}, {60.,
  22.    192.474}, {63., 192.13}, {66., 192.877}, {69., 192.371}, {72.,
  23.    192.657}, {75., 190.984}, {78., 190.685}, {81., 190.449}, {84.,
  24.    189.83}, {87., 189.625}, {90., 194.855}, {93., 186.581}, {96.,
  25.    184.735}, {99., 184.586}, {102., 183.505}, {105., 181.531}, {108.,
  26.    179.925}, {111., 178.428}, {114., 176.164}, {117., 175.375}, {120.,
  27.     174.782}, {123., 172.649}, {126., 170.454}, {129.,
  28.    168.357}, {132., 168.04}, {135., 167.26}, {138., 165.657}, {141.,
  29.    164.797}, {144., 163.705}, {147., 161.214}, {150., 160.5}, {153.,
  30.    159.353}, {156., 157.873}, {159., 157.225}}, {{0., 51.7792}, {3.,
  31.    80.825}, {6., 108.913}, {9., 121.147}, {12., 130.805}, {15.,
  32.    140.562}, {18., 143.615}, {21., 146.513}, {24., 147.63}, {27.,
  33.    147.12}, {30., 146.693}, {33., 147.396}, {36., 148.256}, {39.,
  34.    147.737}, {42., 148.685}, {45., 149.043}, {48., 147.814}, {51.,
  35.    148.776}, {54., 147.959}, {57., 147.775}, {60., 148.031}, {63.,
  36.    148.284}, {66., 148.334}, {69., 148.521}, {72., 148.974}, {75.,
  37.    146.562}, {78., 145.734}, {81., 145.177}, {84., 145.588}, {87.,
  38.    144.949}, {90., 147.035}, {93., 141.755}, {96., 140.841}, {99.,
  39.    139.94}, {102., 138.25}, {105., 136.508}, {108., 135.52}, {111.,
  40.    133.758}, {114., 132.694}, {117., 131.744}, {120., 131.208}, {123.,
  41.     130.292}, {126., 127.612}, {129., 126.981}, {132.,
  42.    127.035}, {135., 125.198}, {138., 123.557}, {141., 123.946}, {144.,
  43.     120.738}, {147., 119.875}, {150., 118.828}, {153.,
  44.    118.162}, {156., 117.363}, {159., 116.712}}, {{0., 29.62}, {3.,
  45.    53.1414}, {6., 67.2233}, {9., 82.5676}, {12., 83.5019}, {15.,
  46.    92.3142}, {18., 98.9869}, {21., 102.557}, {24., 106.481}, {27.,
  47.    107.188}, {30., 107.637}, {33., 108.415}, {36., 109.622}, {39.,
  48.    110.593}, {42., 111.205}, {45., 111.396}, {48., 111.668}, {51.,
  49.    114.126}, {54., 113.3}, {57., 114.27}, {60., 114.849}, {63.,
  50.    110.808}, {66., 116.51}, {69., 118.796}, {72., 119.636}, {75.,
  51.    118.02}, {78., 116.026}, {81., 116.767}, {84., 116.994}, {87.,
  52.    119.169}, {90., 121.246}, {93., 116.291}, {96., 117.296}, {99.,
  53.    117.72}, {102., 115.814}, {105., 114.76}, {108., 114.853}, {111.,
  54.    113.886}, {114., 112.522}, {117., 112.109}, {120., 112.376}, {123.,
  55.     110.998}, {126., 109.708}, {129., 108.926}, {132.,
  56.    108.075}, {135., 107.182}, {138., 106.723}, {141., 106.562}, {144.,
  57.     103.807}, {147., 102.798}, {150., 102.333}, {153.,
  58.    101.633}, {156., 100.395}, {159., 99.889}}, {{0., 79.5768}, {3.,
  59.    86.0729}, {6., 101.334}, {9., 103.158}, {12., 104.818}, {15.,
  60.    104.534}, {18., 104.361}, {21., 105.568}, {24., 107.109}, {27.,
  61.    105.042}, {30., 105.165}, {33., 107.669}, {36., 108.182}, {39.,
  62.    108.549}, {42., 109.208}, {45., 109.714}, {48., 110.098}, {51.,
  63.    110.481}, {54., 110.373}, {57., 110.563}, {60., 111.115}, {63.,
  64.    111.766}, {66., 112.415}, {69., 113.322}, {72., 113.272}, {75.,
  65.    113.95}, {78., 113.98}, {81., 114.017}, {84., 111.879}, {87.,
  66.    114.706}, {90., 112.125}, {93., 109.696}, {96., 112.481}, {99.,
  67.    109.528}, {102., 108.22}, {105., 108.112}, {108., 107.387}, {111.,
  68.    106.369}, {114., 106.522}, {117., 105.678}, {120., 111.234}, {123.,
  69.     109.391}, {126., 104.95}, {129., 109.079}, {132., 109.363}, {135.,
  70.     100.807}, {138., 99.9696}, {141., 100.622}, {144., 99.789}, {147.,
  71.     98.5068}, {150., 99.6161}, {153., 97.4872}, {156.,
  72.    101.554}, {159., 101.406}}, {{0., 30.4597}, {3., 35.889}, {6.,
  73.    45.7724}, {9., 54.0641}, {12., 56.851}, {15., 59.1402}, {18.,
  74.    61.0664}, {21., 63.1851}, {24., 65.2428}, {27., 66.6239}, {30.,
  75.    67.5882}, {33., 68.5353}, {36., 69.885}, {39., 71.1742}, {42.,
  76.    72.485}, {45., 73.2793}, {48., 74.2798}, {51., 74.7271}, {54.,
  77.    74.8248}, {57., 75.83}, {60., 76.1228}, {63., 77.5324}, {66.,
  78.    76.4005}, {69., 77.5578}, {72., 80.4519}, {75., 80.1548}, {78.,
  79.    80.1533}, {81., 79.2626}, {84., 79.6456}, {87., 79.5882}, {90.,
  80.    78.9125}, {93., 77.5023}, {96., 80.9046}, {99., 78.125}, {102.,
  81.    78.1087}, {105., 82.0064}, {108., 80.6066}, {111., 82.9245}, {114.,
  82.     83.6384}, {117., 82.0775}, {120., 81.1198}, {123., 75.248}, {126.,
  83.     78.1893}, {129., 72.6991}, {132., 72.683}, {135., 80.5139}, {138.,
  84.     83.442}, {141., 81.0871}, {144., 80.1472}, {147., 79.3543}, {150.,
  85.     79.0979}, {153., 79.0636}, {156., 78.3953}, {159.,
  86.    77.2895}}, {{0., 27.5731}, {3., 27.4456}, {6., 37.2589}, {9.,
  87.    40.9683}, {12., 43.2509}, {15., 44.3384}, {18., 46.5891}, {21.,
  88.    48.0219}, {24., 49.6954}, {27., 51.1536}, {30., 51.7754}, {33.,
  89.    53.2019}, {36., 54.9082}, {39., 55.9732}, {42., 57.3092}, {45.,
  90.    58.6397}, {48., 58.9803}, {51., 58.6734}, {54., 60.6691}, {57.,
  91.    61.3107}, {60., 62.1459}, {63., 63.2534}, {66., 64.1169}, {69.,
  92.    64.7201}, {72., 65.4561}, {75., 65.7958}, {78., 65.9518}, {81.,
  93.    66.9163}, {84., 67.5038}, {87., 64.925}, {90., 69.8176}, {93.,
  94.    65.8334}, {96., 69.2665}, {99., 66.6777}, {102., 65.9855}, {105.,
  95.    69.4403}, {108., 70.2052}, {111., 69.9442}, {114., 70.7562}, {117.,
  96.     70.3714}, {120., 63.5385}, {123., 62.8021}, {126.,
  97.    67.0399}, {129., 61.5096}, {132., 63.1028}, {135., 70.3602}, {138.,
  98.     70.2032}, {141., 69.4146}, {144., 68.2243}, {147.,
  99.    67.9524}, {150., 67.8477}, {153., 68.2036}, {156., 68.2165}, {159.,
  100.     67.5863}}}
  101.  
  102. eps = 0.1;
  103. phic = 0.85;
  104. v = 80
  105. a = 0
  106. phi0 = 0.63;
  107. L = 5000;
  108. nL0 = 1;
  109.  
  110. pfun = ParametricNDSolve[{Derivative[1][V][
  111.      t] == -((
  112.       D0 (E^(-((L + t v)^2/(4 D0 t)))) (-L + t v) Vinitphi )/((D0 t)^(
  113.        3/2)*4*Sqrt[Pi]*phi0)) + (
  114.      2 Vphi[t] (phic - Vphi[t]/V[t]) (-2 + phic +
  115.         2 (1 - Vphi[t]/V[t])) (1 - (1 - Vphi[t]/V[t])^2))/((1 -
  116.         phic)^2 tauC V[t]^(
  117.       1/3)) - (-nc V[t] - (
  118.         4 l L nL0 [Pi] Csch[((E^(((a Vphi[t])/(
  119.            2 V[t])))) ((3/[Pi])^(1/3)) (V[t]^(1/3)) )/(
  120.           2^(2/3) l)] (-E^(-((a Vphi[t])/V[t]))
  121.               l^2 Sinh[((E^(((a Vphi[t])/(2 V[t])))) ((3/[Pi])^(
  122.               1/3)) (V[t]^(1/3)) )/(2^(2/3) l)] + (
  123.            E^(-((a Vphi[t])/(2 V[t]))) l (3/[Pi])^(1/3)
  124.              Cosh[((E^(((a Vphi[t])/(2 V[t])))) ((3/[Pi])^(1/3)) (
  125.               V[t]^(1/3)) )/(2^(2/3) l)] V[t]^(1/3))/(2^(
  126.            2/3)) ))/ (-L Coth[((E^(((a Vphi[t])/(
  127.              2 V[t])))) ((3/[Pi])^(1/3)) (V[t]^(1/3)) )/(
  128.             2^(2/3) l)] + ((3/[Pi])^(1/3)
  129.             Coth[((E^(((a Vphi[t])/(2 V[t])))) ((3/[Pi])^(1/3)) (
  130.              V[t]^(1/3)) )/(2^(2/3) l)] V[t]^(1/3))/2^(2/3) - l))/
  131.       tauG, V[eps] == 10,
  132.    Derivative[1][Vphi][
  133.      t] == -((D0 (E^(-((L + t v)^2/(4 D0 t)))) (-L + t v) Vinitphi )/(
  134.       4*Sqrt[Pi]*phi0 (D0 t)^(3/2))) + ((
  135.       Vphi[t] (-nc V[t] - (
  136.          4 l L nL0 [Pi] Csch[((E^(((a Vphi[t])/(
  137.             2 V[t])))) ((3/[Pi])^(1/3)) (V[t]^(1/3)) )/(
  138.            2^(2/3) l)] (-E^(-((a Vphi[t])/V[t]))
  139.                l^2 Sinh[((E^(((a Vphi[t])/(2 V[t])))) ((3/[Pi])^(
  140.                1/3)) (V[t]^(1/3)) )/(2^(2/3) l)] + (
  141.             E^(-((a Vphi[t])/(2 V[t]))) l (3/[Pi])^(1/3)
  142.               Cosh[((E^(((a Vphi[t])/(2 V[t])))) ((3/[Pi])^(1/3)) (
  143.                V[t]^(1/3)) )/(2^(2/3) l)] V[t]^(1/3))/(2^(
  144.             2/3)) ))/ (-L Coth[((E^(((a Vphi[t])/(
  145.               2 V[t])))) ((3/[Pi])^(1/3)) (V[t]^(1/3)) )/(
  146.              2^(2/3) l)] + ((3/[Pi])^(1/3)
  147.              Coth[((E^(((a Vphi[t])/(2 V[t])))) ((3/[Pi])^(1/3)) (
  148.               V[t]^(1/3)) )/(2^(2/3) l)] V[t]^(1/3))/2^(2/3) - l)))/
  149.       V[t]) /tauG, Vphi[eps] == 6.3,
  150.    Rad'[t] == V'[t]/V[t]^(2/3)/(4*Pi/3)^(1/3),
  151.    Rad[eps] == 3/4 Pi }, {V, Vphi, Rad}, {t, eps, 170}, {Vinitphi, l,
  152.    nc, tauC, tauG, D0},
  153.   Method -> {"EquationSimplification" -> "Residual"}]
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top