test/Tools/isac/Knowledge/eqsystem-2.sml
author wneuper <Walther.Neuper@jku.at>
Wed, 19 Oct 2022 10:43:04 +0200
changeset 60567 bb3140a02f3d
parent 60565 f92963a33fe3
child 60571 19a172de0bb5
permissions -rw-r--r--
eliminate term2str in src, Prog_Tac.*_adapt_to_type
walther@60347
     1
(* Title: Knowledge/eqsystem-2.sml
walther@60347
     2
   author: Walther Neuper 050826,
walther@60347
     3
   (c) due to copyright terms
walther@60347
     4
*)
Walther@60567
     5
"-----------------------------------------------------------------------------------------------";
Walther@60567
     6
"table of contents -----------------------------------------------------------------------------";
Walther@60567
     7
"-----------------------------------------------------------------------------------------------";
Walther@60567
     8
"----------- occur_exactly_in ---------------------------------------------------equsystem-1.sml";
Walther@60567
     9
"----------- problems -----------------------------------------------------------equsystem-1.sml";
Walther@60567
    10
"----------- rewrite-order ord_simplify_System ----------------------------------equsystem-1.sml";
Walther@60567
    11
"----------- rewrite in [EqSystem,normalise,2x2] --------------------------------equsystem-1.sml";
Walther@60567
    12
"----------- rewrite example from 2nd [EqSystem,normalise,2x2] ------------------equsystem-1.sml";
Walther@60567
    13
"----------- rewrite in [EqSystem,top_down_substitution,2x2] --------------------equsystem-1.sml";
Walther@60567
    14
"----------- rewrite in [EqSystem,normalise,4x4] --------------------------------equsystem-1.sml";
Walther@60567
    15
"----------- script [EqSystem,top_down_substitution,2x2] Vers.1 -----------------equsystem-1.sml";
Walther@60567
    16
"----------- refine [linear,system]----------------------------------------------equsystem-1.sml";
Walther@60567
    17
"----------- refine [2x2,linear,system] search error-----------------------------equsystem-1.sml";
Walther@60567
    18
"----------- me [EqSystem,normalise,2x2], refine Subproblem ---------------------equsystem-1.sml";
Walther@60567
    19
"----------- me [EqSystem,normalise,2x2], refine Subproblem, step into istate---equsystem-1a.sml";
Walther@60567
    20
"----------- me [linear,system] ..normalise..top_down_sub..----------------------equsystem-2.sml";
Walther@60567
    21
"----------- all systems from Biegelinie ----------------------------------------equsystem-2.sml";
Walther@60567
    22
"----------- 4x4 systems from Biegelinie ----------------------------------------equsystem-2.sml";
Walther@60567
    23
"-----------------------------------------------------------------------------------------------";
Walther@60567
    24
"-----------------------------------------------------------------------------------------------";
Walther@60567
    25
"-----------------------------------------------------------------------------------------------";
walther@60347
    26
walther@60347
    27
val thy = @{theory "EqSystem"};
walther@60347
    28
val ctxt = Proof_Context.init_global thy;
walther@60347
    29
walther@60347
    30
"----------- me [linear,system] ..normalise..top_down_sub..-------";
walther@60347
    31
"----------- me [linear,system] ..normalise..top_down_sub..-------";
walther@60347
    32
"----------- me [linear,system] ..normalise..top_down_sub..-------";
walther@60347
    33
val fmz = 
walther@60347
    34
    ["equalities\
walther@60347
    35
     \[0 = c_2 + c * 0 + 1 / EI * (L * q_0 / 12 * 0 \<up> 3 +                \
walther@60347
    36
     \                                            - 1 * q_0 / 24 * 0 \<up> 4),\
walther@60347
    37
     \ 0 = c_2 + c * L + 1 / EI * (L * q_0 / 12 * L \<up> 3 +                \
walther@60347
    38
     \                                            - 1 * q_0 / 24 * L \<up> 4)]",
walther@60347
    39
     "solveForVars [c, c_2]", "solution LL"];
walther@60347
    40
val (dI',pI',mI') =
walther@60347
    41
  ("Biegelinie",["LINEAR", "system"], ["no_met"]);
walther@60347
    42
val p = e_pos'; val c = []; 
walther@60347
    43
val (p,_,f,nxt,_,pt) = CalcTreeTEST [(fmz, (dI',pI',mI'))];
walther@60347
    44
val (p,_,f,nxt,_,pt) = me nxt p c pt;val (p,_,f,nxt,_,pt) = me nxt p c pt;
walther@60347
    45
val (p,_,f,nxt,_,pt) = me nxt p c pt;val (p,_,f,nxt,_,pt) = me nxt p c pt;
walther@60347
    46
val (p,_,f,nxt,_,pt) = me nxt p c pt;val (p,_,f,nxt,_,pt) = me nxt p c pt;
walther@60347
    47
val (p,_,f,nxt,_,pt) = me nxt p c pt;
walther@60347
    48
case nxt of (Specify_Method ["EqSystem", "normalise", "2x2"]) => ()
walther@60347
    49
	  | _ => error "eqsystem.sml [linear,system] specify b";
walther@60347
    50
val (p,_,f,nxt,_,pt) = me nxt p c pt;
walther@60347
    51
val (p,_,f,nxt,_,pt) = me nxt p c pt;f2str f;
walther@60347
    52
val (p,_,f,nxt,_,pt) = me nxt p c pt;f2str f;
walther@60347
    53
val (p,_,f,nxt,_,pt) = me nxt p c pt;f2str f;
walther@60347
    54
val (p,_,f,nxt,_,pt) = me nxt p c pt;f2str f;
walther@60347
    55
val (p,_,f,nxt,_,pt) = me nxt p c pt;f2str f;
walther@60347
    56
if f2str f =(*BEFORE "eliminate ThmC.numerals_to_Free"..
walther@60347
    57
  "[c_2 = 0, L * c + c_2 = - 1 * q_0 * L \<up> 4 / (24 * EI)]"*)
walther@60347
    58
  "[c_2 = 0, L * c + c_2 = - 1 * q_0 * L \<up> 4 / 24]"
walther@60347
    59
then () else error "eqsystem.sml me simpl. before SubProblem b";
walther@60347
    60
case nxt of
walther@60347
    61
    (Subproblem ("Biegelinie", ["triangular", "2x2", "LINEAR",_])) => ()
walther@60347
    62
  | _ => error "eqsystem.sml me [linear,system] SubProblem b";
walther@60347
    63
walther@60347
    64
val (p,_,f,nxt,_,pt) = me nxt p c pt;val (p,_,f,nxt,_,pt) = me nxt p c pt;
walther@60347
    65
val (p,_,f,nxt,_,pt) = me nxt p c pt;val (p,_,f,nxt,_,pt) = me nxt p c pt;
walther@60347
    66
val (p,_,f,nxt,_,pt) = me nxt p c pt;val (p,_,f,nxt,_,pt) = me nxt p c pt;
walther@60347
    67
val (p,_,f,nxt,_,pt) = me nxt p c pt;val (p,_,f,nxt,_,pt) = me nxt p c pt;
walther@60347
    68
case nxt of
walther@60347
    69
    (Specify_Method ["EqSystem", "top_down_substitution", "2x2"]) => ()
walther@60347
    70
  | _ => error "eqsystem.sml me [EqSys...2x2] top_down_substitution b";
walther@60347
    71
walther@60347
    72
val (p,_,f,nxt,_,pt) = me nxt p c pt;
walther@60347
    73
val PblObj {probl,...} = get_obj I pt [5];
walther@60360
    74
    (writeln o (I_Model.to_string (Proof_Context.init_global @{theory Isac_Knowledge}))) probl;
walther@60347
    75
(*[
walther@60347
    76
(1 ,[1] ,true ,#Given ,Cor equalities [c_2 = 0, L * c + c_2 = q_0 * L \<up> 2 / 2] ,(es_, [[c_2 = 0, L * c + c_2 = q_0 * L \<up> 2 / 2]])),
walther@60347
    77
(2 ,[1] ,true ,#Given ,Cor solveForVars [c, c_2] ,(v_s, [[c, c_2]])),
walther@60347
    78
(3 ,[1] ,true ,#Find ,Cor solution ss___ ,(ss___, [ss___]))]
walther@60347
    79
*)
walther@60347
    80
val (p,_,f,nxt,_,pt) = me nxt p c pt;f2str f;
walther@60347
    81
val (p,_,f,nxt,_,pt) = me nxt p c pt;f2str f;
walther@60347
    82
val (p,_,f,nxt,_,pt) = me nxt p c pt;f2str f;
walther@60347
    83
val (p,_,f,nxt,_,pt) = me nxt p c pt;f2str f;
walther@60347
    84
val (p,_,f,nxt,_,pt) = me nxt p c pt;f2str f;
walther@60347
    85
val (p,_,f,nxt,_,pt) = me nxt p c pt;f2str f;
walther@60347
    86
val (p,_,f,nxt,_,pt) = me nxt p c pt;f2str f;
walther@60347
    87
val (p,_,f,nxt,_,pt) = me nxt p c pt;f2str f;
walther@60347
    88
case nxt of
walther@60347
    89
    (Check_Postcond ["triangular", "2x2", "LINEAR", "system"]) => ()
walther@60347
    90
  | _ => error "eqsystem.sml me Subpbl .[EqSys...2x2] finished b";
walther@60347
    91
val (p,_,f,nxt,_,pt) = me nxt p c pt;f2str f;
walther@60347
    92
val (p,_,f,nxt,_,pt) = me nxt p c pt;f2str f;
walther@60347
    93
walther@60347
    94
if f2str f =(*BEFORE "eliminate ThmC.numerals_to_Free"..
walther@60347
    95
  "[c = - 1 * q_0 * L \<up> 3 / (24 * EI), c_2 = 0]"*)
walther@60347
    96
  "[c = - 1 * q_0 * L \<up> 3 / 24, c_2 = 0]"
walther@60347
    97
then () else error "eqsystem.sml me [EqSys...2x2] finished f2str f b";
walther@60347
    98
case nxt of
walther@60347
    99
    (End_Proof') => ()
walther@60347
   100
  | _ => error "eqsystem.sml me [EqSys...2x2] finished End_Proof'";
walther@60347
   101
walther@60347
   102
walther@60347
   103
"----------- all systems from Biegelinie -------------------------";
walther@60347
   104
"----------- all systems from Biegelinie -------------------------";
walther@60347
   105
"----------- all systems from Biegelinie -------------------------";
walther@60347
   106
val thy = @{theory Isac_Knowledge}
walther@60347
   107
val subst = 
Walther@60565
   108
  [(TermC.parse_test @{context} "bdv_1", TermC.parse_test @{context} "c"), (TermC.parse_test @{context} "bdv_2", TermC.parse_test @{context} "c_2"),
Walther@60565
   109
	(TermC.parse_test @{context} "bdv_3", TermC.parse_test @{context} "c_3"), (TermC.parse_test @{context} "bdv_4", TermC.parse_test @{context} "c_4")]; 
walther@60347
   110
walther@60347
   111
"------- Bsp 7.27";
Walther@60549
   112
States.reset ();
walther@60347
   113
CalcTree [(
walther@60347
   114
  ["Traegerlaenge L", "Streckenlast q_0", "Biegelinie y",
walther@60347
   115
	  "Randbedingungen [y 0 = (0::real), y L = 0, M_b 0 = 0, M_b L = 0]", "FunktionsVariable x"],
walther@60347
   116
	("Biegelinie", ["Biegelinien"], ["IntegrierenUndKonstanteBestimmen2"]))];
walther@60347
   117
moveActiveRoot 1;
walther@60347
   118
(*
walther@60347
   119
LItool.trace_on := true; autoCalculate 1 CompleteCalc; LItool.trace_on := false;
walther@60347
   120
##7.27##          ordered           substs
walther@60347
   121
          c_4       c_2           
walther@60347
   122
c c_2 c_3 c_4     c c_2             1->2: c
walther@60347
   123
  c_2                       c_4	  
walther@60347
   124
c c_2             c c_2 c_3 c_4     [2':c, 1:c_2, 3:c_4] -> 4:c_3*)
Walther@60565
   125
val t = TermC.parse_test @{context}
walther@60347
   126
  ("[0 = c_4, " ^
walther@60347
   127
  "0 = c_4 + L * c_3 +(12 * L \<up> 2 * c_2 + 4 * L \<up> 3 * c + - 1 * L \<up> 4 * q_0) / (- 24 * EI), " ^
walther@60347
   128
  "0 = c_2, " ^
walther@60347
   129
  "0 = (2 * c_2 + 2 * L * c + - 1 * L \<up> 2 * q_0) / 2]");
Walther@60500
   130
val SOME (t, _) = rewrite_set_ ctxt false isolate_bdvs_4x4 t;
walther@60347
   131
if UnparseC.term t =
walther@60347
   132
"[c_4 = 0,\n (12 * L \<up> 2 * c_2 + 4 * L \<up> 3 * c + - 1 * L \<up> 4 * q_0) /\n (- 24 * EI) =\n - 1 * (c_4 + L * c_3) + 0,\n c_2 = 0, (2 * c_2 + 2 * L * c + - 1 * L \<up> 2 * q_0) / 2 = 0]"
walther@60347
   133
then () else error "Bsp 7.27";
walther@60347
   134
walther@60347
   135
"----- Bsp 7.27 go through the rewrites in met_eqsys_norm_4x4";
Walther@60565
   136
val t = TermC.parse_test @{context} "0 = (2 * c_2 + 2 * L * c + - 1 * L \<up> 2 * q_0) / 2";
Walther@60500
   137
val NONE = rewrite_set_ ctxt false norm_Rational t;
walther@60347
   138
val SOME (t,_) = 
Walther@60500
   139
    rewrite_set_inst_ ctxt false subst simplify_System_parenthesized t;
walther@60347
   140
if UnparseC.term t = "0 = - 1 * q_0 * L \<up> 2 / 2 + (L * c + c_2)"
walther@60347
   141
then () else error "Bsp 7.27 go through the rewrites in met_eqsys_norm_4x4";
walther@60347
   142
walther@60347
   143
"--- isolate_bdvs_4x4";
walther@60347
   144
(*
Walther@60500
   145
val SOME (t,_) = rewrite_set_inst_ ctxt false subst isolate_bdvs_4x4 t;
walther@60347
   146
UnparseC.term t;
Walther@60500
   147
val SOME (t,_) = rewrite_set_inst_ ctxt false subst simplify_System t;
walther@60347
   148
UnparseC.term t;
Walther@60500
   149
val SOME (t,_) = rewrite_set_ ctxt false order_system t;
walther@60347
   150
UnparseC.term t;
walther@60347
   151
*)
walther@60347
   152
walther@60347
   153
"------- Bsp 7.28 ---------------vvvvvvvvvvvvv Momentenlinie postponed";
Walther@60549
   154
States.reset ();
walther@60347
   155
CalcTree [((*WN130908  <ERROR> error in kernel </ERROR>*)
walther@60347
   156
  ["Traegerlaenge L", "Momentenlinie (-q_0 / L * x \<up> 3 / 6)",
walther@60347
   157
	    "Biegelinie y",
walther@60347
   158
	    "Randbedingungen [y L = 0, y' L = 0]",
walther@60347
   159
	    "FunktionsVariable x"],
walther@60347
   160
	   ("Biegelinie", ["vonMomentenlinieZu", "Biegelinien"],
walther@60347
   161
	    ["Biegelinien", "AusMomentenlinie"]))];
walther@60347
   162
(*
walther@60347
   163
moveActiveRoot 1;
walther@60347
   164
LItool.trace_on := true; autoCalculate 1 CompleteCalc; LItool.trace_on := false;
walther@60347
   165
*)
walther@60347
   166
walther@60347
   167
"------- Bsp 7.69";
Walther@60549
   168
States.reset ();
walther@60347
   169
CalcTree [(
walther@60347
   170
  ["Traegerlaenge L", "Streckenlast q_0", "Biegelinie y",
walther@60347
   171
	  "Randbedingungen [y 0 = (0::real), y L = 0, y' 0 = 0, y' L = 0]", "FunktionsVariable x"],
walther@60347
   172
	("Biegelinie", ["Biegelinien"], ["IntegrierenUndKonstanteBestimmen2"]))];
walther@60347
   173
moveActiveRoot 1;
walther@60347
   174
(*
walther@60347
   175
LItool.trace_on := true; autoCalculate 1 CompleteCalc; LItool.trace_on := false;
walther@60347
   176
##7.69##          ordered           subst                   2x2
walther@60347
   177
          c_4           c_3         
walther@60347
   178
c c_2 c_3 c_4     c c_2 c_3	    1:c_3 -> 2:c c_2        2:         c c_2
walther@60347
   179
      c_3                   c_4	 			   
walther@60347
   180
c c_2 c_3         c c_2 c_3 c_4     3:c_4 -> 4:c c_2 c_3    1:c_3 -> 4:c c_2*)
Walther@60565
   181
val t = TermC.parse_test @{context} 
walther@60347
   182
  ("[0 = c_4 + 0 / (- 1 * EI), " ^
walther@60347
   183
  "0 = c_4 + L * c_3 + (12 * L \<up> 2 * c_2 + 4 * L \<up> 3 * c + - 1 * L \<up> 4 * q_0) / (- 24 * EI), " ^
walther@60347
   184
  "0 = c_3 + 0 / (- 1 * EI), " ^
walther@60347
   185
  "0 = c_3 + (6 * L * c_2 + 3 * L \<up> 2 * c + - 1 * L \<up> 3 * q_0) / (-6 * EI)]");
walther@60347
   186
walther@60347
   187
"------- Bsp 7.70";
Walther@60549
   188
States.reset ();
walther@60347
   189
CalcTree [(
walther@60347
   190
  ["Traegerlaenge L", "Streckenlast q_0", "Biegelinie y",
walther@60347
   191
	  "Randbedingungen [Q 0 = q_0 * L, M_b L = 0, y 0 = (0::real), y' 0 = 0]", "FunktionsVariable x"],
walther@60347
   192
	("Biegelinie", ["Biegelinien"], ["IntegrierenUndKonstanteBestimmen2"] ))];
walther@60347
   193
moveActiveRoot 1;
walther@60347
   194
(*
walther@60347
   195
LItool.trace_on := true; autoCalculate 1 CompleteCalc; LItool.trace_on := false;
walther@60347
   196
##7.70##        |subst
walther@60347
   197
c		|
walther@60347
   198
c c_2           |1:c -> 2:c_2
walther@60347
   199
      c_3	|
walther@60347
   200
          c_4   |            STOPPED.WN06? test methods @@@@@@@@@@@@@@@@@@@@@@@*)
walther@60347
   201
walther@60347
   202
"----- 7.70 go through the rewrites in met_eqsys_norm_4x4";
Walther@60565
   203
val t = TermC.parse_test @{context}
walther@60347
   204
  ("[L * q_0 = c, " ^
walther@60347
   205
  "0 = (2 * c_2 + 2 * L * c + - 1 * L \<up> 2 * q_0) / 2, " ^
walther@60347
   206
  "0 = c_4, " ^
walther@60347
   207
  "0 = c_3]");
Walther@60509
   208
val SOME (t,_) = rewrite_ ctxt Rewrite_Ord.function_empty Rule_Set.empty false @{thm commute_0_equality} t;
Walther@60509
   209
val SOME (t,_) = rewrite_ ctxt Rewrite_Ord.function_empty Rule_Set.empty false @{thm commute_0_equality} t;
Walther@60509
   210
val SOME (t,_) = rewrite_ ctxt Rewrite_Ord.function_empty Rule_Set.empty false @{thm commute_0_equality} t;
walther@60347
   211
if UnparseC.term t = 
walther@60347
   212
  "[L * q_0 = c, (2 * c_2 + 2 * L * c + - 1 * L \<up> 2 * q_0) / 2 = 0,\n c_4 = 0, c_3 = 0]"
walther@60347
   213
then () else error "7.70 go through the rewrites in met_eqsys_norm_4x4, 1";
walther@60347
   214
Walther@60500
   215
val SOME (t,_) = rewrite_set_inst_ ctxt false subst simplify_System_parenthesized t;
walther@60347
   216
if UnparseC.term t = "[L * q_0 = c, - 1 * q_0 * L \<up> 2 / 2 + (L * c + c_2) = 0, c_4 = 0,\n c_3 = 0]"
walther@60347
   217
then () else error "7.70 go through the rewrites in met_eqsys_norm_4x4, 2";
walther@60347
   218
Walther@60500
   219
val SOME (t,_) = rewrite_set_inst_ ctxt false subst isolate_bdvs_4x4 t;
walther@60347
   220
if UnparseC.term t =
walther@60347
   221
   "[c = (- 1 * (L * q_0) + 0) / - 1,\n" ^ 
walther@60347
   222
   " L * c + c_2 = - 1 * (- 1 * q_0 * L \<up> 2 / 2) + 0, c_4 = 0, c_3 = 0]"
walther@60347
   223
then () else error "7.70 go through the rewrites in met_eqsys_norm_4x4, 3";
walther@60347
   224
Walther@60500
   225
val SOME (t,_) = rewrite_set_inst_ ctxt false subst simplify_System_parenthesized t;
walther@60395
   226
if UnparseC.term t =
walther@60395
   227
  "[c = - 1 * L * q_0 / - 1, L * c + c_2 = q_0 * L \<up> 2 / 2, c_4 = 0,\n c_3 = 0]"
walther@60347
   228
then () else error "7.70 go through the rewrites in met_eqsys_norm_4x4, 4";
walther@60347
   229
Walther@60500
   230
val SOME (t, _) = rewrite_set_ ctxt false order_system t;
walther@60395
   231
if UnparseC.term t =
walther@60395
   232
  "[c = - 1 * L * q_0 / - 1, L * c + c_2 = q_0 * L \<up> 2 / 2, c_3 = 0,\n c_4 = 0]"
walther@60347
   233
then () else error "eqsystem.sml: exp 7.70 normalise 4x4 by rewrite changed";
walther@60347
   234
walther@60347
   235
"----- 7.70 with met normalise: ";
walther@60347
   236
val fmz = ["equalities" ^
walther@60347
   237
  "[L * q_0 = c, " ^
walther@60347
   238
  "0 = (2 * c_2 + 2 * L * c + - 1 * L \<up> 2 * q_0) / 2, " ^
walther@60347
   239
  "0 = c_4, " ^
walther@60347
   240
  "0 = c_3]", "solveForVars [c, c_2, c_3, c_4]", "solution LL"];
walther@60347
   241
val (dI',pI',mI') = ("Biegelinie",["LINEAR", "system"], ["no_met"]);
walther@60347
   242
val p = e_pos'; val c = [];
walther@60347
   243
walther@60347
   244
(*============ inhibit exn WN120314 TODO: investigate type error (same as above)==
walther@60347
   245
  in next but one test below the same type error.
walther@60347
   246
/-------------------------------------------------------\
walther@60347
   247
Type unification failed
walther@60347
   248
Type error in application: incompatible operand type
walther@60347
   249
walther@60347
   250
Operator:  op # c_3 :: 'a list \<Rightarrow> 'a list
walther@60347
   251
Operand:   [c_4] :: 'b list
walther@60347
   252
\-------------------------------------------------------/
walther@60347
   253
walther@60347
   254
val (p,_,f,nxt,_,pt) = CalcTreeTEST [(fmz, (dI',pI',mI'))];
walther@60347
   255
val (p,_,f,nxt,_,pt) = me nxt p c pt;val (p,_,f,nxt,_,pt) = me nxt p c pt;
walther@60347
   256
val (p,_,f,nxt,_,pt) = me nxt p c pt;val (p,_,f,nxt,_,pt) = me nxt p c pt;
walther@60347
   257
val (p,_,f,nxt,_,pt) = me nxt p c pt;val (p,_,f,nxt,_,pt) = me nxt p c pt;
walther@60347
   258
val (p,_,f,nxt,_,pt) = me nxt p c pt;val (p,_,f,nxt,_,pt) = me nxt p c pt;
walther@60347
   259
case nxt of (_,Apply_Method ["EqSystem", "normalise", "4x4"]) => ()
walther@60347
   260
	  | _ => error "eqsystem.sml [EqSystem,normalise,4x4] specify";
walther@60347
   261
val (p,_,f,nxt,_,pt) = me nxt p c pt; f2str f;
walther@60347
   262
walther@60347
   263
"----- outcommented before Isabelle2002 --> 2011 -------------------------";
walther@60347
   264
(*-----------------------------------vvvWN080102 Exception- Match raised 
walther@60347
   265
  since associate Rewrite .. Rewrite_Set
walther@60347
   266
val (p,_,f,nxt,_,pt) = me nxt p c pt; f2str f;
walther@60347
   267
walther@60347
   268
val (p,_,f,nxt,_,pt) = me nxt p c pt; f2str f;
walther@60347
   269
val (p,_,f,nxt,_,pt) = me nxt p c pt; f2str f;
walther@60347
   270
walther@60347
   271
val (p,_,f,nxt,_,pt) = me nxt p c pt; f2str f;
walther@60347
   272
val (p,_,f,nxt,_,pt) = me nxt p c pt; f2str f;
walther@60347
   273
val (p,_,f,nxt,_,pt) = me nxt p c pt; f2str f;
walther@60347
   274
val (p,_,f,nxt,_,pt) = me nxt p c pt; f2str f;
walther@60347
   275
if f2str f ="[c = L * q_0, L * c + c_2 = q_0 * L \<up> 2 / 2, c_3 = 0, c_4 = 0]" 
walther@60347
   276
then () else error "eqsystem.sml: exp 7.70 normalise 4x4 by met changed";
walther@60347
   277
--------------------------------------------------------------------------*)
walther@60347
   278
============ inhibit exn WN120314 ==============================================*)
walther@60347
   279
walther@60347
   280
"----- 7.70 with met top_down_: me";
walther@60347
   281
val fmz = [
walther@60347
   282
  "equalities [(c::real) = L * q_0, L * c + (c_2::real) = q_0 * L \<up> 2 / 2, (c_3::real) = 0, (c_4::real) = 0]",
walther@60347
   283
	"solveForVars [(c::real), (c_2::real), (c_3::real), (c_4::real)]", "solution LL"];
walther@60347
   284
val (dI',pI',mI') =
walther@60347
   285
  ("Biegelinie",["LINEAR", "system"],["no_met"]);
walther@60347
   286
val p = e_pos'; val c = []; 
walther@60347
   287
val (p,_,f,nxt,_,pt) = CalcTreeTEST [(fmz, (dI',pI',mI'))];
walther@60347
   288
val (p,_,f,nxt,_,pt) = me nxt p c pt;val (p,_,f,nxt,_,pt) = me nxt p c pt;
walther@60347
   289
val (p,_,f,nxt,_,pt) = me nxt p c pt;val (p,_,f,nxt,_,pt) = me nxt p c pt;
walther@60347
   290
val (p,_,f,nxt,_,pt) = me nxt p c pt;val (p,_,f,nxt,_,pt) = me nxt p c pt;
walther@60347
   291
val (p,_,f,nxt,_,pt) = me nxt p c pt;val (p,_,f,nxt,_,pt) = me nxt p c pt;
walther@60347
   292
case nxt of Apply_Method ["EqSystem", "top_down_substitution", "4x4"] => ()
walther@60347
   293
	  | _ => error "eqsystem.sml [EqSystem,top_down_,4x4] specify";
walther@60347
   294
val (p,_,f,nxt,_,pt) = me nxt p c pt; f2str f;
walther@60347
   295
val (p,_,f,nxt,_,pt) = me nxt p c pt; f2str f;
walther@60347
   296
val (p,_,f,nxt,_,pt) = me nxt p c pt; f2str f;
walther@60347
   297
val (p,_,f,nxt,_,pt) = me nxt p c pt; f2str f;
walther@60347
   298
val (p,_,f,nxt,_,pt) = me nxt p c pt; f2str f;
walther@60347
   299
val (p,_,f,nxt,_,pt) = me nxt p c pt; f2str f;
walther@60347
   300
if p = ([], Res) andalso
walther@60347
   301
(*           "[c = L * q_0, c_2 = - 1 * L \<up> 2 * q_0 / 2, c_3 = 0, c_4 = 0]"*)
walther@60347
   302
   f2str f = "[c = L * q_0, c_2 = - 1 * L \<up> 2 * q_0 / 2, c_3 = 0, c_4 = 0]"
walther@60347
   303
then () else error "eqsystem.sml: 7.70 with met top_down_: me";
walther@60347
   304
walther@60347
   305
"------- Bsp 7.71";
Walther@60549
   306
States.reset ();
walther@60347
   307
CalcTree [(["Traegerlaenge L", "Streckenlast q_0", "Biegelinie y",
walther@60347
   308
	     "Randbedingungen [M_b L = 0, y 0 = (0::real), y L = 0, y' 0 = 0]",
walther@60347
   309
	     "FunktionsVariable x", "GleichungsVariablen [c, c_2, c_3, c_4]",
walther@60347
   310
	     "AbleitungBiegelinie dy"],
walther@60347
   311
	    ("Biegelinie", ["Biegelinien"],
walther@60347
   312
	     ["IntegrierenUndKonstanteBestimmen2"] ))];
walther@60347
   313
moveActiveRoot 1;
walther@60347
   314
(*
walther@60347
   315
LItool.trace_on := true; autoCalculate 1 CompleteCalc; LItool.trace_on := false;
walther@60347
   316
##7.71##       |ordered       |subst.singles (recurs) |2x2       |diagonal
walther@60347
   317
c c_2          |c c_2	      |1'		      |1': c c_2 |
walther@60347
   318
          c_4  |      c_3     |2:c_3 -> 4' :c c_2 c_4 |	         |
walther@60347
   319
c c_2 c_3 c_4  |          c_4 |3'                     |	         |
walther@60347
   320
      c_3      |c c_2 c_3 c_4 |3:c_4 -> 4'':c c_2     |4'':c c_2 |      *)
Walther@60565
   321
val t = TermC.parse_test @{context}"[0 = (2 * c_2 + 2 * L * c + - 1 * L \<up> 2 * q_0) / 2, \
walther@60347
   322
\ 0 = c_4 + 0 / (- 1 * EI),                            \
walther@60347
   323
\ 0 = c_4 + L * c_3 +(12 * L \<up> 2 * c_2 + 4 * L \<up> 3 * c + - 1 * L \<up> 4 * q_0) /(- 24 * EI),\
walther@60347
   324
\ 0 = c_3 + 0 / (- 1 * EI)]";
walther@60347
   325
walther@60347
   326
"------- Bsp 7.72a ---------------vvvvvvvvvvvvv Momentenlinie postponed";
Walther@60549
   327
States.reset ();
walther@60347
   328
CalcTree [(["Traegerlaenge L",
walther@60347
   329
	    "Momentenlinie ((q_0 * L)/ 6 * x - q_0 /(6 * L) * x \<up> ^3)",
walther@60347
   330
	    "Biegelinie y",
walther@60347
   331
	    "Randbedingungen [y 0 = (0::real), y L = 0]",
walther@60347
   332
	    "FunktionsVariable x"],
walther@60347
   333
	   ("Biegelinie", ["vonMomentenlinieZu", "Biegelinien"],
walther@60347
   334
	    ["Biegelinien", "AusMomentenlinie"]))];
walther@60347
   335
moveActiveRoot 1;
walther@60347
   336
(*
walther@60347
   337
LItool.trace_on := true; autoCalculate 1 CompleteCalc; LItool.trace_on := false;
walther@60347
   338
*)
walther@60347
   339
walther@60347
   340
"------- Bsp 7.72b";
Walther@60549
   341
States.reset ();
walther@60347
   342
CalcTree [(["Traegerlaenge L", "Streckenlast (q_0 / L * x)", "Biegelinie y",
walther@60347
   343
	    "Randbedingungen [M_b 0 = 0, M_b L = 0, y 0 = (0::real), y L = 0]",
walther@60347
   344
	    "FunktionsVariable x", "GleichungsVariablen [c, c_2, c_3, c_4]",
walther@60347
   345
	    "AbleitungBiegelinie dy"],
walther@60347
   346
	   ("Biegelinie", ["Biegelinien"],
walther@60347
   347
	    ["IntegrierenUndKonstanteBestimmen2"] ))];
walther@60347
   348
moveActiveRoot 1;
walther@60347
   349
(*
walther@60347
   350
LItool.trace_on := true; autoCalculate 1 CompleteCalc; LItool.trace_on := false;
walther@60347
   351
##7.72b##      |ord. |subst.singles         |ord.triang.
walther@60347
   352
  c_2          |     |			    |c_2  
walther@60347
   353
c c_2	       |     |1:c_2 -> 2':c	    |c_2 c
walther@60347
   354
          c_4  |     |			    |
walther@60347
   355
c c_2 c_3 c_4  |     |3:c_4 -> 4':c c_2 c_3 |c_2 c c_3*)
Walther@60565
   356
val t = TermC.parse_test @{context}"[0 = c_2,                                            \
walther@60347
   357
\ 0 = (6 * c_2 + 6 * L * c + - 1 * L \<up> 2 * q_0) / 6, \
walther@60347
   358
\ 0 = c_4 + 0 / (- 1 * EI),                            \
walther@60347
   359
\ 0 = c_4 + L * c_3 + (60 * L \<up> 2 * c_2 + 20 * L \<up> 3 * c + - 1 * L \<up> 4 * q_0) / (- 120 * EI)]";
walther@60347
   360
walther@60347
   361
"------- Bsp 7.73 ---------------vvvvvvvvvvvvv Momentenlinie postponed";
Walther@60549
   362
States.reset ();
walther@60347
   363
CalcTree [(["Traegerlaenge L", "Momentenlinie ???",(*description unclear*)
walther@60347
   364
	    "Biegelinie y",
walther@60347
   365
	    "Randbedingungen [y L = 0, y' L = 0]",
walther@60347
   366
	    "FunktionsVariable x"],
walther@60347
   367
	   ("Biegelinie", ["vonMomentenlinieZu", "Biegelinien"],
walther@60347
   368
	    ["Biegelinien", "AusMomentenlinie"]))];
walther@60347
   369
moveActiveRoot 1;
walther@60347
   370
(*
walther@60347
   371
LItool.trace_on := true; autoCalculate 1 CompleteCalc; LItool.trace_on := false;
walther@60347
   372
*)
walther@60347
   373
walther@60347
   374
"----------- 4x4 systems from Biegelinie -------------------------";
walther@60347
   375
"----------- 4x4 systems from Biegelinie -------------------------";
walther@60347
   376
"----------- 4x4 systems from Biegelinie -------------------------";
walther@60347
   377
(*STOPPED.WN08?? replace this test with 7.70 *)
walther@60347
   378
"----- Bsp 7.27";
walther@60347
   379
val fmz = ["equalities \
walther@60347
   380
	   \[0 = c_4,                           \
walther@60347
   381
	   \ 0 = c_4 + L * c_3 +(12 * L \<up> 2 * c_2 + 4 * L \<up> 3 * c + - 1 * L \<up> 4 * q_0) / (- 24 * EI),                                       \
walther@60347
   382
	   \ 0 = c_2,                                           \
walther@60347
   383
	   \ 0 = (2 * c_2 + 2 * L * c + - 1 * L \<up> 2 * q_0) / 2]", 
walther@60347
   384
	   "solveForVars [c, c_2, c_3, c_4]", "solution LL"];
walther@60347
   385
val (dI',pI',mI') =
walther@60347
   386
  ("Biegelinie",["normalise", "4x4", "LINEAR", "system"],
walther@60347
   387
   ["EqSystem", "normalise", "4x4"]);
walther@60347
   388
val p = e_pos'; val c = []; 
walther@60347
   389
val (p,_,f,nxt,_,pt) = CalcTreeTEST [(fmz, (dI',pI',mI'))];
walther@60347
   390
val (p,_,f,nxt,_,pt) = me nxt p c pt; val (p,_,f,nxt,_,pt) = me nxt p c pt;
walther@60347
   391
val (p,_,f,nxt,_,pt) = me nxt p c pt; val (p,_,f,nxt,_,pt) = me nxt p c pt;
walther@60347
   392
val (p,_,f,nxt,_,pt) = me nxt p c pt; val (p,_,f,nxt,_,pt) = me nxt p c pt;
walther@60347
   393
val (p,_,f,nxt,_,pt) = me nxt p c pt; val (p,_,f,nxt,_,pt) = me nxt p c pt;
walther@60347
   394
"------------------------------------------- Apply_Method...";
walther@60347
   395
val (p,_,f,nxt,_,pt) = me nxt p c pt; f2str f;
walther@60347
   396
"[0 = c_4,                                          \
walther@60347
   397
\ 0 = c_4 + L * c_3 +\n (12 * L \<up> 2 * c_2 + 4 * L \<up> 3 * c + - 1 * L \<up> 4 * q_0) / (- 24 * EI),                                   \
walther@60347
   398
\ 0 = c_2,                                          \
walther@60347
   399
\ 0 = (2 * c_2 + 2 * L * c + - 1 * L \<up> 2 * q_0) / 2]";
walther@60347
   400
(*vvvWN080102 Exception- Match raised 
walther@60347
   401
  since associate Rewrite .. Rewrite_Set
walther@60347
   402
"------------------------------------------- simplify_System_parenthesized...";
walther@60347
   403
val (p,_,f,nxt,_,pt) = me nxt p c pt; f2str f;
walther@60347
   404
"[0 = c_4,                                  \
walther@60347
   405
\ 0 = - 1 * q_0 * L \<up> 4 / (- 24 * EI) +     \
walther@60347
   406
\     (4 * L \<up> 3 * c / (- 24 * EI) +       \
walther@60347
   407
\     (12 * L \<up> 2 * c_2 / (- 24 * EI) +    \
walther@60347
   408
\     (L * c_3 + c_4))),                    \
walther@60347
   409
\ 0 = c_2,                                  \
walther@60347
   410
\ 0 = - 1 * q_0 * L \<up> 2 / 2 + (L * c + c_2)]";
walther@60347
   411
(*? "(4 * L \<up> 3 / (- 24 * EI) * c" statt "(4 * L \<up> 3 * c / (- 24 * EI)" ?*)
walther@60347
   412
"------------------------------------------- isolate_bdvs...";
walther@60347
   413
val (p,_,f,nxt,_,pt) = me nxt p c pt; f2str f;
walther@60347
   414
"[c_4 = 0,\
walther@60347
   415
\ c_4 = 0 + - 1 * (- 1 * q_0 * L \<up> 4 / (- 24 * EI)) + - 1 * (4 * L \<up> 3 * c / (- 24 * EI)) + - 1 * (12 * L \<up> 2 * c_2 / (- 24 * EI)) + - 1 * (L * c_3),\
walther@60347
   416
\ c_2 = 0, \
walther@60347
   417
\ c_2 = 0 + - 1 * (- 1 * q_0 * L \<up> 2 / 2) + - 1 * (L * c)]";
walther@60347
   418
val (p,_,f,nxt,_,pt) = me nxt p c pt; f2str f;
walther@60347
   419
walther@60347
   420
---------------------------------------------------------------------*)