Hello:

I am brand new to python/sympy  scripting and I have a project I have
written in Maxima but would like to port it to sympy (as it is far
more readable than the specific Maxima language) but I am not sure if
sympy yet has the funcialanity that I require.

What I would like to do is create an array with symbolic coefficients
and then use the array coeffiecents to create expressions. The
coeffiecents are solved for later. To give you and idea of what I mean
here is a small snippet of the Maxima code:

/* A Maxima program to solve
                        psi'' + lambda *sin(psi) = 0 , psi'(0)=psi'(1)=0,
                                        int(sin(psi(s),s=0..1) = 0.
where   psi = b*cos(n*pi*s) + b^3*cos^3(n*pi*s) + ...
                                lambda=1+k*b^2+k*b^4 + ... */

/* Setup the expressions for psi, lambda, x, y and solve for
the parameters */
setup(terms):=block([],
        kill(k,a,b,d),
        n:terms,
        ratweight (b,1,c,1),
        ratwtlvl: 2*(2*n+1),
        /* Calculate expansion for psi and lambda */
        C[0]:c,
        Cpp[0]:-c,
        k[0]:1,
        for i thru n do (
                C[i]:sum(a[i,j]*c^(2*j+1),j,1,i),
                
Cpp[i]:sum(a[i,j]*(-(2*j+1)^2*c^(2*j+1)+(2*j+1)*(2*j)*c^(2*j-1)),j,
1,i) ),
        psi:sum(b^(2*i+1)*C[i], i,0,n),
        lam:sum(b^(2*i)*k[i], i,0,n),

....

in the Maxima code you do not need to declare the array before. Here
'a'  is an array and the expressions 'psi' and 'lam' are later solved
for the coefficients.

So is there a way to do this using sympy?

Zoho

post scriptum: Thank you for writing such great software!


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to sympy@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to