Subversion Repositories wimsdev

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2071 zjchen 1
 
2
!goto $wims_read_parm
3
 
4
:def
5
title=Solve
6
input=equations
7
!exit
8
 
9
:proc
10
fml=!lines2items $formula
11
fml=!replace , by , $ in $fml
12
eqcnt=!itemcnt $fml
13
fml=!rawmath $fml
14
variable=!trim $variable
15
 
16
!if $variable!=$empty and $variable isvarof $fml
17
 # variable solve
18
 result=!exec maxima print(solve([$fml],$variable));
19
!else
20
 # other solve
21
 result=!exec maxima print(solve([$fml]));
22
!endif
23
 
24
result=!declosing $result
25
result=!trim $result
26
!if $result=$empty
27
 error=solve_fail
28
 !exit
29
!endif
30
result=!replace , by , $ in $result
31
!exit
32
 
33
:output
34
Solution(s) of
35
!if $eqcnt>1
36
 {
37
 !htmlmath $fml
38
 }
39
!else
40
 !htmlmath $fml
41
!endif
42
!if $variable!=$empty and $variable isvarof $fml
43
 for $variable:
44
!else
45
 :
46
!endif
47
<p><center>
48
!insmath $result
49
</center> <p>
50
!exit
51