Rev 7210 | Rev 16135 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 7210 | Rev 16120 | ||
---|---|---|---|
Line 8... | Line 8... | ||
8 | !goto $wims_read_parm |
8 | !goto $wims_read_parm |
9 | !endif |
9 | !endif |
10 | 10 | ||
11 | !exit |
11 | !exit |
12 | :form |
12 | :form |
13 |
|
13 | !set N=!linecnt $mtobj1 |
14 |
|
14 | !if $N>1 and $methsubstep=1 |
15 | :first |
15 | :first |
16 | !set methsubstep=2 |
16 | !set methsubstep=2 |
17 | Apply a change of variable for: <p> |
17 | Apply a change of variable for: <p> |
18 | !read deduc/methparm.phtml 1 |
18 | !read deduc/methparm.phtml 1 |
19 |
|
19 | !else |
20 | !bound methparm1 between integer 0 and $N default 1 |
20 | !bound methparm1 between integer 0 and $N default 1 |
21 | !if $methparm1=0 or $error!=$empty |
21 | !if $methparm1=0 or $error!=$empty |
22 | !goto first |
22 | !goto first |
23 | !endif |
23 | !endif |
24 | <input type="hidden" name="methparm1" value="$methparm1" /> |
24 | <input type="hidden" name="methparm1" value="$methparm1" /> |
Line 35... | Line 35... | ||
35 | </div> |
35 | </div> |
36 | with |
36 | with |
37 | \($v = h($nvar) = ) |
37 | \($v = h($nvar) = ) |
38 | !read deduc/methparm.phtml 2,36 |
38 | !read deduc/methparm.phtml 2,36 |
39 | . |
39 | . |
40 |
|
40 | !endif |
41 | !exit |
41 | !exit |
42 | :check |
42 | :check |
43 |
|
43 | ker=!item 2 of $methparmobj1 |
44 |
|
44 | ker=!mathsubst integrate= in $ker |
45 |
|
45 | ker=!trim $ker |
46 |
|
46 | ker=!declosing $ker |
47 |
|
47 | !distribute items $ker into iker,ivar |
48 |
|
48 | vartest=!varlist $ivar |
49 |
|
49 | !if $ivar != $vartest |
50 | error=Fail |
50 | error=Fail |
51 | !exit |
51 | !exit |
52 |
|
52 | !endif |
53 | 53 | ||
54 |
|
54 | newvar=!item 1 of $newvariables |
55 |
|
55 | vv=!varlist nofn $methparm2 |
56 |
|
56 | vtest=!listcomplement $newvar,e,pi,euler in $vv |
57 |
|
57 | !if $vtest!=$empty |
58 | error=\($methparm2) must be a function of \($newvar) only. |
58 | error=\($methparm2) must be a function of \($newvar) only. |
59 | !exit |
59 | !exit |
60 |
|
60 | !endif |
61 |
|
61 | diff=!exec maxima diff($methparm2,$newvar); |
62 |
|
62 | !if $diff=$empty |
63 | :bad_data |
63 | :bad_data |
64 | error=bad_data |
64 | error=bad_data |
65 | !exit |
65 | !exit |
66 |
|
66 | !endif |
67 |
|
67 | inv=!exec maxima solve($ivar=$methparm2,$newvar); |
68 |
|
68 | inv=!declosing $inv |
69 |
|
69 | n=!itemcnt $inv |
70 |
|
70 | inv2=!nospace $inv |
71 |
|
71 | eq== |
72 |
|
72 | !if $n!=1 or +++**$newvar$eq notin +++**$inv2 |
73 | error=Impossible to find the inverse function of $methparm2, which is\ |
73 | error=Impossible to find the inverse function of $methparm2, which is\ |
74 | necessary for future substitution:\ |
74 | necessary for future substitution:\ |
75 | use the reverse change of variable. |
75 | use the reverse change of variable. |
76 | !exit |
76 | !exit |
77 |
|
77 | !endif |
78 | substed=!mathsubst $ivar=($methparm2) in $iker |
78 | substed=!mathsubst $ivar=($methparm2) in $iker |
79 | !read deduc/sub/checkzero diff(($substed)*($diff),$newvar) |
79 | !read deduc/sub/checkzero diff(($substed)*($diff),$newvar) |
80 | difftest=$out |
80 | difftest=$out |
81 | !read deduc/sub/simplify ($substed)*($diff)\ |
81 | !read deduc/sub/simplify ($substed)*($diff)\ |
82 | ($substed)*($diff)*$newvar |
82 | ($substed)*($diff)*$newvar |
83 |
|
83 | !distribute lines $out into newker,ktest |
84 |
|
84 | !if $newker=$empty or $ktest=$empty or $difftest=$empty |
85 | !goto bad_data |
85 | !goto bad_data |
86 |
|
86 | !endif |
87 | 87 | ||
88 |
|
88 | !if strictintegrate iswordof $m_options and $difftest=yes |
89 | error=This change of variable is not allowed for this environment.\ |
89 | error=This change of variable is not allowed for this environment.\ |
90 | Please change the method. |
90 | Please change the method. |
91 | !exit |
91 | !exit |
92 |
|
92 | !endif |
93 | 93 | ||
94 |
|
94 | !if $difftest=yes |
95 | newobject1=$ktest |
95 | newobject1=$ktest |
96 |
|
96 | !else |
97 | newobject1=integrate($newker,$newvar) |
97 | newobject1=integrate($newker,$newvar) |
98 |
|
98 | !endif |
99 |
|
99 | newobject0=$inv |
100 |
|
100 | oldobject=0,1 |
101 |
|
101 | methexp=\($ivar=$methparm2) |
102 |
|
102 | variables=$variables,$newvar |
103 | !exit |
103 | !exit |
104 | - |