weidade37211

110 Reputation

5 Badges

6 years, 312 days

MaplePrimes Activity


These are questions asked by weidade37211

I am using foslve to get the numerical solution of a very complex equition. When I rerun the code with different Digits settings, I got different solutions. I guess it is not surpprising since it is a numerical solution, but how can I trust/choose which one to use?? Is there anyway to unify the solutions regardless the Digits settings.

This attached are when Digits:=30 and Digits:=20 respectively.. Note, the K is a very large nubmer.. the X is a beta distribution..

first I define some constants (note I may change the constants later based on the context of the application)

p_l := 10^(-15);     
epsilon := 1.09*10^(-10);
p_B := 1.09*10^(-8);

n_A := 10^7;         
k_A := 0;
n_B := 10^8; 
k_B := 0;

then I define a function l(x,y):

l := (x, y) -> x^k_A*(1 - x)^(n_A - k_A)*y^k_B*(1 - y)^(n_B - k_B)

Now I use both with(GlobalOptimization) and with(Optimization) to maximize l(x,y) give some constraints and I get:

GlobalSolve(l(x_1, y_1), x_1 = p_l .. epsilon, y_1 = p_B .. 1, maximize, initialpoint = [x_1 = 0, y_1 = 0]);
  [-0., [x_1 = 1.09000000000000 10^(-10)   , y_1 = 0.633548870211381]]


Maximize(l(x_1, y_1), x_1 = p_l .. epsilon, y_1 = p_B .. 1, initialpoint = [x_1 = 0, y_1 = 0]);
 [0.33621648834727435318,  [x_1 = 1.00000000000000 10^(-15)   , y_1 = 1.0900000000000000000 10^(-8)  ] ]

 

Clearly the second answer is right and the first is wrong... I am not sure why the ``global optimazation'' is doing worse than the normal and free ``optimazation''.. Am I using the GlobalSolve in a wrong way??

 

Hi, for each region shown in the figure, there is a single point. I want to define the location constraints of the point in each region

e.g. for region 1 and 5, it is easy to define:

R1 := {p_B <= y_1 <= 1, p_l <= x_1 <= epsilon}

R5:={y_5 <= x_5, p_l <= x_5<= epsilon, p_l <= y_5 <= epsilon}

but what about region 2? it seems wrong if I define like this in maple:

R2 := {epsilon <= x_2 <= p_B, p_B <= y_2 <= 1} union {x_2 <= y_2, p_B <= x_2  <= 1, p_B <= y_2 <= 1}

Or it is actually right....

I know you can call python from Maple, I am thinking if there is the other way around. That is use Maple (and its toolbox) as backend engine to do calculations (e.g. Global Optimization), and say manipulate the data in Python as the front-end.

 

Assume I know some relations like 0<a<b<c<1, n is positive integer, and I want to know if

a^(n+1)-b^(n+1)<c * (a^(n)-b^(n)) holds. How to check this in Maple? Is there any command like verifiy evalb for this kind of problem.? Or solve the inequality in terms of c, given the relations of a,b,c?

Thanks.

1 2 3 4 5 6 Page 3 of 6