Hi Mr Ondrej,
I 'm interested in extracting the function that a while loop defines
between the initial states (i, j, l, m, n, t, tt, v, vv, w, x, y) of
its variables and the final states(iP, jP, lP, mP, nP, tP, ttP, vP,
vvP, wP, xP, yP) of its variables. And I want to do that by solving a
system of equations and inequations that mixes :
- numeric equations(like:tt/3^(i/1)==ttP/3^(iP/1))
- inequalities (like:i<=iP)
- equations with arrays where I want to express symbolically sum of
the elements of an array (like:x+Sum[A[k],{k,i,N}]==xP+Sum[A[k],
{k,iP,N}])
-equations with nesting functions (like(Nest[f,v,j]==Nest[f,vP,jP]
wich means f(f(f(..(v)) j times is equal to f(f(f(..(vP)) jP times.
-equations with lists (like Join[l,m]==Join[lP,mP]which means that the
concatenation of lists m and l is equal to the concatenation of lP and
mP)Unfortunately, some of these equations doesn't work in mathematica (especially for nesting function and for lists)(for arrays I'm not sure) and that's why I want to know if sympy could help me; It will be really great! Is my explanation more clear?Could you help me? On 26 déc, 22:22, "Ondrej Certik" <[email protected]> wrote: > Hi Olfa, > > On Wed, Dec 24, 2008 at 11:05 PM, olfa <[email protected]> wrote: > > > Mr Ondrej, here a full example (wrote in mathematica) of what I want > > to do. Unfortunately, it doesn't work in mathematica (especially for > > nesting function and for lists) and that's why I want to know if sympy > > could help me; It will be really great! > > sorry for my late reply, I am really busy now moving to Nevada. > > > > > > > > > Reduce[ { > > i<=iP, > > j>=jP, > > 1*j+1*i==1*jP+1*iP, > > mP==Nest[Rest,m,iP-i], > > i+Length[m]==iP+Length[mP], > > 1*n-4*i==1*nP-4*iP, > > 4*i-1*n==4*iP-1*nP, > > tt/3^(i/1)==ttP/3^(iP/1), > > mP==Nest[Rest,m,j-jP], > > j-Length[m]==jP-Length[mP], > > 4*j+1*n==4*jP+1*nP, > > Nest[f,v,j]==Nest[f,vP,jP], > > tt/3^(j/-1)==ttP/3^(jP/-1), > > Join[l,m]==Join[lP,mP], > > t-c*n*(n-4)/(2*4)==tP-c*nP*(nP-4)/(2*4), > > tt/3^(n/4)==ttP/3^(nP/4), > > vv+7*tt/(1-3)==vvP+7*ttP/(1-3), > > x+Sum[A[k],{k,i,N}]==xP+Sum[A[k],{k,iP,N}], > > y+Sum[B[k],{k,1,j}]==yP+Sum[B[k],{k,1,jP}], > > w+Sum[Nest[f,v,k],{k,1,j}]==wP+Sum[Nest[f,vP,k],{k,1,jP}], > > (iP==20+1)}, > > {iP, jP, lP, mP, nP, tP, ttP, vP, vvP, wP, xP, yP},Backsubstitution- > >>True] > > > here: arrays are A and B and lists are l,m,lP and mP. > > I am a bit confused by this, but as I understand, you have a set of > equations of a type: > > tt/3^(i/1)==ttP/3^(iP/1) > 1*j+1*i==1*jP+1*iP > > This equation seems pretty tough: > > Nest[f,v,j]==Nest[f,vP,jP] > > looking here: > > http://reference.wolfram.com/mathematica/ref/Nest.html > > does the left hand side mean f(f(f(...f(v))) where the nesting is > done "j" times? > > Then you also seem to have couple of inequalities, of the type: > > i<=iP > > And you are interested in solving all those equations and > inequalities, am I right? > > As I said in my previous email, you can solve sets of equations in > sympy -- but the Nest operator is not yet implemented and also the > solver() is not yet clever about Sums too much. So I am afraid it > still needs substantial work. > > How did you get these equations? What kind of problem is it, that the > formulation looks like that? > > Ondrej- Masquer le texte des messages précédents - > > - Afficher le texte des messages précédents - --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sympy?hl=en -~----------~----~----~----~------~----~------~--~---
