Kitonum

21435 Reputation

26 Badges

17 years, 23 days

MaplePrimes Activity


These are replies submitted by Kitonum

depends(sin(x)^2+cos(x)^2,  x);

                           true

 

@Carl Love  Thanks for the useful remark!

@Preben Alsholm 
Thank you for your useful suggestion to improve the code!

What is to be printed, if the 4th point satisfies exactly 2 of these inequalities?

@Carl Love 

Thanks for the link! I did not know about this example in the Maple help. In my post slightly more general problem is solved:  m  queens on an  n×n  chessboard.

1. The branch-and-bound is applied. Tree of variants is constructed , starting with the first vertical. Subprocedure  It  prolongs each branch further to 1 step, cutting branches worthless.

2.   The goal of the post - to show the possibilities of Maple for programming such problems.

@Markiyan Hirnyk 
Thanks for the feedback! All of these methods seem to me too complicated and not of fundamental importance for the problem.

@Markiyan Hirnyk

Thank you for the response, but I do not know what is  Lucida Sans Unicode font and how to use it to solve my problem.

For example, the symbol for white Queen    can be coded in Unicode as  U+2655 , but how to do this in Maple I do not know. 

 

@Carl Love 

Indeed the data are nondecreasing, but the growth rate decreases all the time . The last three values of y-coordinate is not changed, i.e. the growth rate is equal to 0. So it is quite natural that in the future growth rate becomes negative, ie, function decreases. The plot shows that the second model  much better approximates the data in the middle and on the right end of the range. The first value returned by DataFit for the second model is almost 5 times less. 

 

with(DirectSearch): with(plots):

xy := Matrix([[0.2e-1, .158], [0.2e-1, .159], [0.3e-1, .161], [0.3e-1, .164], [0.3e-1, .166], [0.4e-1, .169], [0.6e-1, .173], [0.8e-1, .178], [.1, .185], [.11, .187], [.14, .193], [.19, .2], [.28, .21], [.38, .223], [.44, .233], [.58, .244], [.82, .256], [1.4, .278], [1.71, .281], [1.78, .282], [1.78, .282], [1.81, .282]]):

X := xy[() .. (), 1]:

Y := xy[() .. (), 2]:

N:=nops(X):

f:=a+b*x^c:

g := a+b*x^c+d*x^e:

sol1 := DataFit(f, X, Y, x, evaluationlimit=20000):

sol2 := DataFit(g, X, Y, x, evaluationlimit=20000):

f1 := eval(f, sol1[2]);

g1 := eval(g, sol2[2]);

Er1:=sol1[1];  # error for first model

Er2:=sol2[1];  # error for second model

p1, p2, p3 := pointplot(X, Y), plot(f1, x = 0 .. 2), plot(g1, x = 0 .. 2, color=blue):

display(p1, p2, p3);  # red - first model, blue - second model

 

 

@Carl Love

This error occurs in Maple 12 Classic Worksheet. 

@Carl Love

This error occurs in Maple 12 Classic Worksheet. 

@Carl Love 

ISC:=proc(T::list, Eq::`=`)

local f:= unapply((lhs-rhs)(Eq), indets(Eq,name)[]);

     `or`(seq(f(i[]) >= 0, i= T)) and `or`(seq(f(i[]) <= 0, i= T))

end proc:

 

ISC([[0,0],[10,10],[10,0]], x+y=-1);

Error, (in ISC) invalid input: or expects 2 arguments, but received 3

@Carl Love 

ISC:=proc(T::list, Eq::`=`)

local f:= unapply((lhs-rhs)(Eq), indets(Eq,name)[]);

     `or`(seq(f(i[]) >= 0, i= T)) and `or`(seq(f(i[]) <= 0, i= T))

end proc:

 

ISC([[0,0],[10,10],[10,0]], x+y=-1);

Error, (in ISC) invalid input: or expects 2 arguments, but received 3

M. Hirnyk, your code does not work in Maple 16:

trigsubs(sin(a+b)^2 - sin(a-b)^2)[];

   Error, (in trigsubs) expecting the sum or difference of two functions but got sin(a+b)^2-sin(a-b)^2

M. Hirnyk, your code does not work in Maple 16:

trigsubs(sin(a+b)^2 - sin(a-b)^2)[];

   Error, (in trigsubs) expecting the sum or difference of two functions but got sin(a+b)^2-sin(a-b)^2

First 114 115 116 117 118 119 120 Last Page 116 of 132