Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2071 | zjchen | 1 | !goto $wims_read_parm |
2 | |||
3 | :def |
||
4 | title=Substitution |
||
5 | synonyme=substitute, composed function, fonction composition, function substitution |
||
6 | input=function |
||
7 | !exit |
||
8 | |||
9 | :proc |
||
10 | formula2=!trim $formula2 |
||
11 | !if $formula2=$empty |
||
12 | error=empty_data |
||
13 | !exit |
||
14 | !endif |
||
15 | !exchange formula, formula2 |
||
16 | !read input/function |
||
17 | !if $error!=$empty |
||
18 | !exit |
||
19 | !endif |
||
20 | !exchange formula, formula2 |
||
21 | formula=!item 1 of $formula |
||
22 | formula2=!item 1 of $formula2 |
||
23 | variable=!items2words $variable |
||
24 | variable=!word 1 of $variable |
||
25 | !if $variable=$empty |
||
26 | list=!varlist nofn $formula |
||
27 | list=!sort nocase items $list |
||
28 | variable=!item -1 of $list |
||
29 | !endif |
||
30 | !default variable=x |
||
31 | result=!exec maxima expand(subst($formula2,$variable,$formula)); |
||
32 | !exit |
||
33 | |||
34 | :output |
||
35 | If |
||
36 | !htmlmath f(x) = $formula |
||
37 | <p> |
||
38 | Then |
||
39 | !htmlmath f($formula2) = $result |
||
40 | . |
||
41 | !exit |
||
42 |