forked from smrfeld/physics-based-ml-reaction-networks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cache_derivs0.nb
12640 lines (12553 loc) · 562 KB
/
cache_derivs0.nb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
(* Content-type: application/vnd.wolfram.mathematica *)
(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)
(* CreatedBy='Mathematica 12.2' *)
(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[ 158, 7]
NotebookDataLength[ 575102, 12632]
NotebookOptionsPosition[ 569552, 12532]
NotebookOutlinePosition[ 569949, 12548]
CellTagsIndexPosition[ 569906, 12545]
WindowFrame->Normal*)
(* Beginning of Notebook Content *)
Notebook[{
Cell[CellGroupData[{
Cell["Load packages", "Title",
CellChangeTimes->{{3.823627675287674*^9, 3.8236276781228657`*^9},
3.824662923566228*^9},ExpressionUUID->"6c4d229e-9b28-434b-98d0-\
4ac2feec97ed"],
Cell[BoxData[{
RowBox[{
RowBox[{"SetDirectory", "[",
RowBox[{
RowBox[{"NotebookDirectory", "[", "]"}], "<>", "\"\<../package/\>\""}],
"]"}], ";"}], "\[IndentingNewLine]",
RowBox[{"Get", "[", "\"\<funcs_rxns_moms.m\>\"",
"]"}], "\[IndentingNewLine]",
RowBox[{"Needs", "[", "\"\<diffTVR`\>\"", "]"}]}], "Input",
InitializationCell->True,
CellChangeTimes->{{3.823627678658452*^9, 3.823627699574668*^9}, {
3.826723149071151*^9, 3.826723170915152*^9}, {3.826906507632835*^9,
3.826906508038965*^9}},
CellLabel->
"In[2064]:=",ExpressionUUID->"05763728-f6c5-4ede-9f24-9fae817503de"],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{"?", "diffTVR`*"}]], "Input",
CellChangeTimes->{{3.822074440374161*^9, 3.82207444317091*^9}},
CellLabel->
"In[2067]:=",ExpressionUUID->"1d18a0aa-1a54-4b01-a35a-ddd8e33aab82"],
Cell[BoxData[
StyleBox[
FrameBox[GridBox[{
{
DynamicModuleBox[{Typeset`open$$ = True},
PaneSelectorBox[{False->
ButtonBox[
RowBox[{
DynamicBox[FEPrivate`FrontEndResource[
"FEBitmaps", "RightPointerOpener"]], " ",
StyleBox["diffTVR`", "InformationGridGroupHeader"]}],
Appearance->None,
BaseStyle->"InformationGridLink",
ButtonFunction:>FEPrivate`Set[Typeset`open$$, True],
Evaluator->Automatic,
Method->"Preemptive"], True->
PaneBox[GridBox[{
{
ButtonBox[
RowBox[{
DynamicBox[FEPrivate`FrontEndResource[
"FEBitmaps", "DownPointerOpener"],
ImageSizeCache->{10., {3., 7.}}], " ",
StyleBox["diffTVR`", "InformationGridGroupHeader"]}],
Appearance->None,
BaseStyle->"InformationGridLink",
ButtonFunction:>FEPrivate`Set[Typeset`open$$, False],
Evaluator->Automatic,
Method->"Preemptive"]},
{
PaneBox[GridBox[{
{
ButtonBox[
StyleBox["getDiffTVR", "InformationGridButton"],
Appearance->None,
BaseStyle->"InformationGridLink",
ButtonData:>{
"Info-652b64d2-7104-4bb4-b9ac-844a0ad36a43", {
"getDiffTVR", "diffTVR`"}, False},
ButtonNote->"diffTVR`",
Evaluator->Automatic],
ButtonBox[
StyleBox["getDiffTVRupdate", "InformationGridButton"],
Appearance->None,
BaseStyle->"InformationGridLink",
ButtonData:>{
"Info-652b64d2-7104-4bb4-b9ac-844a0ad36a43", {
"getDiffTVRupdate", "diffTVR`"}, False},
ButtonNote->"diffTVR`",
Evaluator->Automatic],
ButtonBox[
StyleBox["makeTVRstructs", "InformationGridButton"],
Appearance->None,
BaseStyle->"InformationGridLink",
ButtonData:>{
"Info-652b64d2-7104-4bb4-b9ac-844a0ad36a43", {
"makeTVRstructs", "diffTVR`"}, False},
ButtonNote->"diffTVR`",
Evaluator->Automatic]},
{
ButtonBox[
StyleBox["getDiffTVRGivenStructs", "InformationGridButton"],
Appearance->None,
BaseStyle->"InformationGridLink",
ButtonData:>{
"Info-652b64d2-7104-4bb4-b9ac-844a0ad36a43", {
"getDiffTVRGivenStructs", "diffTVR`"}, False},
ButtonNote->"diffTVR`",
Evaluator->Automatic],
ButtonBox[
StyleBox["getDiffTVRupdateGivenStructs",
"InformationGridButton"],
Appearance->None,
BaseStyle->"InformationGridLink",
ButtonData:>{
"Info-652b64d2-7104-4bb4-b9ac-844a0ad36a43", {
"getDiffTVRupdateGivenStructs", "diffTVR`"}, False},
ButtonNote->"diffTVR`",
Evaluator->Automatic], ""}
},
DefaultBaseStyle->"Text",
GridBoxAlignment->{
"Columns" -> {{Left}}, "Rows" -> {{Baseline}}},
GridBoxItemSize->{"Columns" -> {{
Scaled[0.31666666666666665`]}}}],
ImageMargins->{{10, 0}, {0, 2}}]}
},
GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Baseline}}}],
FrameMargins->{{0, 0}, {8, 0}}]}, Dynamic[Typeset`open$$],
ImageSize->Automatic]]}
},
GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Baseline}}},
GridBoxDividers->{"ColumnsIndexed" -> {{False}}, "RowsIndexed" -> {}},
GridBoxSpacings->{"Columns" -> {
Offset[0.27999999999999997`], {
Offset[0.5599999999999999]},
Offset[0.27999999999999997`]}, "Rows" -> {
Offset[0.2], {
Offset[0.8]},
Offset[0.2]}}],
BaseStyle->"InformationTitleFrame"], "InformationGridPlain"]], "Output",
CellChangeTimes->{
3.822074443481799*^9, 3.8220746803636703`*^9, 3.8220780124928427`*^9,
3.822446487464629*^9, 3.822676443474663*^9, 3.8226767889247828`*^9, {
3.822676829570795*^9, 3.822676849305661*^9}, 3.822678190322083*^9,
3.822680938549505*^9, {3.822681125626192*^9, 3.822681139855022*^9},
3.824662930229631*^9, 3.8246631763863373`*^9, {3.824663263671604*^9,
3.824663277551156*^9}, 3.82466352149522*^9, 3.824669503961972*^9,
3.824669983249259*^9, 3.824671414223535*^9, 3.824736102785233*^9,
3.824743743456655*^9, 3.824748522851865*^9, 3.82474930230729*^9,
3.824917402097821*^9, 3.824918677622383*^9, 3.824921511603307*^9,
3.824921571382023*^9, 3.824921699981283*^9, 3.8249217459337463`*^9,
3.824921839486252*^9, 3.8249229863712597`*^9, 3.824992226831934*^9,
3.8249940046290503`*^9, 3.824994512024732*^9, 3.8250062213163147`*^9,
3.8250838325941257`*^9, 3.8250894916363564`*^9, 3.8250938627322493`*^9,
3.825117765425645*^9, 3.8251216037496023`*^9, 3.825345726512973*^9, {
3.825702276976301*^9, 3.825702283449222*^9}, {3.8259460054922647`*^9,
3.825946007605792*^9}, {3.826041377864101*^9, 3.8260413797882233`*^9},
3.826041596514845*^9, 3.826125061747142*^9, 3.82628882070243*^9,
3.826723177900386*^9, 3.826906511881168*^9, 3.82692824693121*^9,
3.82692988436203*^9, 3.8269813298583403`*^9, 3.8270027789738092`*^9,
3.827366369262816*^9, 3.8274230089803877`*^9, {3.8274234303351097`*^9,
3.827423436713017*^9}, 3.827432838723936*^9, 3.827454835855611*^9, {
3.827506002045483*^9, 3.827506011791329*^9}, 3.827706150805737*^9,
3.827778330634555*^9, 3.827780494403928*^9, 3.827841749772698*^9, {
3.8278536279675817`*^9, 3.8278536570055304`*^9}, 3.8278542333881397`*^9,
3.827866502018281*^9, 3.827880115078682*^9, 3.8278803626981697`*^9,
3.827880855794992*^9, 3.8278811112066936`*^9, 3.827881291972994*^9,
3.827929223428692*^9, 3.8279357062060747`*^9, 3.82796311046705*^9,
3.827963631869411*^9, 3.828021893538816*^9, 3.828052033884643*^9,
3.828052340451178*^9, 3.828053554226737*^9, 3.8280536354055243`*^9,
3.828056474158781*^9, 3.828059714361576*^9, 3.828749679018869*^9, {
3.8288125325381536`*^9, 3.828812556979376*^9}, 3.828812603915577*^9,
3.828812745007558*^9, 3.828815559725667*^9},
CellLabel->
"Out[2067]=",ExpressionUUID->"6293ee04-4567-467e-bc61-46f198fe48c1"]
}, Open ]]
}, Open ]],
Cell[CellGroupData[{
Cell["Import", "Title",
CellChangeTimes->{{3.820847002491816*^9, 3.8208470027424498`*^9}, {
3.823095691227759*^9, 3.823095694918809*^9}, {3.823631729574567*^9,
3.823631730145997*^9}},ExpressionUUID->"6bda052d-3995-4c7d-a3f7-\
82dc21431621"],
Cell[CellGroupData[{
Cell["Import cache", "Chapter",
CellChangeTimes->{{3.82492098526615*^9,
3.824920986504221*^9}},ExpressionUUID->"d4cf1a76-bfbe-4007-b553-\
266e321853c6"],
Cell[BoxData[{
RowBox[{
RowBox[{"nv", "=", "3"}], ";"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"nh", "=", "1"}], ";"}],
"\[IndentingNewLine]"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"volExp", "=", "14"}], ";"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"cdir", "=",
RowBox[{"getCacheDirRaw", "[", "volExp", "]"}]}],
";"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"dataDesc", "=",
RowBox[{"importDataDesc", "[",
RowBox[{"cdir", "<>", "\"\<data_desc.txt\>\""}], "]"}]}], ";"}]}], "Input",\
InitializationCell->True,
CellChangeTimes->{{3.825082330083366*^9, 3.8250823508182898`*^9}, {
3.825082391904275*^9, 3.825082400708823*^9}, {3.8250824353831463`*^9,
3.82508244992666*^9}, 3.8250838347220507`*^9, 3.825089493560918*^9,
3.825117766963459*^9, 3.825121617980295*^9, 3.826041382092779*^9, {
3.826906574194427*^9, 3.826906575709621*^9}, 3.826981397844824*^9, {
3.827423016324291*^9, 3.827423020039824*^9}},
CellLabel->
"In[2068]:=",ExpressionUUID->"9f2300e0-3f11-4241-afd0-68e5cbe227e7"],
Cell[BoxData[{
RowBox[{
RowBox[{
RowBox[{"SetDirectory", "[",
RowBox[{"NotebookDirectory", "[", "]"}], "]"}], ";"}],
"\[IndentingNewLine]"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"noIP3Rs", "=",
RowBox[{"{",
RowBox[{
"100", ",", "500", ",", "600", ",", "700", ",", "800", ",", "900", ",",
"1000", ",", "1500", ",", "2000", ",", "2500", ",", "3000", ",", "3500",
",", "4000", ",", "4500", ",", "5000"}], "}"}]}], ";"}],
"\[IndentingNewLine]",
RowBox[{"(*",
RowBox[{
RowBox[{"noIP3Rs", "=",
RowBox[{"{", "800", "}"}]}], ";"}], "*)"}]}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"ip3s", "=",
RowBox[{"{", "\[IndentingNewLine]",
RowBox[{
"\"\<ip3_0p100\>\"", ",", "\"\<ip3_0p200\>\"", ",", "\"\<ip3_0p300\>\"",
",", "\"\<ip3_0p400\>\"", ",", "\"\<ip3_0p500\>\"", ",",
"\"\<ip3_0p600\>\"", ",", "\"\<ip3_0p700\>\"", ",", "\"\<ip3_0p800\>\"",
",", "\"\<ip3_0p900\>\"", ",", "\"\<ip3_1p000\>\"", ",",
"\[IndentingNewLine]", "\"\<ip3_1p100\>\"", ",", "\"\<ip3_1p200\>\"",
",", "\"\<ip3_1p300\>\"", ",", "\"\<ip3_1p400\>\"", ",",
"\"\<ip3_1p500\>\"", ",", "\"\<ip3_1p600\>\"", ",", "\"\<ip3_1p700\>\"",
",", "\"\<ip3_1p800\>\"", ",", "\"\<ip3_1p900\>\"", ",",
"\"\<ip3_2p000\>\""}], "\[IndentingNewLine]", "}"}]}], ";"}],
"\[IndentingNewLine]"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"ip3Keys", "=",
RowBox[{"{", "}"}]}], ";"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"Do", "[", "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"AppendTo", "[",
RowBox[{"ip3Keys", ",",
RowBox[{"{",
RowBox[{"noIP3R", ",", "ip3"}], "}"}]}], "]"}], ";"}],
"\[IndentingNewLine]", ",",
RowBox[{"{",
RowBox[{"ip3", ",", "ip3s"}], "}"}], "\[IndentingNewLine]", ",",
RowBox[{"{",
RowBox[{"noIP3R", ",", "noIP3Rs"}], "}"}]}], "]"}], ";"}],
"\[IndentingNewLine]"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"params0", "=",
RowBox[{"Association", "[", "]"}]}], ";"}],
"\[IndentingNewLine]"}], "\[IndentingNewLine]",
RowBox[{"Monitor", "[", "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"Do", "[", "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"ip3Key", "=",
RowBox[{"ip3Keys", "[",
RowBox[{"[", "i", "]"}], "]"}]}], ";", "\[IndentingNewLine]",
RowBox[{
RowBox[{"{",
RowBox[{"noIP3R", ",", "ip3"}], "}"}], "=", "ip3Key"}], ";",
"\[IndentingNewLine]", "\[IndentingNewLine]",
RowBox[{"cdir", "=",
RowBox[{"getCacheDirRaw", "[",
RowBox[{"volExp", ",", "noIP3R"}], "]"}]}], ";",
"\[IndentingNewLine]",
RowBox[{"pLFDL", "=",
RowBox[{"Association", "[", "]"}]}], ";", "\[IndentingNewLine]",
RowBox[{"Do", "[", "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"pLFDL", "[", "k", "]"}], "=",
RowBox[{"Flatten", "[",
RowBox[{"Import", "[",
RowBox[{
RowBox[{
"cdir", "<>", "\"\<params0/\>\"", "<>", "ip3", "<>", "\"\</\>\"",
"<>", "k", "<>", "\"\<.txt\>\""}], ",", "\"\<Table\>\""}],
"]"}], "]"}]}], "\[IndentingNewLine]", ",",
RowBox[{"{",
RowBox[{"k", ",",
RowBox[{"makeLF", "[",
RowBox[{"nv", ",", "nh"}], "]"}]}], "}"}]}], "]"}], ";",
"\[IndentingNewLine]", "\[IndentingNewLine]",
RowBox[{
RowBox[{"params0", "[", "ip3Key", "]"}], "=",
RowBox[{"makePStructFromLFDL", "[",
RowBox[{"nv", ",", "nh", ",", "pLFDL"}], "]"}]}], ";"}],
"\[IndentingNewLine]", ",",
RowBox[{"{",
RowBox[{"i", ",",
RowBox[{"Length", "[", "ip3Keys", "]"}]}], "}"}]}], "]"}], ";"}],
"\[IndentingNewLine]", ",",
RowBox[{"ProgressIndicator", "[",
RowBox[{"i", ",",
RowBox[{"{",
RowBox[{"1", ",",
RowBox[{"Length", "[", "ip3Keys", "]"}]}], "}"}]}], "]"}]}],
"]"}]}], "Input",
CellChangeTimes->{{3.8249209869689837`*^9, 3.8249211241479197`*^9}, {
3.824921158487419*^9, 3.824921161729622*^9}, 3.8249937827704277`*^9, {
3.82500622453537*^9, 3.82500625640954*^9}, {3.825006299014001*^9,
3.825006301879929*^9}, 3.825021300178388*^9, {3.825082466348402*^9,
3.825082473700411*^9}, 3.825083421265256*^9, 3.8250838381822653`*^9, {
3.8260413897373*^9, 3.826041394629735*^9}, {3.826041588632831*^9,
3.826041592347362*^9}, {3.826125071815489*^9, 3.826125095725113*^9},
3.826134774624893*^9, {3.826288831017214*^9, 3.8262888381672163`*^9}, {
3.826906561579976*^9, 3.826906628384384*^9}, {3.8269079111117153`*^9,
3.826907962927865*^9}, {3.826981438822031*^9, 3.826981439010364*^9}, {
3.827366371379512*^9, 3.827366372260284*^9}, {3.827423013212469*^9,
3.8274230263688173`*^9}, {3.827423417876493*^9, 3.827423419528347*^9}, {
3.8277061550303373`*^9, 3.827706163974841*^9}, {3.827778334936661*^9,
3.827778335528681*^9}, {3.827841736155303*^9, 3.8278417414201403`*^9}, {
3.827853632896668*^9, 3.827853654264978*^9}, {3.827854222084516*^9,
3.8278542303445063`*^9}, {3.827866491920178*^9, 3.827866499787828*^9}, {
3.827880107502122*^9, 3.827880110489819*^9}, {3.8278803491335773`*^9,
3.8278803498362722`*^9}, {3.827880748734083*^9, 3.827880760035133*^9}, {
3.827929195124152*^9, 3.827929216749443*^9}, {3.8279341148480263`*^9,
3.8279341192418633`*^9}, {3.827935607600779*^9, 3.8279356116142263`*^9}, {
3.827963129981091*^9, 3.82796315976654*^9}, {3.8280519181375093`*^9,
3.8280519203023453`*^9}, {3.828052027041071*^9, 3.828052031508585*^9}, {
3.828052330153921*^9, 3.828052332688218*^9}, {3.82805353441226*^9,
3.82805355022186*^9}, {3.828053630234252*^9, 3.8280536331338987`*^9}, {
3.828749661807633*^9, 3.828749662035388*^9}, {3.828812537081768*^9,
3.8288125525434027`*^9}, 3.828812600318439*^9},
CellLabel->
"In[2073]:=",ExpressionUUID->"72df5aa3-8906-427e-bb3b-c1808dea8387"]
}, Open ]],
Cell[CellGroupData[{
Cell["Viz", "Chapter",
CellChangeTimes->{{3.826928291844615*^9,
3.8269282922241096`*^9}},ExpressionUUID->"e1160f8e-c048-4d31-aca7-\
743e8587f70a"],
Cell[BoxData[{
RowBox[{
RowBox[{"pltEvery", "=", "20"}], ";"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"timesPlt", "=",
RowBox[{
RowBox[{"dataDesc", "[", "\"\<times\>\"", "]"}], "[",
RowBox[{"[",
RowBox[{";;", ";;", "pltEvery"}], "]"}], "]"}]}], ";"}]}], "Input",
InitializationCell->True,
CellChangeTimes->{{3.826928606496649*^9, 3.826928607053494*^9}, {
3.82692996444331*^9, 3.826929967104707*^9}, 3.826981515734066*^9, {
3.82785790319703*^9, 3.827857903433342*^9}, {3.8279632235322523`*^9,
3.8279632236260443`*^9}},
CellLabel->
"In[2080]:=",ExpressionUUID->"3df175fa-e231-4823-92e2-71d101b95292"],
Cell[CellGroupData[{
Cell[BoxData[{
RowBox[{"makeLF", "[",
RowBox[{"nv", ",", "nh"}], "]"}], "\[IndentingNewLine]",
RowBox[{"lfPlt", "=",
RowBox[{"Select", "[",
RowBox[{
RowBox[{"makeLF", "[",
RowBox[{"nv", ",", "nh"}], "]"}], ",",
RowBox[{
RowBox[{
RowBox[{
RowBox[{"StringLength", "[", "#", "]"}], "<", "4"}], "||",
RowBox[{"(",
RowBox[{
RowBox[{
RowBox[{"StringTake", "[",
RowBox[{"#", ",", "4"}], "]"}], "!=", "\"\<varh\>\""}], "&&",
RowBox[{
RowBox[{"StringTake", "[",
RowBox[{"#", ",", "3"}], "]"}], "!=", "\"\<muh\>\""}]}], ")"}]}],
"&"}]}], "]"}]}]}], "Input",
InitializationCell->True,
CellChangeTimes->{{3.826981410540247*^9, 3.826981413536302*^9}, {
3.827423033682396*^9, 3.827423039373155*^9}},
CellLabel->
"In[2082]:=",ExpressionUUID->"ab2fbfb3-ea9a-4965-96c8-583158b68f20"],
Cell[BoxData[
RowBox[{"{",
RowBox[{"\<\"wt11\"\>", ",", "\<\"wt12\"\>", ",", "\<\"wt13\"\>",
",", "\<\"sig2\"\>", ",", "\<\"varh11\"\>", ",", "\<\"b1\"\>",
",", "\<\"b2\"\>", ",", "\<\"b3\"\>", ",", "\<\"muh1\"\>"}],
"}"}]], "Output",
CellChangeTimes->{
3.8269814142514772`*^9, 3.826981458031474*^9, 3.826981516581376*^9,
3.827366376897416*^9, 3.827414482239728*^9, 3.8274230395638103`*^9,
3.8274234448843718`*^9, 3.827432848217409*^9, 3.8274379679506617`*^9,
3.827454840008165*^9, 3.827506019952036*^9, 3.8275820743790827`*^9,
3.827706172030733*^9, 3.8277783444240637`*^9, 3.827780503518793*^9,
3.827841751137334*^9, 3.827853660256621*^9, 3.827854242491549*^9, {
3.827857905623913*^9, 3.827857908043594*^9}, 3.827858000162238*^9,
3.8278665028171062`*^9, {3.827880114947516*^9, 3.8278801170856237`*^9},
3.827880363514533*^9, 3.827880867301673*^9, 3.827881122715332*^9,
3.8278813036902533`*^9, {3.827929223170208*^9, 3.82792925281841*^9},
3.827935699643112*^9, 3.8279357380662727`*^9, 3.827963110314476*^9, {
3.827963214414476*^9, 3.827963224398766*^9}, 3.827963664738627*^9, {
3.8280218933989983`*^9, 3.828021907957651*^9}, 3.8280519162044287`*^9,
3.828051963308949*^9, 3.8280520401719112`*^9, 3.828052380979136*^9,
3.828053557293796*^9, 3.828053676354135*^9, 3.8280564739424143`*^9,
3.828056514467875*^9, 3.828059732783132*^9, {3.828749676621335*^9,
3.82874969395541*^9}, 3.828812532136718*^9, 3.8288127649720984`*^9,
3.828815578346957*^9},
CellLabel->
"Out[2082]=",ExpressionUUID->"5b4736a4-2021-4ad8-a7a9-b25a2e50fdea"],
Cell[BoxData[
RowBox[{"{",
RowBox[{"\<\"wt11\"\>", ",", "\<\"wt12\"\>", ",", "\<\"wt13\"\>",
",", "\<\"sig2\"\>", ",", "\<\"b1\"\>", ",", "\<\"b2\"\>",
",", "\<\"b3\"\>"}], "}"}]], "Output",
CellChangeTimes->{
3.8269814142514772`*^9, 3.826981458031474*^9, 3.826981516581376*^9,
3.827366376897416*^9, 3.827414482239728*^9, 3.8274230395638103`*^9,
3.8274234448843718`*^9, 3.827432848217409*^9, 3.8274379679506617`*^9,
3.827454840008165*^9, 3.827506019952036*^9, 3.8275820743790827`*^9,
3.827706172030733*^9, 3.8277783444240637`*^9, 3.827780503518793*^9,
3.827841751137334*^9, 3.827853660256621*^9, 3.827854242491549*^9, {
3.827857905623913*^9, 3.827857908043594*^9}, 3.827858000162238*^9,
3.8278665028171062`*^9, {3.827880114947516*^9, 3.8278801170856237`*^9},
3.827880363514533*^9, 3.827880867301673*^9, 3.827881122715332*^9,
3.8278813036902533`*^9, {3.827929223170208*^9, 3.82792925281841*^9},
3.827935699643112*^9, 3.8279357380662727`*^9, 3.827963110314476*^9, {
3.827963214414476*^9, 3.827963224398766*^9}, 3.827963664738627*^9, {
3.8280218933989983`*^9, 3.828021907957651*^9}, 3.8280519162044287`*^9,
3.828051963308949*^9, 3.8280520401719112`*^9, 3.828052380979136*^9,
3.828053557293796*^9, 3.828053676354135*^9, 3.8280564739424143`*^9,
3.828056514467875*^9, 3.828059732783132*^9, {3.828749676621335*^9,
3.82874969395541*^9}, 3.828812532136718*^9, 3.8288127649720984`*^9,
3.8288155783483467`*^9},
CellLabel->
"Out[2083]=",ExpressionUUID->"465dbbf9-dc81-4966-8cfc-c5b1cbc7641f"]
}, Open ]],
Cell[BoxData[
RowBox[{
RowBox[{
RowBox[{"pltParamsAcrossIP3s", "[",
RowBox[{"params0_", ",", "noIP3R_", ",", "k_", ",", "ip3s_"}], "]"}], ":=",
RowBox[{"Module", "[", "\[IndentingNewLine]",
RowBox[{
RowBox[{"{",
RowBox[{
"r", ",", "ip3", ",", "ip3Key", ",", "xPlt", ",", "colors", ",",
"rngs"}], "}"}], "\[IndentingNewLine]", ",", "\[IndentingNewLine]",
RowBox[{
RowBox[{"rngs", "=",
RowBox[{"<|", "\[IndentingNewLine]",
RowBox[{
RowBox[{"\"\<wt11\>\"", "\[Rule]",
RowBox[{"{",
RowBox[{"0", ",", "1.5"}], "}"}]}], ",", "\[IndentingNewLine]",
RowBox[{"\"\<wt12\>\"", "\[Rule]",
RowBox[{"{",
RowBox[{
RowBox[{"-", "0.005"}], ",", "0.005"}], "}"}]}], ",",
"\[IndentingNewLine]",
RowBox[{"\"\<wt13\>\"", "\[Rule]",
RowBox[{"{",
RowBox[{
RowBox[{"-", "1"}], ",", "1"}], "}"}]}], ",",
"\[IndentingNewLine]",
RowBox[{"\"\<sig2\>\"", "\[Rule]",
RowBox[{"{",
RowBox[{"0", ",", "0.00015"}], "}"}]}], ",", "\[IndentingNewLine]",
RowBox[{"\"\<b1\>\"", "\[Rule]",
RowBox[{"{",
RowBox[{
RowBox[{"-", "1.2"}], ",", "2.5"}], "}"}]}], ",",
"\[IndentingNewLine]",
RowBox[{"\"\<b2\>\"", "\[Rule]",
RowBox[{"{",
RowBox[{
RowBox[{"-", "2"}], ",", "4"}], "}"}]}], ",",
"\[IndentingNewLine]",
RowBox[{"\"\<b3\>\"", "\[Rule]",
RowBox[{"{",
RowBox[{
RowBox[{"-", "1.2"}], ",", "1.2"}], "}"}]}]}],
"\[IndentingNewLine]", "|>"}]}], ";", "\[IndentingNewLine]",
"\[IndentingNewLine]",
RowBox[{"colors", "=",
RowBox[{"Table", "[",
RowBox[{
RowBox[{
RowBox[{"ColorData", "[", "\"\<BrownCyanTones\>\"", "]"}], "[",
RowBox[{"i", "/",
RowBox[{"Length", "[", "ip3s", "]"}]}], "]"}], ",",
RowBox[{"{",
RowBox[{"i", ",",
RowBox[{"Length", "[", "ip3s", "]"}]}], "}"}]}], "]"}]}], ";",
"\[IndentingNewLine]", "\[IndentingNewLine]",
RowBox[{"r", "=",
RowBox[{"Show", "[", "\[IndentingNewLine]",
RowBox[{
RowBox[{"Table", "[", "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"ip3", "=",
RowBox[{"ip3s", "[",
RowBox[{"[", "i", "]"}], "]"}]}], ";", "\[IndentingNewLine]",
RowBox[{"ip3Key", "=",
RowBox[{"{",
RowBox[{"noIP3R", ",", "ip3"}], "}"}]}], ";",
"\[IndentingNewLine]",
RowBox[{"xPlt", "=",
RowBox[{
RowBox[{
RowBox[{
RowBox[{"params0", "[", "ip3Key", "]"}], "[", "\"\<LFDL\>\"",
"]"}], "[", "k", "]"}], "[",
RowBox[{"[",
RowBox[{";;", ";;", "pltEvery"}], "]"}], "]"}]}], ";",
"\[IndentingNewLine]",
RowBox[{"ListLinePlot", "[",
RowBox[{
RowBox[{"Transpose", "[",
RowBox[{"{",
RowBox[{"timesPlt", ",", "xPlt"}], "}"}], "]"}], ",",
RowBox[{"PlotRange", "\[Rule]", "All"}], ",",
RowBox[{"PlotLabel", "\[Rule]", "k"}], ",",
RowBox[{"PlotStyle", "\[Rule]",
RowBox[{"colors", "[",
RowBox[{"[", "i", "]"}], "]"}]}]}], "]"}]}],
"\[IndentingNewLine]", ",",
RowBox[{"{",
RowBox[{"i", ",",
RowBox[{"Length", "[", "ip3s", "]"}]}], "}"}]}], "]"}], ",",
"\[IndentingNewLine]",
RowBox[{"PlotRange", "\[Rule]",
RowBox[{"rngs", "[", "k", "]"}]}], ",", "\[IndentingNewLine]",
RowBox[{"PlotLabel", "\[Rule]",
RowBox[{
RowBox[{"labels", "[", "k", "]"}], "<>", "\"\< # IP3R: \>\"", "<>",
RowBox[{"ToString", "[", "noIP3R", "]"}]}]}], ",",
"\[IndentingNewLine]",
RowBox[{"FrameLabel", "\[Rule]",
RowBox[{"{", "\"\<Time (s)\>\"", "}"}]}]}], "\[IndentingNewLine]",
"]"}]}], ";", "\[IndentingNewLine]",
RowBox[{"Return", "[", "r", "]"}], ";"}]}], "\[IndentingNewLine]",
"]"}]}], ";"}]], "Input",
InitializationCell->True,
CellChangeTimes->{{3.826982106948926*^9, 3.826982163316079*^9}, {
3.826982253364121*^9, 3.8269822549998426`*^9}, {3.827857935622498*^9,
3.827857962356133*^9}, {3.8278580227833223`*^9, 3.8278580404377747`*^9}, {
3.8279632907660103`*^9, 3.827963392100048*^9}, {3.827963428005684*^9,
3.8279634617743597`*^9}},
CellLabel->
"In[2084]:=",ExpressionUUID->"8b960a1c-c4bc-48ee-9f36-47e551735493"],
Cell[BoxData[
RowBox[{"(*", "\[IndentingNewLine]",
RowBox[{
RowBox[{"plts", "=",
RowBox[{"Table", "[", "\[IndentingNewLine]",
RowBox[{
RowBox[{"Table", "[", "\[IndentingNewLine]",
RowBox[{
RowBox[{"pltParamsAcrossIP3s", "[",
RowBox[{"params0", ",", "noIP3R", ",", "k", ",", "ip3s"}], "]"}],
"\[IndentingNewLine]", ",",
RowBox[{"{",
RowBox[{"noIP3R", ",", "noIP3Rs"}], "}"}]}], "]"}],
"\[IndentingNewLine]", ",",
RowBox[{"{",
RowBox[{"k", ",", "lfPlt"}], "}"}]}], "]"}]}], ";",
"\[IndentingNewLine]", "\[IndentingNewLine]",
RowBox[{"Grid", "[", "plts", "]"}]}], "\[IndentingNewLine]",
"*)"}]], "Input",
CellChangeTimes->{{3.8269282967339783`*^9, 3.82692829746688*^9}, {
3.826928346292224*^9, 3.82692834788262*^9}, {3.826928401388977*^9,
3.826928401533798*^9}, {3.826929842530972*^9, 3.8269299404023447`*^9}, {
3.8269814895753727`*^9, 3.826981490896734*^9}, {3.826981532829067*^9,
3.826981541158387*^9}, 3.82698210625382*^9, {3.826982166615057*^9,
3.826982168186569*^9}, {3.8269822598008966`*^9, 3.826982259927698*^9}, {
3.8277061831739798`*^9, 3.8277061834134912`*^9}, {3.827857739956718*^9,
3.827857740531437*^9}, {3.8278580051720257`*^9, 3.827858006543449*^9}, {
3.828056570746167*^9, 3.828056574444456*^9}},
CellLabel->
"In[2085]:=",ExpressionUUID->"70534e8c-c960-477a-813c-dead89027218"],
Cell[BoxData[
RowBox[{
RowBox[{
RowBox[{"pltParamsAcrossNoIP3Rs", "[",
RowBox[{"params0_", ",", "ip3_", ",", "k_", ",", "noIP3Rs_"}], "]"}], ":=",
RowBox[{"Module", "[", "\[IndentingNewLine]",
RowBox[{
RowBox[{"{",
RowBox[{"r", ",", "noIP3R", ",", "ip3Key", ",", "xPlt", ",", "colors"}],
"}"}], "\[IndentingNewLine]", ",", "\[IndentingNewLine]",
RowBox[{
RowBox[{"colors", "=",
RowBox[{"Table", "[",
RowBox[{
RowBox[{
RowBox[{"ColorData", "[", "\"\<BrownCyanTones\>\"", "]"}], "[",
RowBox[{"i", "/",
RowBox[{"Length", "[", "noIP3Rs", "]"}]}], "]"}], ",",
RowBox[{"{",
RowBox[{"i", ",",
RowBox[{"Length", "[", "noIP3Rs", "]"}]}], "}"}]}], "]"}]}], ";",
"\[IndentingNewLine]", "\[IndentingNewLine]",
RowBox[{"r", "=",
RowBox[{"Show", "[", "\[IndentingNewLine]",
RowBox[{
RowBox[{"Table", "[", "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"noIP3R", "=",
RowBox[{"noIP3Rs", "[",
RowBox[{"[", "i", "]"}], "]"}]}], ";", "\[IndentingNewLine]",
RowBox[{"ip3Key", "=",
RowBox[{"{",
RowBox[{"noIP3R", ",", "ip3"}], "}"}]}], ";",
"\[IndentingNewLine]",
RowBox[{"xPlt", "=",
RowBox[{
RowBox[{
RowBox[{
RowBox[{"params0", "[", "ip3Key", "]"}], "[", "\"\<LFDL\>\"",
"]"}], "[", "k", "]"}], "[",
RowBox[{"[",
RowBox[{";;", ";;", "pltEvery"}], "]"}], "]"}]}], ";",
"\[IndentingNewLine]",
RowBox[{"ListLinePlot", "[",
RowBox[{
RowBox[{"Transpose", "[",
RowBox[{"{",
RowBox[{"timesPlt", ",", "xPlt"}], "}"}], "]"}], ",",
RowBox[{"PlotRange", "\[Rule]", "All"}], ",",
RowBox[{"PlotLabel", "\[Rule]", "k"}], ",",
RowBox[{"PlotStyle", "\[Rule]",
RowBox[{"colors", "[",
RowBox[{"[", "i", "]"}], "]"}]}]}], "]"}]}],
"\[IndentingNewLine]", ",",
RowBox[{"{",
RowBox[{"i", ",",
RowBox[{"Length", "[", "noIP3Rs", "]"}]}], "}"}]}], "]"}], ",",
"\[IndentingNewLine]",
RowBox[{"PlotRange", "\[Rule]", "All"}], ",", "\[IndentingNewLine]",
RowBox[{"PlotLabel", "\[Rule]",
RowBox[{"ip3", "<>", "\"\< \>\"", "<>",
RowBox[{"labels", "[", "k", "]"}]}]}], ",", "\[IndentingNewLine]",
RowBox[{"FrameLabel", "\[Rule]",
RowBox[{"{", "\"\<Time (s)\>\"", "}"}]}]}], "\[IndentingNewLine]",
"]"}]}], ";", "\[IndentingNewLine]",
RowBox[{"Return", "[", "r", "]"}], ";"}]}], "\[IndentingNewLine]",
"]"}]}], ";"}]], "Input",
InitializationCell->True,
CellChangeTimes->{{3.826982106948926*^9, 3.826982163316079*^9}, {
3.826982253364121*^9, 3.8269822549998426`*^9}, {3.827857751248886*^9,
3.827857806663521*^9}, {3.827858062180847*^9, 3.827858073788727*^9}, {
3.827858115248301*^9, 3.827858161936473*^9}},
CellLabel->
"In[2086]:=",ExpressionUUID->"7eb1cdce-9f9c-4c20-b609-cded4d53ee6a"],
Cell[BoxData[
RowBox[{"(*", "\[IndentingNewLine]",
RowBox[{
RowBox[{"plts", "=",
RowBox[{"Table", "[", "\[IndentingNewLine]",
RowBox[{
RowBox[{"pltParamsAcrossNoIP3Rs", "[",
RowBox[{
"params0", ",", "\"\<ip3_0p500\>\"", ",", "k", ",", "noIP3Rs"}], "]"}],
"\[IndentingNewLine]", ",",
RowBox[{"{",
RowBox[{"k", ",",
RowBox[{"{",
RowBox[{"\"\<wt11\>\"", ",", "\"\<b1\>\""}], "}"}]}], "}"}]}],
"]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]",
RowBox[{"colors", "=",
RowBox[{"Table", "[",
RowBox[{
RowBox[{
RowBox[{"ColorData", "[", "\"\<BrownCyanTones\>\"", "]"}], "[",
RowBox[{"i", "/",
RowBox[{"Length", "[", "noIP3Rs", "]"}]}], "]"}], ",",
RowBox[{"{",
RowBox[{"i", ",",
RowBox[{"Length", "[", "noIP3Rs", "]"}]}], "}"}]}], "]"}]}], ";",
"\[IndentingNewLine]",
RowBox[{"leg", "=",
RowBox[{"LineLegend", "[",
RowBox[{
RowBox[{"colors", "[",
RowBox[{"[",
RowBox[{";;",
RowBox[{"Length", "[", "noIP3Rs", "]"}]}], "]"}], "]"}], ",",
"noIP3Rs"}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]",
RowBox[{"Grid", "[",
RowBox[{"{",
RowBox[{"Flatten", "[",
RowBox[{"{",
RowBox[{"leg", ",", "plts"}], "}"}], "]"}], "}"}], "]"}]}],
"\[IndentingNewLine]", "*)"}]], "Input",
CellChangeTimes->{{3.8269282967339783`*^9, 3.82692829746688*^9}, {
3.826928346292224*^9, 3.82692834788262*^9}, {3.826928401388977*^9,
3.826928401533798*^9}, {3.826929842530972*^9, 3.8269299404023447`*^9}, {
3.8269814895753727`*^9, 3.826981490896734*^9}, {3.826981532829067*^9,
3.826981541158387*^9}, 3.82698210625382*^9, {3.826982166615057*^9,
3.826982168186569*^9}, {3.8269822598008966`*^9, 3.826982259927698*^9}, {
3.8277061831739798`*^9, 3.8277061834134912`*^9}, {3.827857739956718*^9,
3.827857740531437*^9}, {3.827857795422591*^9, 3.827857799794959*^9}, {
3.8278578383363247`*^9, 3.8278578482904863`*^9}, {3.827858083446707*^9,
3.8278580950824614`*^9}, {3.827858164286261*^9, 3.827858181497961*^9}, {
3.8278625368672523`*^9, 3.8278625550587673`*^9}, {3.828052011926512*^9,
3.828052015851494*^9}, {3.828056581408017*^9, 3.828056590876629*^9}},
CellLabel->
"In[2087]:=",ExpressionUUID->"536567b1-0cb7-4be9-83a3-dfd88be98301"]
}, Open ]]
}, Open ]],
Cell[CellGroupData[{
Cell["Calculate derivs0", "Title",
CellChangeTimes->{{3.8249212047472878`*^9, 3.824921208418503*^9}, {
3.825346445549667*^9, 3.8253464543192*^9}, {3.825437371659089*^9,
3.825437376595051*^9}},ExpressionUUID->"f07b9768-23ad-46af-8668-\
543422b80e27"],
Cell[BoxData[
RowBox[{
RowBox[{"tvrDiff", "[",
RowBox[{
"nv_", ",", "nh_", ",", "lfNonConstant_", ",", "ip3Keys_", ",", "params_",
",", "dataDesc_", ",", "magZero_", ",", "alphas_"}], "]"}], ":=",
RowBox[{"Module", "[", "\[IndentingNewLine]",
RowBox[{
RowBox[{"{",
RowBox[{
"dx", ",", "n", ",", "structsTVR", ",", "noOptSteps", ",", "derivs", ",",
"ip3", ",", "dat", ",", "derivGuess", ",", "noIP3R", ",", "ip3Key",
",", "derivLFDL", ",", "iKey"}], "}"}], "\[IndentingNewLine]", ",",
"\[IndentingNewLine]",
RowBox[{
RowBox[{"dx", "=", "1"}], ";", "\[IndentingNewLine]",
RowBox[{"n", "=",
RowBox[{"dataDesc", "[", "\"\<noTpts\>\"", "]"}]}], ";",
"\[IndentingNewLine]",
RowBox[{"structsTVR", "=",
RowBox[{"makeTVRstructs", "[",
RowBox[{"n", ",", "dx", ",", "0.0"}], "]"}]}], ";",
"\[IndentingNewLine]",
RowBox[{"derivGuess", "=",
RowBox[{"ConstantArray", "[",
RowBox[{"0", ",",
RowBox[{"n", "-", "1"}]}], "]"}]}], ";", "\[IndentingNewLine]",
"\[IndentingNewLine]",
RowBox[{"noOptSteps", "=", "10"}], ";", "\[IndentingNewLine]",
RowBox[{"derivs", "=",
RowBox[{"Association", "[", "]"}]}], ";", "\[IndentingNewLine]",
"\[IndentingNewLine]",
RowBox[{"Monitor", "[", "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"Do", "[", "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"ip3Key", "=",
RowBox[{"ip3Keys", "[",
RowBox[{"[", "iKey", "]"}], "]"}]}], ";", "\[IndentingNewLine]",
RowBox[{
RowBox[{"{",
RowBox[{"noIP3R", ",", "ip3"}], "}"}], "=", "ip3Key"}], ";",
"\[IndentingNewLine]", "\[IndentingNewLine]",
RowBox[{"derivLFDL", "=",
RowBox[{"Association", "[", "]"}]}], ";", "\[IndentingNewLine]",
RowBox[{"Do", "[", "\[IndentingNewLine]", "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"dat", "=",
RowBox[{
RowBox[{
RowBox[{"params", "[", "ip3Key", "]"}], "[", "\"\<LFDL\>\"",
"]"}], "[", "k", "]"}]}], ";", "\[IndentingNewLine]",
"\[IndentingNewLine]",
RowBox[{"If", "[",
RowBox[{
RowBox[{"MemberQ", "[",
RowBox[{"lfNonConstant", ",", "k"}], "]"}], ",",
"\[IndentingNewLine]", "\[IndentingNewLine]",
RowBox[{"(*", " ", "Differentiate", " ", "*)"}],
"\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"structsTVR", "[", "\"\<alpha\>\"", "]"}], "=",
RowBox[{"alphas", "[", "k", "]"}]}], ";",
"\[IndentingNewLine]",
RowBox[{
RowBox[{"derivLFDL", "[", "k", "]"}], "=",
RowBox[{"getDiffTVRGivenStructs", "[",
RowBox[{
"dat", ",", "derivGuess", ",", "noOptSteps", ",",
"structsTVR"}], "]"}]}], ";", "\[IndentingNewLine]",
"\[IndentingNewLine]",
RowBox[{"(*", " ",
RowBox[{
"Set", " ", "small", " ", "magnitudes", " ", "to", " ",
"zero"}], " ", "*)"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"derivLFDL", "[", "k", "]"}], "=",
RowBox[{"Table", "[",
RowBox[{
RowBox[{"If", "[",
RowBox[{
RowBox[{
RowBox[{"Abs", "[", "x", "]"}], "<", "magZero"}], ",",
"0.0", ",", "x"}], "]"}], ",",
RowBox[{"{",
RowBox[{"x", ",",
RowBox[{"derivLFDL", "[", "k", "]"}]}], "}"}]}], "]"}]}],
";"}], "\[IndentingNewLine]", ",", "\[IndentingNewLine]",
"\[IndentingNewLine]",
RowBox[{"(*", " ", "Constant", " ", "*)"}],
"\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"derivLFDL", "[", "k", "]"}], "=",
RowBox[{"ConstantArray", "[",
RowBox[{"0.0", ",",
RowBox[{"n", "-", "1"}]}], "]"}]}], ";"}]}],
"\[IndentingNewLine]", "]"}], ";"}], "\[IndentingNewLine]",
"\[IndentingNewLine]", ",",
RowBox[{"{",
RowBox[{"k", ",",
RowBox[{"makeLF", "[",
RowBox[{"nv", ",", "nh"}], "]"}]}], "}"}]}], "]"}], ";",
"\[IndentingNewLine]", "\[IndentingNewLine]",
RowBox[{
RowBox[{"derivs", "[", "ip3Key", "]"}], "=",
RowBox[{"makePStructFromLFDL", "[",
RowBox[{"nv", ",", "nh", ",", "derivLFDL"}], "]"}]}], ";"}],
"\[IndentingNewLine]", "\[IndentingNewLine]", ",",
RowBox[{"{",
RowBox[{"iKey", ",",
RowBox[{"Length", "[", "ip3Keys", "]"}]}], "}"}]}], "]"}], ";"}],
"\[IndentingNewLine]", ",",
RowBox[{"ProgressIndicator", "[",
RowBox[{"iKey", ",",
RowBox[{"{",
RowBox[{"1", ",",
RowBox[{"Length", "[", "ip3Keys", "]"}]}], "}"}]}], "]"}]}], "]"}],
";", "\[IndentingNewLine]", "\[IndentingNewLine]",
RowBox[{"Return", "[",
RowBox[{"{",
RowBox[{"derivs", ",", "structsTVR"}], "}"}], "]"}], ";"}]}],
"\[IndentingNewLine]", "]"}]}]], "Input",
InitializationCell->True,
CellChangeTimes->{{3.825346843987665*^9, 3.8253468519020147`*^9}, {
3.825351390172843*^9, 3.825351442730978*^9}, {3.825351808631398*^9,
3.8253518120496073`*^9}, {3.825351877645734*^9, 3.825351879016765*^9}, {
3.825351915388308*^9, 3.825351925355152*^9}, {3.8259460203992243`*^9,
3.8259460255929737`*^9}, {3.8259461536346083`*^9, 3.82594615425198*^9}, {
3.8261348103326883`*^9, 3.826134815324239*^9}, {3.826907347700548*^9,
3.826907433644623*^9}, {3.826907471847309*^9, 3.826907509457746*^9}, {
3.826907977362055*^9, 3.826908084256667*^9}, {3.826981722999403*^9,
3.826981751789892*^9}, {3.827414452450876*^9, 3.827414472868821*^9}, {
3.827423071183346*^9, 3.8274230748286333`*^9}, {3.827423119832197*^9,
3.8274231218222227`*^9}, {3.827432831479183*^9, 3.827432832609497*^9}, {
3.8274351466793213`*^9, 3.827435148364595*^9}, {3.827454770332447*^9,
3.827454771405634*^9}, {3.827706396661667*^9, 3.827706406148635*^9}, {
3.8277065686989603`*^9, 3.827706568821061*^9}, {3.827778382088956*^9,
3.827778386883872*^9}, {3.827780481648356*^9, 3.82778049032059*^9}, {
3.8278808437033567`*^9, 3.827880849693976*^9}, {3.827881081619125*^9,
3.8278811076344643`*^9}, {3.8278812881685762`*^9, 3.82788128986377*^9}, {
3.827935665855214*^9, 3.827935693497528*^9}, {3.82796380992762*^9,
3.82796381125146*^9}, 3.827964288820815*^9, 3.827964809544083*^9, {
3.827964849981776*^9, 3.827964864566684*^9}, {3.827965055026527*^9,
3.827965071054562*^9}, {3.827965160270193*^9, 3.827965188899871*^9}, {
3.827965482309086*^9, 3.827965483285186*^9}, {3.827965589943448*^9,
3.827965592080288*^9}, {3.82796563647611*^9, 3.827965638089809*^9},
3.827965683147583*^9, {3.827965762277792*^9, 3.8279657724074173`*^9}, {
3.827965817781451*^9, 3.827965818340933*^9}, {3.8279660990238132`*^9,
3.8279661254696903`*^9}, {3.827966232873661*^9, 3.827966248867207*^9}},
CellLabel->
"In[2088]:=",ExpressionUUID->"a1639b64-c512-4f8f-9ac9-dbfc56f556c2"],
Cell[BoxData[
RowBox[{
RowBox[{"makeFilteredFromDerivs", "[",
RowBox[{
"nv_", ",", "nh_", ",", "lfNonConstant_", ",", "lfConstantNonZero_", ",",
"lfConstantZero_", ",", "ip3Keys_", ",", "derivs_", ",", "params_", ",",
"structsTVR_", ",", "dataDesc_"}], "]"}], ":=",
RowBox[{"Module", "[", "\[IndentingNewLine]",
RowBox[{
RowBox[{"{",
RowBox[{"filtered", ",", "initPt", ",", "fLFDL", ",", "meanVal"}], "}"}],
"\[IndentingNewLine]", ",", "\[IndentingNewLine]",
RowBox[{
RowBox[{"filtered", "=",
RowBox[{"Association", "[", "]"}]}], ";", "\[IndentingNewLine]",
RowBox[{"Do", "[", "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"fLFDL", "=",
RowBox[{"Association", "[", "]"}]}], ";", "\[IndentingNewLine]",
"\[IndentingNewLine]",
RowBox[{"Do", "[", "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"If", "[",
RowBox[{
RowBox[{"MemberQ", "[",
RowBox[{"lfNonConstant", ",", "k"}], "]"}], ",",
"\[IndentingNewLine]",
RowBox[{
RowBox[{"initPt", "=",
RowBox[{
RowBox[{
RowBox[{
RowBox[{"params", "[", "ip3Key", "]"}], "[", "\"\<LFDL\>\"",
"]"}], "[", "k", "]"}], "[",
RowBox[{"[", "1", "]"}], "]"}]}], ";", "\[IndentingNewLine]",
RowBox[{
RowBox[{"fLFDL", "[", "k", "]"}], "=",
RowBox[{"initPt", "+",
RowBox[{
RowBox[{"structsTVR", "[", "\"\<amat\>\"", "]"}], ".",
RowBox[{
RowBox[{
RowBox[{"derivs", "[", "ip3Key", "]"}], "[",
"\"\<LFDL\>\"", "]"}], "[", "k", "]"}]}]}]}], ";",
"\[IndentingNewLine]",
RowBox[{
RowBox[{"fLFDL", "[", "k", "]"}], "=",
RowBox[{"Flatten", "[",
RowBox[{"{",
RowBox[{"initPt", ",",
RowBox[{"fLFDL", "[", "k", "]"}]}], "}"}], "]"}]}], ";"}]}],
"\[IndentingNewLine]", "]"}], ";", "\[IndentingNewLine]",
"\[IndentingNewLine]",
RowBox[{"If", "[",
RowBox[{
RowBox[{"MemberQ", "[",
RowBox[{"lfConstantNonZero", ",", "k"}], "]"}], ",",
"\[IndentingNewLine]",
RowBox[{
RowBox[{"meanVal", "=",
RowBox[{"Mean", "[",