test/Tools/isac/Knowledge/biegelinie-1.sml
author wneuper <walther.neuper@jku.at>
Sun, 18 Jul 2021 16:20:32 +0200
changeset 60330 e5e9a6c45597
parent 60329 0c10aeff57d7
child 60331 40eb8aa2b0d6
permissions -rw-r--r--
eliminate ThmC.numerals_to_Free: Test_Isac_Short.thy works with TOODOO s
walther@59627
     1
(* Title:  Knowledge/biegelinie-1.sml
walther@59627
     2
   Author: Walther Neuper 050826
wneuper@59372
     3
   (c) due to copyright terms
wneuper@59372
     4
*)
wneuper@59372
     5
"-----------------------------------------------------------------";
wneuper@59372
     6
"table of contents -----------------------------------------------";
wneuper@59372
     7
"-----------------------------------------------------------------";
walther@59627
     8
"------ biegelinie-1.sml -----------------------------------------";
walther@59627
     9
"----------- the rules -------------------------------------------";
walther@59627
    10
"----------- simplify_leaf for this script -----------------------";
walther@59627
    11
"----------- SubProblem (_,[setzeRandbedingungen,Biegelinien] ----";
walther@59627
    12
"----------- investigate normalforms in biegelinien --------------";
walther@59627
    13
"-----------------------------------------------------------------";
walther@59627
    14
"------ biegelinie-2.sml -----------------------------------------";
walther@59627
    15
"----------- auto SubProblem (_,[vonBelastungZu,Biegelinien] -----";
walther@59627
    16
"----------- me SubProblem (_,[vonBelastungZu,Biegelinien] -------";
walther@59627
    17
"-----------------------------------------------------------------";
walther@59627
    18
"------ biegelinie-3.sml -----------------------------------------";
walther@59627
    19
"----------- auto method [Biegelinien,setzeRandbedingungenEin]--------------------------------";
walther@59627
    20
"----------- me method [Biegelinien,setzeRandbedingungenEin]----------------------------------";
walther@59627
    21
"-----------------------------------------------------------------";
walther@59627
    22
"------ biegelinie-4.sml -----------------------------------------";
walther@59627
    23
"----------- IntegrierenUndKonstanteBestimmen2: Bsp.7.70. auto TODO investigate failure ------";
walther@59627
    24
"----------- IntegrierenUndKonstanteBestimmen2: Bsp.7.70. me -----";
wneuper@59372
    25
"-----------------------------------------------------------------";
wneuper@59372
    26
"-----------------------------------------------------------------";
wneuper@59372
    27
"-----------------------------------------------------------------";
wneuper@59372
    28
wneuper@59372
    29
val thy = @{theory "Biegelinie"};
walther@59879
    30
val ctxt = ThyC.id_to_ctxt "Biegelinie";
wenzelm@60237
    31
fun str2term str = (Thm.term_of o the o (TermC.parse thy)) str;
walther@59870
    32
fun term2s t = UnparseC.term_by_thyID "Biegelinie" t;
walther@59852
    33
fun rewrit thm str = fst (the (rewrite_ thy tless_true Rule_Set.empty true thm str));
wneuper@59372
    34
wneuper@59372
    35
"----------- the rules -------------------------------------------";
wneuper@59372
    36
"----------- the rules -------------------------------------------";
wneuper@59372
    37
"----------- the rules -------------------------------------------";
walther@60230
    38
val t = rewrit @{thm Belastung_Querkraft} (TermC.str2term "- qq x = - q_0"); term2s t;
wneuper@59372
    39
if term2s t = "Q' x = - q_0" then ()
wneuper@59372
    40
else error  "/biegelinie.sml: Belastung_Querkraft";
wneuper@59372
    41
walther@60230
    42
val t = rewrit @{thm Querkraft_Moment} (TermC.str2term "Q x = - q_0 * x + c"); term2s t;
walther@60083
    43
if term2s t = "?M_b' x = - q_0 * x + c" then ()
walther@60083
    44
(*if term2s t = "M_b' x = - q_0 * x + c" then ()  cf.fbe1652b0df8 new handling of quotes in mixfix*)
wneuper@59372
    45
else error  "/biegelinie.sml: Querkraft_Moment";
wneuper@59372
    46
walther@60242
    47
val t = rewrit @{thm Moment_Neigung} (TermC.str2term "M_b x = -q_0 * x \<up> 2/2 + q_0/2 *L*x");
wneuper@59372
    48
    term2s t;
walther@60242
    49
if term2s t = "- EI * y'' x = - q_0 * x \<up> 2 / 2 + q_0 / 2 * L * x" then ()
wneuper@59372
    50
else error  "biegelinie.sml: Moment_Neigung";
wneuper@59372
    51
wneuper@59372
    52
"----------- simplify_leaf for this script -----------------------";
wneuper@59372
    53
"----------- simplify_leaf for this script -----------------------";
wneuper@59372
    54
"----------- simplify_leaf for this script -----------------------";
walther@59851
    55
val srls = Rule_Set.Repeat {id="srls_IntegrierenUnd..", 
wneuper@59372
    56
		preconds = [], 
wneuper@59372
    57
		rew_ord = ("termlessI",termlessI), 
walther@59852
    58
		erls = Rule_Set.append_rules "erls_in_srls_IntegrierenUnd.." Rule_Set.empty
wneuper@59372
    59
				  [(*for asm in NTH_CONS ...*)
walther@59878
    60
				   Eval ("Orderings.ord_class.less",eval_equ "#less_"),
walther@60329
    61
				   (*2nd NTH_CONS pushes n+- 1 into asms*)
walther@59878
    62
				   Eval("Groups.plus_class.plus", eval_binop "#add_")
wneuper@59372
    63
				   ], 
walther@59851
    64
		srls = Rule_Set.Empty, calc = [], errpatts = [],
walther@59871
    65
		rules = [Thm ("NTH_CONS",ThmC.numerals_to_Free @{thm NTH_CONS}),
walther@59878
    66
			 Eval("Groups.plus_class.plus", eval_binop "#add_"),
walther@59871
    67
			 Thm ("NTH_NIL",ThmC.numerals_to_Free @{thm NTH_NIL}),
walther@59878
    68
			 Eval("Prog_Expr.lhs", eval_lhs "eval_lhs_"),
walther@59878
    69
			 Eval("Prog_Expr.rhs", eval_rhs "eval_rhs_"),
walther@60278
    70
			 Eval("Prog_Expr.argument_in", eval_argument_in "Prog_Expr.argument_in")
wneuper@59372
    71
			 ],
walther@59878
    72
		scr = Empty_Prog};
walther@60230
    73
val rm_ = TermC.str2term"[M_b 0 = 0, M_b L = 0]";
walther@60329
    74
val M__ = TermC.str2term"M_b x = - 1 * x \<up> 2 / 2 + x * c + c_2";
wneuper@59372
    75
val SOME (e1__,_) = rewrite_set_ thy false srls 
walther@60230
    76
  (TermC.str2term "(NTH::[real,bool list]=>bool) 1 " $ rm_);
walther@59868
    77
if UnparseC.term e1__ = "M_b 0 = 0" then () else error "biegelinie.sml simplify NTH 1 rm_";
wneuper@59372
    78
wneuper@59372
    79
val SOME (x1__,_) = 
wneuper@59372
    80
    rewrite_set_ thy false srls 
walther@60230
    81
		 (TermC.str2term"argument_in (lhs (M_b 0 = 0))");
walther@59868
    82
if UnparseC.term x1__ = "0" then ()
wneuper@59372
    83
else error "biegelinie.sml simplify argument_in (lhs (M_b 0 = 0)";
wneuper@59372
    84
walther@60330
    85
Rewrite.trace_on := false; (*true false*)
wneuper@59372
    86
wneuper@59372
    87
"----------- SubProblem (_,[setzeRandbedingungen,Biegelinien] ----";
wneuper@59372
    88
"----------- SubProblem (_,[setzeRandbedingungen,Biegelinien] ----";
wneuper@59372
    89
"----------- SubProblem (_,[setzeRandbedingungen,Biegelinien] ----";
walther@60329
    90
val fmz = ["functionEq (M_b x = c_2 + c * x + - 1 * q_0 / 2 * x \<up> 2)", 
wneuper@59372
    91
	   "substitution (M_b L = 0)", 
wneuper@59372
    92
	   "equality equ_equ"];
walther@59997
    93
val (dI',pI',mI') = ("Biegelinie", ["makeFunctionTo", "equation"],
walther@59997
    94
		     ["Equation", "fromFunction"]);
wneuper@59372
    95
val p = e_pos'; val c = [];
wneuper@59372
    96
val (p,_,f,nxt,_,pt) = CalcTreeTEST [(fmz, (dI',pI',mI'))];
wneuper@59372
    97
val (p,_,f,nxt,_,pt) = me nxt p c pt;val (p,_,f,nxt,_,pt) = me nxt p c pt;
wneuper@59372
    98
val (p,_,f,nxt,_,pt) = me nxt p c pt;val (p,_,f,nxt,_,pt) = me nxt p c pt;
wneuper@59372
    99
val (p,_,f,nxt,_,pt) = me nxt p c pt;val (p,_,f,nxt,_,pt) = me nxt p c pt;
wneuper@59372
   100
val (p,_,f,nxt,_,pt) = me nxt p c pt;
wneuper@59372
   101
wneuper@59372
   102
val (p,_,f,nxt,_,pt) = me nxt p c pt; f2str f = 
walther@60329
   103
			"M_b x = c_2 + c * x + - 1 * q_0 / 2 * x \<up> 2";
wneuper@59372
   104
val (p,_,f,nxt,_,pt) = me nxt p c pt; f2str f = 
walther@60329
   105
                        "M_b L = c_2 + c * L + - 1 * q_0 / 2 * L \<up> 2";
wneuper@59372
   106
val (p,_,f,nxt,_,pt) = me nxt p c pt; f2str f = 
walther@60329
   107
			"0 = c_2 + c * L + - 1 * q_0 / 2 * L \<up> 2";
wneuper@59372
   108
val (p,_,f,nxt,_,pt) = me nxt p c pt; f2str f;
wneuper@59372
   109
val (p,_,f,nxt,_,pt) = me nxt p c pt; f2str f;
walther@60329
   110
if (* f2str f = "0 = c_2 + L * c + - 1 * q_0 / 2 * L \<up> 2" CHANGE NOT considered, already on leave*)
walther@60329
   111
   f2str f = "0 = (2 * c_2 + 2 * L * c + - 1 * L \<up> 2 * q_0) / 2"
walther@59749
   112
then case nxt of End_Proof' => ()
wneuper@59372
   113
  | _ => error "biegelinie.sml: SubProblem (_,[setzeRandbed 1"
walther@59620
   114
else error "biegelinie.sml: SubProblem (_,[setzeRandbed 2";
walther@59620
   115
walther@59620
   116
"----------- investigate normalforms in biegelinien --------------";
walther@59620
   117
"----------- investigate normalforms in biegelinien --------------";
walther@59620
   118
"----------- investigate normalforms in biegelinien --------------";
walther@59620
   119
"----- coming from integration, kept for later improvements:";
walther@60329
   120
val Q = TermC.str2term "Q x = c + - 1 * q_0 * x";
walther@60329
   121
val M_b = TermC.str2term "M_b x = c_2 + c * x + - 1 * q_0 / 2 * x \<up> 2";
walther@60329
   122
val y' = TermC.str2term "y' x = c_3 + 1 / (- 1 * EI) * (c_2 * x + c / 2 * x \<up> 2 + - 1 * q_0 / 6 * x \<up> 3)";
walther@60329
   123
val y = TermC.str2term "y x = c_4 + c_3 * x +\n1 / (- 1 * EI) * (c_2 / 2 * x \<up> 2 + c / 6 * x \<up> 3 + - 1 * q_0 / 24 * x \<up> 4)";
walther@60329
   124
(* \<up>   1 / (- 1 * EI) NOT distributed - ok! \<up> \<up> \<up> \<up> \<up> \<up>  \<up> ^^*)