Rev 16321 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
16321 | bpr | 1 | !set methtit=Suma de ecuaciones con coeficientes |
20 | reyssat | 2 | !set methparmtype=parm equation >,parm equation >,\ |
3 | number, number, choice 2 |
||
4 | !set methparmrelax=5 |
||
16321 | bpr | 5 | !set methhelp=Este método calcula la suma con los coeficientes de dos ecuaciones.\ |
6 | El resultado puede agregarse a las suposiciones o reemplazar\ |
||
7 | una de las dos ecuaciones iniciales. |
||
20 | reyssat | 8 | |
9 | !if $wims_read_parm iswordof form check |
||
10 | !goto $wims_read_parm |
||
11 | !endif |
||
12 | |||
13 | !exit |
||
14 | :form |
||
17187 | bpr | 15 | Introducir una nueva ecuación que es <br> |
20 | reyssat | 16 | !default methparm3=1 |
17 | !default methparm4=1 |
||
18 | !read deduc/methparm.phtml 3,5 |
||
16321 | bpr | 19 | veces la ecuacion |
20 | reyssat | 20 | !read deduc/methparm.phtml 1 |
17187 | bpr | 21 | <br> plus |
20 | reyssat | 22 | !read deduc/methparm.phtml 4,5 |
16321 | bpr | 23 | veces la ecuacion |
20 | reyssat | 24 | !read deduc/methparm.phtml 2 |
17187 | bpr | 25 | <br> |
16321 | bpr | 26 | Esta nueva ecuación va a |
20 | reyssat | 27 | !formselect methparm5 list 0,1,2 prompt \ |
16321 | bpr | 28 | añadirse a los supuestos,\ |
29 | reemplazar al primero,\ |
||
30 | reemplazar al segundo |
||
20 | reyssat | 31 | !exit |
32 | :check |
||
33 | !ifval $methparm3=0 and $methparm4=0 |
||
16321 | bpr | 34 | error=¡Los coeficientes son cero! |
20 | reyssat | 35 | !exit |
36 | !endif |
||
37 | !ifval ($methparm=1 and $methparm3=0) or \ |
||
38 | ($methparm=2 and $methparm4=0) |
||
16321 | bpr | 39 | error=¿Quieres reemplazar una ecuación cuyo coeficiente en\ |
40 | la suma es cero? ¡Esto hará que pierdas\ |
||
41 | información! |
||
20 | reyssat | 42 | !advance penalty |
43 | !exit |
||
44 | !endif |
||
45 | !distribute items $methparmobj1 into data1,left1,sign1,right1 |
||
46 | !distribute items $methparmobj2 into data2,left2,sign2,right2 |
||
47 | !if $data1 issametext $data2 |
||
16321 | bpr | 48 | error=Este método prohíbe la suma de una ecuación consigo misma. |
20 | reyssat | 49 | !exit |
50 | !endif |
||
51 | methexp=\(($methparm3)*($left1 $sign1 $right1) + ($methparm4)*($left2 $sign2 $right2)) |
||
17187 | bpr | 52 | |
20 | reyssat | 53 | !read deduc/sub/simplify ($methparm3)*($left1) + ($methparm4)*($left2)\ |
54 | ($methparm3)*($right1) + ($methparm4)*($right2) |
||
55 | !distribute lines $out into newleft, newright |
||
56 | !if $newleft=$empty or $newright=$empty |
||
57 | error=bad_data |
||
58 | !exit |
||
59 | !endif |
||
60 | |||
61 | newobject$methparm5=$newleft = $newright |
||
62 | oldobject=$methparm5 |
||
63 | forcereplace=$methparm5 |
||
64 | |||
65 | !exit |
||
66 |