Items tagged with algorithm algorithm Tagged Items Feed

Hi

I'm dealing with 2nd order ODE on Maple. By using " infolevel 5" Maple tell me that it use Kovacic's algorithm to find the solution. Could anybody tell me how or at least some idea so that I can go on this my self. Following here my ODE

Thank you so much

Chaimongkol

Hello!

I would like to start with the following set of 9 elements,
A = { E11, E12, E21, E22, E11+E12, E11+E21, E12+E22, E21+E22, E11+E12+E21+E22 }.

I need a procedure that takes each of those elements and creates 3 new ones in the following way: Eij becomes Eij1, Eij2, Eij1+Eij2. So for example, E11 will become: E111, E112, and E111+E112. And for example the fifth element in A (i.e. E11+E12) will become the 3 new elements: E111+E121, E112+E122, and E111+E121 + E112+E122.

Since each of the 9 elements gets triplicated, there will be a new set, call it B, with 27 elements.

B = {E111, E112, E111+E112, E121, E122, E121+E122, ... }

Now I want to repeat this process of triplicating again so that, for example, E111 becomes: E1111, E1112, and E1111+E1112. And so on. This new set C will have 81 elements. Now I want to repeat this one last time. The final set, D, will have 243 (3^5) elements. 

Step 2: 

For every pair of elements x and y in D, I want to compute z:=(x+y)mod2. If z already belongs to D, discard it, otherwise, place z in the set D2. Do this until there are no more elements to add together (note that if x+y is computed then I don't want y+x to be computed also--that's inefficient). Maybe the most efficient way is to perform all possibly combinations of x+y mod 2 to create the set D2 and then just go: D2 setminus D.

Step 3: For x in D and y in D2 perform all possible combinations of z:=(x+y)mod2 and place these in D3 then perform set subtraction again: D3 minus D2 minus D.

Repeat this process again: x in D and y in D3 to create new elements in D4. Repeat again until Dm is empty (that is, D(m-1) will be the last set that contains new elements). I'm expecting around 12 sets... 

The issue with this whole algorithm is that I often run out of memory so I need a clever way to do this, since this algorithm is essentially classifying 2^32 elements into disjoint sets. Thank you! 

Hi,

I have the a code with some parameters including

Nr= 0, 50, 100

Ha=0, 5, 10

EPSILONE= 0, 0.5, 1

Phiavg= 0.02, 0.06, 0.1

0.1<NBT<10

I can give the solution for higher values of 5<NBT<10 and there is no problem. However, As I reduce the values of NBT, the convergence of the problem is hard. for some values of parameters I cannot find the solution. for example:

Nr=Ha=0

EPSILONE=1

Phiavg=0.06

NBT=0.3

 

I would be most grateful if you can tel me how change the algorithm to find the solution in the range of all parameters.

Many thanks for your attentions in advance

The code has been attached

code_7-8-2014_(1).mw

 

Amir

I'm interested in doing some experimental mathematics using the PSLQ integer relation algorithm.  The only third-party program for doing PSLQ problems I've been able to find is a GNU C++ program with a less-than-user-friendly command-line interface.  I've heard that Maple implements PSLQ and I like the symbolic input and presentation it offers as a CAS, but I can't find any information on which alternative types of Maple 18 make the PSLQ algorithm available.

about quicksort...

June 01 2014 taro 100

Dear people in Mapleprimes,

I calculated the following Quick Sort algorithm.

 

restart;
quicksort:=proc(A::array(1,numeric),
m::integer, n::integer) 
local partition, p;

partition:=proc(m,n)
i:=m;
j:=n;
x:=A[j];
while i<j do
if A[i]>x then
A[j]:=A[i];
j:=j-1;
A[i]:=A[j];
else
i:=i+1;
end if;
end do;
A[j]:=x;
p:=j;

end proc:

if m<n then
p:=partition(m,n);
quicksort(A,m,p-1);
quicksort(A,p+1,n);
end if;
eval(A);
end proc:

trace(quicksort);

a:=array([2,4,1,5,3]);

quicksort(a,1,5);

 

Then, in the answer, there was a sentence that

{--> enter , quicksort, , args = , a, , , 2, , , 2

........................

{--> enter , quicksort, , args = , a, , , 4, , , 5

I could understand the reason of the "{--> enter , quicksort, , args = , a, , , 2, , , 2," 

but, I could not understand why 4, , , 5 could appear here. I think there is no reason why n that is the number at 5 

increased from 2 to 5. I thought n continues to be 2.

I hope you will give me some hint for this understanding.

 

I thought it with a lot of time. And, I don't know whether this place is an appropriate place to ask this question.

But, I will be very glad if you teach me some of this.

 

Best wishes.

 

taro

 

 

 

 

 

if there is a set of identities, such as a+b = b+a, a^2 = 2*a + 1

and one input or a few input,

how to make use of these identities to derive some output?

any algorithm can do this?

we use modern computer algebra books

i) computer the GSO of (22,11,5),(13,6,3),(-5,-2,-1) belong to R^3.

ii)trace algorithm 16.10 on computer a reduced basis of the lattice in Z^3 spanned by the vectors form(i).

trace also the values of the d_i and of D, and compare the number of exchange steps to the theoretical upper bound from section 16.3

 

we use Modern Computer Algebra book  

trace algorithm 15.2 on factoring f=30x^5+39x^4+35x^3+25x^2+9x+2 belong to Z[x].choose the prime p=5003 in step.

I have recently written a maple program to deconvolute gamma-ray spectra using the Richardson-Lucy algrithm. Although this method works well I would prefer to use a method based on the Maximum Entropy algorithm, and would like to know if anyone has tried to write a Maple program to deconvolute 1 dimensional data?

Greetings to all.

At the following Math.Stackexchange Discussion a certain constant was computed in relation to a Master Theorem Type recurrence being solved. This prompted me to try to identify it by the use of the eponymous command. What follows is the content of the Maple session. You may want to read the post in order to get an understanding of what the constant means and how its exact value is calculated.

> fsolve(2/2^a+1/4^a=1, a);
                                   1.271553303

> identify(%);
                                   1.271553303

> identify(%,all);
                                 1/2    1/2
                              2 2      3
                      arcsech(------ + ---- - 1/6 Zeta(5))
                                7       6

> evalf(log[2](1+sqrt(2)));
                                   1.271553303

My questions/observations are:

  • Why does the algorithm fail to spot as simple a constant as the one above or am I just not invoking it correctly?
  • If that last formula were true the author of this code would certainly win a prize for calculating a closed form expression for an odd integer zeta function value! (To be fair here I did notice that the spurious identification disappears when the number of working digits is increased and I do understand that the identification depends critically on the number of digits.)

In concluding I would like to say, why the complicated formula and not the simple one? Let me congratulate you just the same on providing this very useful command. I have worked on pandigital approximations which are slightly related and I understand that adding an operation like the logarithm to an integer base up to some max base value can dramatically increase the search space and may not always be feasible.

Best regards,

Marko Riedel

Trace  on computing the distinct-degree decomposition of the squarefree polynomial
f=x^17+2x^15+4x^13+x^12+2x^11+2x^10+3x^9+4x^4+3x^3+2x^2+4x belong to F_5[x].tell from the output only how many irreducible factors of degree i the polynomial f has, for all i.

 

Dear Sirs,

I actually rigoruos to know what is the algorithm of BVP[midrich]? how it can obtain the solution of ODE with singularities?

 

Did anyone introduce a reference about the algorithm like this?

Thanks for your attention in advance

Amir

Greetings to all.

The multiplicative partition function is defined here at Wikipedia and was recently the subject of a discussion at Math Stackexchange.

I posted two solutions to the task of computing this function at the above page that use Maple code. One of them employs the Polya Enumeration Theorem and is of mostly theoretical interest as it cannot be used to effectively compute the function for n with many factors. I posted two additional implementations in order to remedy this defect, one of them in Maple and the other in Perl. I think the Maple implementation is easy enough to read not to require additional commentary. Note, however, that even though the Maple code and the Perl code implement the same algorithm (dynamic programming), the Maple version is dramatically slower than the Perl version and consumes a lot of memory. E.g. Maple takes 58 seconds for the value for 9! and Perl takes 1.5 seconds.

My question is, can someone explain this difference? Note that both are interpreted languages so there is no gain due to potential compilations.

Your commentary is appreciated.

This is with Maple 15 (X86 64 LINUX).

Best regards,

Marko Riedel

I want to write maple code of the following algorithm with

the following parameters and initial values please help me.

T0 = 5.5556 × 107 cells, I0 = 1.1111 × 107 cells, V0 = 6.3096 × 109 copies/ml,

A1=A2=1,

c = 0.67, h = 1, d = 3.7877 × 10−3, δ = 3.259d,

λ = 2/3× 108d, R0 = 1.33,

p = (cV0δR0)/λ(R0−1)

and β = dδcR0/λp .

 

Algorithm
step 1 :
T(0) = T0, I(0) = I0, V (0) = V0 λi(100 ) = 0 (i=1, ..., 3), u1(0) = 0 =
u2(0).

step 2 :
for i=1, ..., n-1, do :
Ti+1=(Ti + hλ)/(1 + h[d + (1 − u1i)βVi]),

Ii+1 =(Ii + h(1 − u1i)βViTi+1)/(1 + hδ),

Vi+1 =(Vi + h(1 − u2i)pIi+1)/(1 + hc),

λ1n−i−1 =(λ1n−i + h[1 + (1 − u1i)βVi+1])/(1 + h[d + (1 − u1i)βVi+1]),

λ2n−i−1 =(λ2n−i+ hλ3n−i (1 − u2i)p)/(1 + hδ),

λ3n−i−1 =(λ3n−i + h(λ2n−i−1− λ1n−i−1 )(1 − u1i)βTi+1)/(1 + hc),

R1i+1 =(1/A1)(λ1n−i−1−λ2n−i−1 )βVi+1Ti+1,

R2i+1 =−(1/A2)λ3n−i−1 pIi+1,

 

u1i+1 = min(1, max(R1i+1 , 0)),

u2i+1 = min(1, max(R2i+1 , 0)),

end for

 

step 3 :
for i=1, ..., n-1, write
T(ti) = Ti, I(ti) = Ii, V(ti) = Vi,

u1(ti) = u1i, u2(ti) = u2i.

end for

Hi

I want to solve two odes with their boundary condition. I wrote the code below:

restart:

eq2:=diff(T(eta),eta,eta)+Nb*diff(T(eta),eta)*diff(phi(eta),eta)+Nt*diff(T(eta),eta)*diff(T(eta),eta);

eq3:=diff(phi(eta),eta,eta)+Nt/Nb*diff(T(eta),eta,eta);

sys_ode:=  eq2=0,eq3=0;
bcs := phi(0)=0,phi(h)=1,T(0)=0,T(h)=1;
sol:=dsolve([sys_ode, ics]);


however, this code doesnt get my desired results (the results are complex!). but when I (with hand) integrate Eq3 twice and substitute boundary conditions and replace in Eq2 the answer is easy and straightforward.

How can I change the following algorithm to get my results?

Thanks for your attention in advance

Amir

1 2 3 4 Page 1 of 4