Rev 16120 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
16120 | bpr | 1 | ker=!item 2 of $methparmobj1 |
2 | ker=!mathsubst integrate= in $ker |
||
3 | ker=!trim $ker |
||
4 | ker=!declosing $ker |
||
5 | !distribute items $ker into iker,ivar |
||
6 | vartest=!varlist $ivar |
||
7 | !if $ivar != $vartest |
||
20 | reyssat | 8 | error=Fail |
9 | !exit |
||
16120 | bpr | 10 | !endif |
20 | reyssat | 11 | |
16120 | bpr | 12 | !bound methparm2 between integer 0 and $basiccnt default 0 |
13 | !if $methparm2=0 |
||
14 | error=empty_data |
||
15 | !exit |
||
16 | !endif |
||
20 | reyssat | 17 | |
16120 | bpr | 18 | form=!item $methparm2 of $basic |
19 | ftest=$form |
||
20 | form=!mathsubst a=1 in $form |
||
21 | form=!mathsubst t=$ivar in $form |
||
22 | !if $ftest=a*t^b |
||
20 | reyssat | 23 | test=!mathsubst $ivar=1 in $iker |
24 | coef=$[$test] |
||
25 | !if NaN isin $coef |
||
16120 | bpr | 26 | !goto badformula |
20 | reyssat | 27 | !endif |
28 | !if $coef=0 |
||
16120 | bpr | 29 | !if $[$iker]!=0 |
30 | !goto badformula |
||
31 | !else |
||
32 | !goto OK |
||
33 | !endif |
||
20 | reyssat | 34 | !endif |
35 | !read deduc/sub/simplify log(($iker)/($test))/log($ivar) |
||
36 | power=$[$out] |
||
37 | !if $out=$empty or NaN isin $power or Inf isin $power |
||
16120 | bpr | 38 | !goto badformula |
20 | reyssat | 39 | !endif |
40 | !goto OK |
||
16120 | bpr | 41 | !endif |
42 | !read deduc/sub/simplify ($iker)/($form) |
||
43 | test=$[$out] |
||
44 | !if NaN isin $test |
||
20 | reyssat | 45 | :badformula |
46 | error=Bad formula! |
||
47 | !advance penalty |
||
48 | !exit |
||
16120 | bpr | 49 | !endif |
50 | !if Inf isin $test or $test=0 |
||
20 | reyssat | 51 | error=bad_data |
52 | !exit |
||
16120 | bpr | 53 | !endif |
54 | |||
55 | :OK |
||
56 | got=!exec maxima integrate($iker,$ivar) |
||
57 | !if $got=$empty or integrate isvarof $got |
||
20 | reyssat | 58 | error=Fail |
59 | !exit |
||
16120 | bpr | 60 | !endif |
20 | reyssat | 61 | |
16120 | bpr | 62 | newobject1=($got) |
63 | oldobject=1 |
||
64 | methexp=basic formula |