PunkRediska

45 Reputation

5 Badges

11 years, 316 days

MaplePrimes Activity


These are replies submitted by PunkRediska

@Carl Love 
No, i got pm, it'a is rank of a list z and number of lines i m adding in getone, this corrent getone function is test, the one i need minimization for looks a bit diferent, but she dont give corrent value all the time, thet why i give this one in exemple, but this not changing the problem. So exctualy i need make optimization for [[z1,z2,z3,z4,z5],[z6,z7,z8,z9,z10]....[zn-4,zn-3,zn-2,zn-1,zn]] with one randomly generated initial point, and number of elements to optimaze depend on pm rank. And main problem is how set all this optimization values, number of which depends of pm.

@Carl Love 

Sorry, i m realy bad in description of my thoughts and i I have not included function getone to the description.
So now, simplified looks like this.
for_primes_1.mw

restart; with(plots); with(Threads); with(Optimization); with(Student[MultivariateCalculus]); with(ListTools); with(DirectSearch)
 

assume(x, 'real'):NULL

getone := proc (lpoint, pps) global x, y;

Warning, `pm` is implicitly declared local to procedure `getone`

Warning, `pp` is implicitly declared local to procedure `getone`

getone := proc (lpoint, pps) global x, y; pm := numelems(lpoint); x := 1; y := 1; pp := evalf(pps+Add(evalc(Im(evalc(lpoint[i][5]*exp(I*lpoint[i][4])*(int(1/(x+I*y-lpoint[i][1]-t-I*i*lpoint[i][2]), t = 0.1e-2 .. lpoint[i][3]))))), i = 1 .. pm)) end proc

Roll := `~`[rand]([98.0 .. 102., -1.0 .. 5., .5 .. 1.0, 0 .. evalf(2*Pi), 0 .. 20.]):

pm := 10:

[[98.27956588, 3.544417015, .7402125269, .6765922170, 15.50195873], [98.65180128, 3.451883804, .5602392177, 6.013878725, 8.474993238], [98.31279308, -.572957936, .6824752961, 3.909247401, 16.08638495], [100.4710879, 2.101949414, .7861896595, 4.561551405, 16.60446880], [100.7564957, 0.93068333e-1, .6151377635, .3226189127, 3.506832858], [100.7650898, 4.050019969, .6614955440, 4.655552442, 6.853996945], [101.1778369, 4.981706235, .7924999677, 1.367275655, 9.261917601], [101.7440976, -.475089887, .6353651248, 5.544795602, 11.47038603], [98.96062148, 4.020625799, .8678110796, .7423588626, 4.447467277], [100.3678113, -.855665172, .6269385037, 2.695178664, 1.573624647]]

(1)

unassign('z'); f := proc (z) options operator, arrow; getone(z, pps) end proc; f(zz, pps); Search(f(z, pps), variable = [z::list], initialpoint = [[`$`('Roll()', pm)]], searchpath = 'Path', tolerances = 10^(-5))

Error, (in getone) invalid input: numelems expects its 1st argument, t, to be of type indexable, but received z

 

``

NULL

NULL

NULL


 

Thank for your advice, using [`$`('Roll()', pm)] much easier then using loop, and i uploaded DirectSearch package, i ectualy already got it in lib, but forgot about it.
And the quastions, thet i described such badly last time, is how make all thet two dementional z::list, to be variable for optimisation?

 

@acer Mostly educational purpose, it use random to determinate event, smth like a Monte Carlo method.

At this input parameters it makes only 100events , this is not enough to get tolerens so its cant find f(x)=0 piont, and ectualy i m not sure is this point exist in such configuration of program, but in very simular configuration, using only 2 veribels i was finding f(x,y)<0.01 with 10000 events using self writed nonlinear conjugate gradient method.But now i can use globalopt and change program propetly, or remade it using Markov chain

thanks! events are really helpful!

worksheet

psi := -1.793933256-1.232253132*signum(1.000000000*10^20*x^2+1.000000000*10^20*y^2-1.974469485*10^22*x-6.397280747*10^20*y+9.756555666*10^23)-.4313497688*ln(abs(1.562500000*10^18*x^2+1.562500000*10^18*y^2-3.116347851*10^20*x-9.913902195*10^18*y+1.555432395*10^22))+.4313497688*ln(abs(1.000000000*10^20*x^2+1.000000000*10^20*y^2-1.974469485*10^22*x-6.397280747*10^20*y+9.756555666*10^23))-1.568953416*arctan((4.817624000*10^13*x-1.262249200*10^12*y-4.752088308*10^15)/(1.262249200*10^12*x+4.817624000*10^13*y-2.787120927*10^14))+1.568953416*arctan((4.817624000*10^13*x-1.262249200*10^12*y-4.800281082*10^15)/(1.262249200*10^12*x+4.817624000*10^13*y-2.787120927*10^14))+1.232253132*signum(1.562500000*10^18*x^2+1.562500000*10^18*y^2-3.116347851*10^20*x-9.913902195*10^18*y+1.555432395*10^22)+3.*y-11.93662073*ln((x-100.)^2+y^2):

xxx := evalf(xx+(.1+leng)*ca):

``

i m try to catch this valuse, it can be 3 options, no sing \ singl , one of them or both of them, depending on thet i analyze function , so all of this including dsolve need  just to understend is psi close or open
try XX(99) catch "cannot evaluate the solution further right of %1, probably a singularity": sing := lastexception[3]; ill := i; Sing[count+1] := sing; Singx[count+1] := XX(sing-eps2); Singy[count+1] := YY(sing-eps2); sr := true; if sing <= Sing[count] and maxode then oke := true end if catch "cannot evaluate the solution further right of %1, accuracy goal cannot be achieved with specified 'minstep'": sing := lastexception[3]; ill := i; Sing[count+1] := sing; Singx[count+1] := XX(sing-eps2); Singy[count+1] := YY(sing-eps2); sr := true; if sing <= Sing[count] and maxode then oke := true end if catch "invalid input: %1 received %2, which is not valid for its %-3 argument, %4": sing := lastexception[3]; ill := i; Sing[count+1] := sing; Singx[count+1] := XX(sing-eps2); Singy[count+1] := YY(sing-eps2); sr := true; if sing <= Sing[count] and maxode then oke := true end if catch "cannot evaluate the solution further left of %1, too many step failures, tolerances may be too loose for problem": sing := lastexception[3]; ill := i; Sing[count+1] := sing; Singx[count+1] := XX(sing-eps2); Singy[count+1] := YY(sing-eps2); sr := true; if sing <= Sing[count] and maxode then oke := true end if end try;

XX(-1)

-.15345978

plot([XX(t), YY(t), t = sing .. singl])


Download fo.mwfo.mw

Page 1 of 1