Subversion Repositories wimsdev

Rev

Rev 20 | Rev 5763 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
20 reyssat 1
!set methtit=Rewrite an equation
2
!set methenv=ZZ QQ RR CC
3
!set methparmtype=parm equation, function, choice, function
4
!set methhelp=You can use this method to transform an existing equation\
5
 into an equivalent one, by a composition of addition of terms,\
6
 exchange of sides and multiplication by a non-zero constant.
7
 
8
!if $wims_read_parm iswordof form check
9
 !goto $wims_read_parm
10
!endif
11
 
12
!exit
13
:form
14
 Rewrite the equation
15
 !read deduc/methparm.phtml 1
16
 to <br>
17
 <input size=15 name=methparm2 value="$methparm2">
18
 =
19
 <input size=15 name=methparm4 value="$methparm4">
20
 !set methremark=Your new equation must be equivalent to the original one.
21
!exit
22
:check
23
 !distribute items $methparmobj1 into data,left1,sign1,right1
24
 sign2==
25
 sign3==
26
 !if $sign2 notsametext $sign1 and $sign3 notsametext $sign1
27
  :badequiv
28
  error=Your new equation is not equivalent to the original one!
29
  !advance penalty
30
  !exit
31
 !endif
32
 
33
 check1=($left1) - ($right1)
34
 check2=($methparm2) - ($methparm4)
35
 
36
 !read deduc/sub/checkzero $check1\
37
	$check2
38
 !distribute line $out into out1, out2
38 reyssat 39
 !read deduc/sub/_Simplify ($check1) / ($check2)
20 reyssat 40
 out3=$out
41
 !if $out1=yes or $out2=yes
42
  !if $out1!=yes or $out2!=yes
43
   !goto badequiv
44
  !endif
45
 !else
46
  out3=$[$out3]
47
  !if NaN isin $out3 or Inf isin $out3
48
   !goto badequiv
49
  !endif
50
 !endif
51
 methexp=Rewriting of \($left1 = $right1)
52
 
53
 newobject1=$methparm2 = $methparm4
54
 oldobject=1
55
 
56
!exit
57