ActiveUser

490 Reputation

10 Badges

7 years, 121 days
i would also not like to ask, but if not ask, what should i do?

MaplePrimes Activity


These are replies submitted by ActiveUser

@tomleslie 

actually i would like to apply in opencv to use the matrix is numpy

i use hash(str(frame))

but i expect the hash reversible back to 2d array frame

i am writing an application to predict the hash or frame, that the hash after predicted can be reversed to a correct 2d array format just elements in matrix are different.

 

@Carl Love 

but delete “for n from 1 “ before do

it is wrong when there is “od”

how to edit this function to make work in maple 12?

and why not know the terminating value but it know this dynamic value in maple 2015

does it mean n had value ? Which variable of this value refer to?

i still do not understand this new feature in maple language.

@Kitonum 

i don't know your mind.

can you post the procdeure P for maple 12?

 

i use print count of for loop in maple 2015, but can not print to see this clues.

any maple help file explain when to use this for loop without terminating value and how it work?

 

i tested with code below

FindSamples:=proc(sourcesamples)
local N, P;
N:=nops(sourcesamples);
P:=proc(a,b)
local a1, b1, m1, n, m;
if a=b then error "Should be a<>b" fi;
a1,b1:=op(convert(sort([a,b],(x,y)->evalf(x)<evalf(y)),rational));
count := 0:
for n from 1 do
m1:=a1*n;
m:=`if`(type(m1,integer),m1+1,ceil(m1));
count := count + 1:
if is(m/n>a1) and is(m/n<b1) then return m/n fi;
od;
print("count=",count);
end proc:
[ceil(sourcesamples[1])-1, seq(op([sourcesamples[i],P(sourcesamples[i],sourcesamples[i+1])]), i=1..N-1),sourcesamples[N],floor(sourcesamples[N])+1];
end proc:

sourcesamples := [evalf(-1-sqrt(7)), -2, 1, evalf(-1 + sqrt(7)), 2];
templatesamples := [A, evalf(-1-sqrt(7)), A, -2, A, 1, A, evalf(-1 + sqrt(7)), A, 2, A];
samples := [-4, evalf(-1-sqrt(7)), -3, -2, 0, 1, evalf(3/2), evalf(-1 + sqrt(7)), evalf(9/5), 2, 3]
FindSamples(sourcesamples);

sourcesamples :=[2,4,6,8,10];
n:=nops(sourcesamples);
samples:=sort(convert({ceil(sourcesamples[1])-1, seq(op([sourcesamples[i],(sourcesamples[i]+sourcesamples[i+1])/2,sourcesamples[i+1]]), i=1..n-1),floor(sourcesamples[n])+1},list),(x,y)->evalf(x)<evalf(y));

sourcesamples :=[-1,1,3,5,7,9];
n:=nops(sourcesamples);
samples:=sort(convert({ceil(sourcesamples[1])-1, seq(op([sourcesamples[i],(sourcesamples[i]+sourcesamples[i+1])/2,sourcesamples[i+1]]), i=1..n-1),floor(sourcesamples[n])+1},list),(x,y)->evalf(x)<evalf(y));

sourcesamples :=[-1,0,3,5,7,9];
n:=nops(sourcesamples);
samples:=sort(convert({ceil(sourcesamples[1])-1, seq(op([sourcesamples[i],(sourcesamples[i]+sourcesamples[i+1])/2,sourcesamples[i+1]]), i=1..n-1),floor(sourcesamples[n])+1},list),(x,y)->evalf(x)<evalf(y));

sourcesamples := [evalf(-1-sqrt(7)), -2, 1, evalf(-1 + sqrt(7)), 2];
n:=nops(sourcesamples);
samples := [-4, evalf(-1-sqrt(7)), -3, -2, 0, 1, evalf(3/2), evalf(-1 + sqrt(7)), evalf(9/5), 2, 3]
FindSamples(sourcesamples);
samples:=sort(convert({ceil(sourcesamples[1])-1, seq(op([sourcesamples[i],(sourcesamples[i]+sourcesamples[i+1])/2,sourcesamples[i+1]]), i=1..n-1),floor(sourcesamples[n])+1},list),(x,y)->evalf(x)<evalf(y));
 

@Kitonum 

can not run in maple 12

there is no ending value of n for loop

for n from 1 to  where ?

@Kitonum 

I just find example from book

the example show neighbor values are beautiful integers or round values , not sure which decimal it round

this question is part of random values samples for cylindrical decompose algorithm use.

 

@Kitonum 

your code is hard coded position 1 and -1 

I mean input list such as sourcesample

 [evalf(-1-sqrt(7)), -2, 1, evalf(-1 + sqrt(7)), 2];

any number can be float or integer

then insert position follow the template 

how to write this in general function ?

@tomleslie 

yes correct,

then I use projection to calculate , it return [c,0] which display c <> 0 and 0

is this projection correct?

i do not understand how one sample point from it that can go to b^2 -4*a*c using CAD

@Kitonum 

is there any projection function for algebra and differential case which is Collins’s projection function or improved or final version of projection function?

@Kitonum 

how to extract the right hand side solution?

does it mean that regular chain library is wrong and only solve function can do this CAD method?

any starting point method from quantifier expression?

@vv 

i follow help file to fill in N,P,H,R, but i am not sure whether H is correct.

so far it is slow and no result due to running long time. i find a book in the book photo i posted it use a number of seconds then calculated result. Aurthor are different from the author stated in help file. it seems different algorithms.

the algorithm is not easy. is it myparameters wrong , so that it is slow?

with(RegularChains):
with(ChainTools):
with(MatrixTools):
with(ConstructibleSetTools):
with(ParametricSystemTools):
with(SemiAlgebraicSetTools):
with(FastArithmeticTools):
R := PolynomialRing([x,y,z,a,b]):
#sys := [x^2 + y^2 - x*y - 1 = 0, y^2 + z^2 - y*z - a^2 = 0, z^2 + x^2 - x*z - b^2 = 0,x > 0, y > 0, z > 0, a - 1 >= 0, b-a >= 0, a+1-b > 0]:

sys := [x^2 + y^2 - x*y - 1 , y^2 + z^2 - y*z - a^2 , z^2 + x^2 - x*z - b^2]:
N := [a-1,b-a]:
P := [x, y, z, a+1-b]: 
H := [x,y,z]:
dec := RealTriangularize(sys,N,P,H,R):
Display(dec, R);

dec := LazyRealTriangularize(sys,N,P,H,R):
dec2 := value(dec):
value(dec2);

@vv 

can these triangularize function that can be used to find the condition when anomalies happen ? And act as performance metric in optimisation function?

how the anomalies can be described into a equation  for this to use? Any example?

 

@Kitonum 

answer should be like this 

I follow N, P, H, R in example to fill in the equation like help file, still very slow

premcustom := proc(Fparam,Gparam, MainVar)
local R, G, F, lcg, lcr, dr, dg:
R := Fparam:
G := Gparam:
F := Fparam:
#p1 := x^2+5-2*x*z;
#p2 := z^3*y+x*y^2;
#p3 := -8*z^3+3*y^2;
#R := p2:
#G := p1:
#F := p2:
#MainVar := z:
if degree(G,MainVar) = 0 then
 print("return 0"):
 return 0:
elif degree(F, MainVar) < degree(G, MainVar) then 
 print("return R"):
 return R:
end if:
lcg := coeff(G, MainVar, degree(G, MainVar)):
print("lcg",lcg):
dg := degree(G, MainVar):
print("dg",dg):
while degree(R, MainVar) >= degree(G, MainVar) do
  lcr := coeff(R, MainVar, degree(R, MainVar)):
  print("lcr",lcr):
  dr := degree(R, MainVar):
  print("dr",dr):
  R := simplify(lcg * R - lcr * G * (x^(dr - dg))):
  print("R",R):
od:
return R:
end proc:
p1 := x^2+5-2*x*z;
p2 := z^3*y+x*y^2;
p3 := -8*z^3+3*y^2;
prem(p1,p2,x);
prem(p2,p1,z);
prem(p3, p2, y);

premcustom(p1,p2,x);
premcustom(p2,p1,z); #why this looping
premcustom(p3,p2,y);
 

i use expand or simplify to solve looping but case 2 , premcustom(p2,p1, z) still looping

@Kitonum 

I still have not define m(x) and s(x)

but it had already made it 0

why maple think it is 0?

is maple 's lambda calculus can predict it is 0?

 

 

@Kitonum 

g := x;
r1 := eval((eval(g,x=x + diff(h(x),x)) - eval(g,x=diff(s(x),x)))/((Int(exp(-x)*(-x+diff(s(x), x)), x))*exp(x)),h(x) =-(1/2)*x^2+s(x));
g := x^2;
r2 := eval((eval(g,x=x + diff(h(x),x)) - eval(g,x=diff(s(x),x)))/((Int(exp(-x)*(-x+diff(s(x), x)), x))*exp(x)),h(x) =-(1/2)*x^2+s(x));
g := x^n;
rn := eval((eval(g,x=x + diff(h(x),x)) - eval(g,x=diff(s(x),x)))/((Int(exp(-x)*(-x+diff(s(x), x)), x))*exp(x)),h(x) =-(1/2)*x^2+s(x));

g := exp(x);
r1 := eval((eval(g,x=x + diff(h(x),x)) - eval(g,x=diff(s(x),x)))/((Int(exp(-x)*(-x+diff(s(x), x)), x))*exp(x)),h(x) =-(1/2)*x^2+s(x));
g := cos(x);
r2 := eval((eval(g,x=x + diff(h(x),x)) - eval(g,x=diff(s(x),x)))/((Int(exp(-x)*(-x+diff(s(x), x)), x))*exp(x)),h(x) =-(1/2)*x^2+s(x));
g := sin(x);
rn := eval((eval(g,x=x + diff(h(x),x)) - eval(g,x=diff(s(x),x)))/((Int(exp(-x)*(-x+diff(s(x), x)), x))*exp(x)),h(x) =-(1/2)*x^2+s(x));

g := diff(m(x), x);
r1 := eval((eval(g,x=x + diff(h(x),x)) - eval(g,x=diff(s(x),x)))/((Int(exp(-x)*(-x+diff(s(x), x)), x))*exp(x)),h(x) =-(1/2)*x^2+s(x));
g := diff(m(x), x$2);
r2 := eval((eval(g,x=x + diff(h(x),x)) - eval(g,x=diff(s(x),x)))/((Int(exp(-x)*(-x+diff(s(x), x)), x))*exp(x)),h(x) =-(1/2)*x^2+s(x));
g := diff(m(x), x$k);
rn := eval((eval(g,x=x + diff(h(x),x)) - eval(g,x=diff(s(x),x)))/((Int(exp(-x)*(-x+diff(s(x), x)), x))*exp(x)),h(x) =-(1/2)*x^2+s(x));

same 0

g := x;
r1 := eval((eval(g,x=x + diff(h(x),x)) - eval(g,x=diff(s(x),x)))/((Int(exp(-(1/2)*x^2)*(-x+diff(s(x), x)), x))*exp((1/2)*x^2)),h(x) = -(1/2)*x^2+s(x));
g := x^2;
r2 := eval((eval(g,x=x + diff(h(x),x)) - eval(g,x=diff(s(x),x)))/((Int(exp(-(1/2)*x^2)*(-x+diff(s(x), x)), x))*exp((1/2)*x^2)),h(x) = -(1/2)*x^2+s(x));
g := x^3;
r3 := eval((eval(g,x=x + diff(h(x),x)) - eval(g,x=diff(s(x),x)))/((Int(exp(-(1/2)*x^2)*(-x+diff(s(x), x)), x))*exp((1/2)*x^2)),h(x) = -(1/2)*x^2+s(x));
g := x^4;
r4 := eval((eval(g,x=x + diff(h(x),x)) - eval(g,x=diff(s(x),x)))/((Int(exp(-(1/2)*x^2)*(-x+diff(s(x), x)), x))*exp((1/2)*x^2)),h(x) = -(1/2)*x^2+s(x));
g := x^5;
r5 := eval((eval(g,x=x + diff(h(x),x)) - eval(g,x=diff(s(x),x)))/((Int(exp(-(1/2)*x^2)*(-x+diff(s(x), x)), x))*exp((1/2)*x^2)),h(x) = -(1/2)*x^2+s(x));

r1 + r2 + r3 + r4 + r5;

g := diff(m(x),x);
r1 := eval((eval(g,x=x + diff(h(x),x)) - eval(g,x=diff(s(x),x)))/((Int(exp(-(1/2)*x^2)*(-x+diff(s(x), x)), x))*exp((1/2)*x^2)),h(x) = -(1/2)*x^2+s(x));
g := diff(m(x),x$2);
r2 := eval((eval(g,x=x + diff(h(x),x)) - eval(g,x=diff(s(x),x)))/((Int(exp(-(1/2)*x^2)*(-x+diff(s(x), x)), x))*exp((1/2)*x^2)),h(x) = -(1/2)*x^2+s(x));
g := diff(m(x),x$3);
r3 := eval((eval(g,x=x + diff(h(x),x)) - eval(g,x=diff(s(x),x)))/((Int(exp(-(1/2)*x^2)*(-x+diff(s(x), x)), x))*exp((1/2)*x^2)),h(x) = -(1/2)*x^2+s(x));
g := diff(m(x),x$4);
r4 := eval((eval(g,x=x + diff(h(x),x)) - eval(g,x=diff(s(x),x)))/((Int(exp(-(1/2)*x^2)*(-x+diff(s(x), x)), x))*exp((1/2)*x^2)),h(x) = -(1/2)*x^2+s(x));
g := diff(m(x),x$5);
r5 := eval((eval(g,x=x + diff(h(x),x)) - eval(g,x=diff(s(x),x)))/((Int(exp(-(1/2)*x^2)*(-x+diff(s(x), x)), x))*exp((1/2)*x^2)),h(x) = -(1/2)*x^2+s(x));
guess := sum(subs(g=x^k, rk), k=1..infinity);

1 2 3 4 5 6 7 Last Page 1 of 44