360 Reputation

8 Badges

10 years, 22 days

MaplePrimes Activity

These are replies submitted by janhardo

The assuming condition is not yet working in FSimp 
It gets the value of two arguments of FSimp in one case and in a second case ?


Tried to add  assuming to the simplify command, but seems impossible?
Dynamic adding assuming conditions to the methods table command fails.
So, a method  procedure to find out if two expressions are mathemathically equal must be made.


To solve this, you must do it  interactively and follow the proof steps and then construct a method sequenze?

Final FSimp command to do simplifications on a expression
Easy to use 

Now the procedure must handle this ?

For simplifications as start as a procedure :FSimplify
Cannot be more simple ...
Next stap to do is categorising the methodlist in FSimplify  for applying the best/right methods


e:=(*2*sin(beta)^2*) +4*cos(alpha+beta)*sin(beta)+cos(2*(alpha+beta));# another strategy to simplify this answer:s cos(2alpha) 
       e := 2 sin(beta)  + 4 cos(alpha + beta) sin(beta)

          + cos(2 alpha + 2 beta)

                                2         2
                    e2 := cos(x)  - sin(x) 

                                2         2
                    e1 := sin(x)  + cos(x) 

FSimplify(expr, method ( 1, 1..10  as number or range) , metlist( 1..1, 1...10 ,for set false on methods) , methodlist on/off (true or false, default on true) 
e3 := int(1-(sum(p[i]*(1-exp(-((t-xi)/tau[i]))), i=1..n)), xi=0..t);
                                     /    /
                                     |    |
                                     |    |
e3 := Typesetting:-msubsup(int, 0, t)\1 - \

  Typesetting:-munderover(sum, iequals1, n)ApplyFunctionp[i] \1

                        t - ξ\\\                  
   - ExponentialE               /// DifferentialDξ

#FSimplify(e3,7); # FSimplify(e3,7,false)no methodlist to see 
#c# try out method 13 
e4:= r^n;
                            e4 := r 

Methods list:
1: CompleteSquareSteps(e)
2: ExpandSteps(e)
3: FactorSteps(e)
4: ODESteps(e)
5: PartialFractionSteps(e)
6: PowerSteps(e)
7: ReplaceIntSum(e)
8: SimplifySteps(e)
9: SummationSteps(e)
10: TrigSteps(e)
11: Sum(e, n=0..k)
12: sum(e, n=0..k)
13: SumMethods(e, n=0..k)
14: `assuming`([convert(simplify(combine(simplify(convert(e, trig)))), exp)])
15: collect(e, exp(x))
16: collect(e, ln(x))
17: combine(convert(e, trig))
18: combine(e)
19: convert(e, exp)
20: convert(e, rational)
21: convert(e, trig)
22: evala(factor(e))
23: evalc(e)
24: evalindets(e, `+`, simplify)
25: evalindets(e, radical, u->map(simplify, u))
26: factor(simplify(expand(combine(e, trig))))
27: normal(e)
28: radnormal(combine(e))
29: radnormal(evala(combine(e)))
30: rationalize(e)
31: simplify(combine(e))
32: simplify(combine(e, size))
33: simplify(combine(expand(simplify(e)), trig), trig)
34: simplify(convert(e, exp))
35: simplify(convert(e, trig))
36: simplify(e assuming complex)
37: simplify(e assuming rational)
38: simplify(e assuming real)
39: simplify(e)
40: simplify(e, Ei)
41: simplify(e, RootOf)
42: simplify(e, factorial)
43: simplify(e, hypergeom)
44: simplify(e, ln)
45: simplify(e, polar)
46: simplify(e, power)
47: simplify(e, size)
48: simplify(e, sqrt)
49: simplify(e, symbolic)
50: simplify(e, symbolic, power)
51: simplify(e, symbolic, trig)
52: simplify(e, trig)
53: simplify(radnormal(combine(convert(e, trig))))
54: simplify(radnormal(combine(e)))
55: simplify(simplify(convert(e, 'sincos'), constant, sqrt), trig)
Original expression: lc = 3, l = 5


All simplifications:
M13 (SumMethods(e, n=0..k))(lc = 29, l = 74):

                   \          (k + 1)        
                    )    n   r            1  
                   /    r  = -------- - -----
                  -----       r - 1     r - 1
                  n = 0                      

Sorting by complexity of simplified expressions:
M13 (SumMethods(e, n=0..k))(lc = 29, l = 74):

                   \          (k + 1)        
                    )    n   r            1  
                   /    r  = -------- - -----
                  -----       r - 1     r - 1
                  n = 0                      


@Scot Gould 

Thanks for the response, 
I like the idea of using a procedure instead of a module ( the with( ) construct) , which is the case now.

The simpler it can be programming, the better, but ease of use comes first.
 I would give it the name FSimplify, because Simplify already exists in Maple and is a protected name

FSimplify( method, metlist , ?,?, options) as a procedure
The method becomes a number and which method to choose from a method list: metlist something like that ?

Can see if I can make a setup of this and look at the ease of use. 

It has actually become a flop programming a Simplify module to go simplify expressions..
Easily adding a method to go simplify an expression failed in the module code.
To keep it simple for a user of the module and not make changes in the code programming itself, that has not been possible, too bad.

Thanks for your help.
If this Method added: combine(e, trig) is working and it is possible to add more methods with the command AddMet ,save them, then it could be useful this module programming.

I think i earlier realized the same output, but could not give meaning to it 
Command ShowMet( ) , shows the all added methods , working or disabled ( true or false) 

Thanks , all those messages are ?
This is a indication message that the simplification not is done 
It can only be done if combine(e, trig) is in the methods table present

sin(a)*cos(b) + cos(a)*sin(b) = methods["combine(e, trig)"](sin(a)*cos(b) + cos(a)*sin(b))

And indeed if use .., it shows that there is no method combine(e, trig)

e:= sin(a)*cos(b) + cos(a)*sin(b);
               e := sin(a) cos(b) + cos(a) sin(b)


Indeed the string and procedure : example : "simplify(e, trig)" = proc(e) return simplify(e, trig); end proc, as argument of the AddMet command need to transferred to the Methods table and that is the bottle neck here 
AddMet uses the  AddMethodToTable procedure 

How get from outside a new method placed in the Methods table
By hand adding a new method in the methods table works, but more userfriendly is doing it with a command 
( and ideal is a serie of new methods , and one , by range) 

Note: a new methode added to the methods table  must can be set on a true or false( it does not exist, when doing simplications with the methods) status 
AddMet( method, false or true )
ShowMet is command for assigning a status to existing methods ( true , or  false)
ShowMet (1..53, true)
ShowMet(1..1, true)
ShowMet (10..20, false) 


Thanks, I can't make anything else out of the module code for now and have updated all the points to add a new (simplify) method to the methods table.
Unfortunately it does not seem to work yet
I tried 9 variants of AddMethodToTable proc, but no adding of a method  to the methods table 
Tried also a expression e = x and the methode: combine(e,trig) seems to exist in the memory, but 
BestSimp(e) will hang on it, of course.

AddMethodToTable := proc(method_name::string, method_body::string)
    local fn;

    fn := eval(parse(cat("proc(e) ", method_body, "; end proc")));

    methods[method_name] := fn;
end proc;


I tried earlier to get a working procedure for add or removing a method, based on use with a table. 
Thought it was working ? 
This Module code is based on Module_fullSimplify-2_commands_MPforum.mw and uses two commands of it.

Download fullSimplify_module_-metoden_toevoegen_werkt_ws_uitzoeken.mw

Thanks, my question has nothing to do with Module_fullSimplify-2_commands_MPforum.mw

It is a general question, there is no need for a worksheet attachment ( i keep it simple) , because i made some further changes also  in Module_fullSimplify-2_commands_MPforum.mw

I get the idea, that it is not clear anyway what my intention of the question is:
In my module there is a list of method names (procedures) and this is used to simplify an expression. 

Now I want to enter new method names in addition to the existing method names in the list of methods already present in the module.

Can do it manually in the code itself, but it seems more user friendly to me to use a command to do this
which takes over manually entering the code into the method list via a command

Thanks, its not clear for me how your code can be used , but i will look at it
You asked:  Why not use a table? 
I did use a table earlier  also, but thought with a list it was easier to get the code of the methode names into it 

This is existing red code a "methoden" named list in the worksheet.( in a module)
I need a command what adds a new methode as red code expression into the existing list, because this list is used for doing simplifications on expressions.
I hope its clear now.

The desired red code after using a command what has added the TEST methode name( to be made yet )

methoden := [
        "CompleteSquareSteps(e)" = proc(e) return CompleteSquareSteps(e); end proc,
        "TEST(e,trig)", proc(e) return TEST(e,trig); end proc
1 2 3 4 5 6 7 Last Page 1 of 43