Ex

95 Reputation

7 Badges

14 years, 54 days

MaplePrimes Activity


These are replies submitted by Ex

only return "solving: single equation recurrence"

only return "solving: single equation recurrence"

@Markiyan Hirnyk 

i have used gfun to change into diff to dsolve however, the solution is not the same as stated in the paper.

maple 's result is complicated and in terms of kummer. i just afraid it can not be changed into diff matrix with respect to each terms in matlab for post processing and not know how to write kummer in other language such as c#

there are two terms suffering the same situation

P(n+1), P(n-1)

if monic, there are n in P(n-1)

i find in help, it can solve variable coefficient. Why this equation is an exception?

i find in help, it can solve variable coefficient. Why this equation is an exception?

How about if there are another custom identity for convert, how would it be? can it do the same as mathematica?

 

How about if there are another custom identity for convert, how would it be? can it do the same as mathematica?

 

List<String> var = new List<String>();
            var.Add("x");
            var.Add("y");
            var.Add("z");
            string q = "3*x^3*y+2*x^2*y^2-3*x*y+5*x";
            List<String> p_list = new List<String>();
            p_list.Add("x^2*y+5*x^2+y^2");
            p_list.Add("7*x*y^2-2*y^3+1");
            string result2 = bt.Reduce(q, p_list, var);
     result2 may be 0 or -3*x*y+5*x-15*x^3-2.85714285714286*y^3+50*x^2+10*y^2+0.42857
 
           i am not sure the answer, and would like to check with Maple

public string Reduce(string p, List<string> Q, List<String> order)
        {
            string r = p;
            string q = "0";
            string f = "";
            Dictionary<String, double> Rrq = new Dictionary<String, double>();
            Dictionary<String, double> temp = new Dictionary<String, double>();
            // only assume three variables
            Dictionary<String,double> order0 = new Dictionary<String, double>();
            Dictionary<String,double> order1 = new Dictionary<String,double>();
            Dictionary<String,double> order2 = new Dictionary<String,double>();
            foreach (String s in Q)
            {
                int counter = 0;
                while(max_deg_var(s)!=order[counter])
                {
                    counter += 1;
                }
                if (counter == 0)
                    order0.Add(s, max_deg(s));
                if (counter == 1)
                    order1.Add(s, max_deg(s));
                if (counter == 2)
                    order2.Add(s, max_deg(s));
            }
            foreach (KeyValuePair<String, double> s in order0.OrderByDescending(k => k.Value))
                Rrq.Add(s.Key, s.Value);
            foreach (KeyValuePair<String, double> s in order1.OrderByDescending(k => k.Value))
                Rrq.Add(s.Key, s.Value);
            foreach (KeyValuePair<String, double> s in order2.OrderByDescending(k => k.Value))
                Rrq.Add(s.Key, s.Value);

            string Mr = "";
           
            while (r != "0")
            {
                f = selectpoly(r, Rrq, order[0]);
                int counter = 0;
                while (!string.IsNullOrEmpty(f))
                {
                    if (counter == 3)
                        Console.WriteLine("");
                    r = Expand(r + "-(" + Expand(selectpoly_reducer_term(r, Rrq, order[0]) + "*(" + f + ")") + ")");
                    counter += 1;
                    //debug
                    //r = "-3*x*y+5*x-15*x^3-2.857142857*y^3+50*x^2+10*y^2+.428571428571429";
                    //     -3*x*y+5*x-15*x^3-2.85714285714286*y^3+50*x^2+10*y^2+0.42857
                    f = selectpoly(r, Rrq, order[0]);
                }
                Mr = Mr_Term(r, Rrq, order[0]);
                if (!string.IsNullOrEmpty(Mr))
                {
                    q = Expand(q + "+" + Mr);
                    r = Expand(r + "-(" + Mr + ")");
                }
                else
                {
                    return q;
                }
            }
            return q;
        }

List<String> var = new List<String>();
            var.Add("x");
            var.Add("y");
            var.Add("z");
            string q = "3*x^3*y+2*x^2*y^2-3*x*y+5*x";
            List<String> p_list = new List<String>();
            p_list.Add("x^2*y+5*x^2+y^2");
            p_list.Add("7*x*y^2-2*y^3+1");
            string result2 = bt.Reduce(q, p_list, var);
     result2 may be 0 or -3*x*y+5*x-15*x^3-2.85714285714286*y^3+50*x^2+10*y^2+0.42857
 
           i am not sure the answer, and would like to check with Maple

public string Reduce(string p, List<string> Q, List<String> order)
        {
            string r = p;
            string q = "0";
            string f = "";
            Dictionary<String, double> Rrq = new Dictionary<String, double>();
            Dictionary<String, double> temp = new Dictionary<String, double>();
            // only assume three variables
            Dictionary<String,double> order0 = new Dictionary<String, double>();
            Dictionary<String,double> order1 = new Dictionary<String,double>();
            Dictionary<String,double> order2 = new Dictionary<String,double>();
            foreach (String s in Q)
            {
                int counter = 0;
                while(max_deg_var(s)!=order[counter])
                {
                    counter += 1;
                }
                if (counter == 0)
                    order0.Add(s, max_deg(s));
                if (counter == 1)
                    order1.Add(s, max_deg(s));
                if (counter == 2)
                    order2.Add(s, max_deg(s));
            }
            foreach (KeyValuePair<String, double> s in order0.OrderByDescending(k => k.Value))
                Rrq.Add(s.Key, s.Value);
            foreach (KeyValuePair<String, double> s in order1.OrderByDescending(k => k.Value))
                Rrq.Add(s.Key, s.Value);
            foreach (KeyValuePair<String, double> s in order2.OrderByDescending(k => k.Value))
                Rrq.Add(s.Key, s.Value);

            string Mr = "";
           
            while (r != "0")
            {
                f = selectpoly(r, Rrq, order[0]);
                int counter = 0;
                while (!string.IsNullOrEmpty(f))
                {
                    if (counter == 3)
                        Console.WriteLine("");
                    r = Expand(r + "-(" + Expand(selectpoly_reducer_term(r, Rrq, order[0]) + "*(" + f + ")") + ")");
                    counter += 1;
                    //debug
                    //r = "-3*x*y+5*x-15*x^3-2.857142857*y^3+50*x^2+10*y^2+.428571428571429";
                    //     -3*x*y+5*x-15*x^3-2.85714285714286*y^3+50*x^2+10*y^2+0.42857
                    f = selectpoly(r, Rrq, order[0]);
                }
                Mr = Mr_Term(r, Rrq, order[0]);
                if (!string.IsNullOrEmpty(Mr))
                {
                    q = Expand(q + "+" + Mr);
                    r = Expand(r + "-(" + Mr + ")");
                }
                else
                {
                    return q;
                }
            }
            return q;
        }

how about polynomial case

i know the algorithm, but not sure the answer should be 0 or a polynomial

List<String> var = new List<String>();
            var.Add("x");
            var.Add("y");
            var.Add("z");
            string q = "3*x^3*y+2*x^2*y^2-3*x*y+5*x";
            List<String> p_list = new List<String>();
            p_list.Add("x^2*y+5*x^2+y^2");
            p_list.Add("7*x*y^2-2*y^3+1");
            string result2 = bt.Reduce(q, p_list, var);
     result2 may be 0 or -3*x*y+5*x-15*x^3-2.85714285714286*y^3+50*x^2+10*y^2+0.42857

 

public string Reduce(string p, List<string> Q, List<String> order)
        {
            string r = p;
            string q = "0";
            string f = "";
            Dictionary<String, double> Rrq = new Dictionary<String, double>();
            Dictionary<String, double> temp = new Dictionary<String, double>();
            // only assume three variables
            Dictionary<String,double> order0 = new Dictionary<String, double>();
            Dictionary<String,double> order1 = new Dictionary<String,double>();
            Dictionary<String,double> order2 = new Dictionary<String,double>();
            foreach (String s in Q)
            {
                int counter = 0;
                while(max_deg_var(s)!=order[counter])
                {
                    counter += 1;
                }
                if (counter == 0)
                    order0.Add(s, max_deg(s));
                if (counter == 1)
                    order1.Add(s, max_deg(s));
                if (counter == 2)
                    order2.Add(s, max_deg(s));
            }
            foreach (KeyValuePair<String, double> s in order0.OrderByDescending(k => k.Value))
                Rrq.Add(s.Key, s.Value);
            foreach (KeyValuePair<String, double> s in order1.OrderByDescending(k => k.Value))
                Rrq.Add(s.Key, s.Value);
            foreach (KeyValuePair<String, double> s in order2.OrderByDescending(k => k.Value))
                Rrq.Add(s.Key, s.Value);

            string Mr = "";
           
            while (r != "0")
            {
                f = selectpoly(r, Rrq, order[0]);
                int counter = 0;
                while (!string.IsNullOrEmpty(f))
                {
                    if (counter == 3)
                        Console.WriteLine("");
                    r = Expand(r + "-(" + Expand(selectpoly_reducer_term(r, Rrq, order[0]) + "*(" + f + ")") + ")");
                    counter += 1;
                    //debug
                    //r = "-3*x*y+5*x-15*x^3-2.857142857*y^3+50*x^2+10*y^2+.428571428571429";
                    //     -3*x*y+5*x-15*x^3-2.85714285714286*y^3+50*x^2+10*y^2+0.42857
                    f = selectpoly(r, Rrq, order[0]);
                }
                Mr = Mr_Term(r, Rrq, order[0]);
                if (!string.IsNullOrEmpty(Mr))
                {
                    q = Expand(q + "+" + Mr);
                    r = Expand(r + "-(" + Mr + ")");
                }
                else
                {
                    return q;
                }
            }
            return q;
        }

how about polynomial case

i know the algorithm, but not sure the answer should be 0 or a polynomial

List<String> var = new List<String>();
            var.Add("x");
            var.Add("y");
            var.Add("z");
            string q = "3*x^3*y+2*x^2*y^2-3*x*y+5*x";
            List<String> p_list = new List<String>();
            p_list.Add("x^2*y+5*x^2+y^2");
            p_list.Add("7*x*y^2-2*y^3+1");
            string result2 = bt.Reduce(q, p_list, var);
     result2 may be 0 or -3*x*y+5*x-15*x^3-2.85714285714286*y^3+50*x^2+10*y^2+0.42857

 

public string Reduce(string p, List<string> Q, List<String> order)
        {
            string r = p;
            string q = "0";
            string f = "";
            Dictionary<String, double> Rrq = new Dictionary<String, double>();
            Dictionary<String, double> temp = new Dictionary<String, double>();
            // only assume three variables
            Dictionary<String,double> order0 = new Dictionary<String, double>();
            Dictionary<String,double> order1 = new Dictionary<String,double>();
            Dictionary<String,double> order2 = new Dictionary<String,double>();
            foreach (String s in Q)
            {
                int counter = 0;
                while(max_deg_var(s)!=order[counter])
                {
                    counter += 1;
                }
                if (counter == 0)
                    order0.Add(s, max_deg(s));
                if (counter == 1)
                    order1.Add(s, max_deg(s));
                if (counter == 2)
                    order2.Add(s, max_deg(s));
            }
            foreach (KeyValuePair<String, double> s in order0.OrderByDescending(k => k.Value))
                Rrq.Add(s.Key, s.Value);
            foreach (KeyValuePair<String, double> s in order1.OrderByDescending(k => k.Value))
                Rrq.Add(s.Key, s.Value);
            foreach (KeyValuePair<String, double> s in order2.OrderByDescending(k => k.Value))
                Rrq.Add(s.Key, s.Value);

            string Mr = "";
           
            while (r != "0")
            {
                f = selectpoly(r, Rrq, order[0]);
                int counter = 0;
                while (!string.IsNullOrEmpty(f))
                {
                    if (counter == 3)
                        Console.WriteLine("");
                    r = Expand(r + "-(" + Expand(selectpoly_reducer_term(r, Rrq, order[0]) + "*(" + f + ")") + ")");
                    counter += 1;
                    //debug
                    //r = "-3*x*y+5*x-15*x^3-2.857142857*y^3+50*x^2+10*y^2+.428571428571429";
                    //     -3*x*y+5*x-15*x^3-2.85714285714286*y^3+50*x^2+10*y^2+0.42857
                    f = selectpoly(r, Rrq, order[0]);
                }
                Mr = Mr_Term(r, Rrq, order[0]);
                if (!string.IsNullOrEmpty(Mr))
                {
                    q = Expand(q + "+" + Mr);
                    r = Expand(r + "-(" + Mr + ")");
                }
                else
                {
                    return q;
                }
            }
            return q;
        }

yes, i want to see difference between an ordinary integral and a contour integral, which examples are they?

yes, i want to see difference between an ordinary integral and a contour integral, which examples are they?

@Christopher2222 

http://en.wikipedia.org/wiki/Genetic_programming

in the diagram of the page, the node can store operator such as +, - , *, /,

can the tree in maple store these operator?

moreover, can tree store diff command such as diff(leaf, x)?

1 2 3 4 5 6 Page 3 of 6