> That is exactly what I needed, thanks! As for the confusion regarding
> what the code actually does, I should have posted it all (and I will
> following this brief explanation). I am using a modified perturbation
> expansion technique in order to solve a particular 2nd order nonlinear
> ODE. The equation describes how a beam responds to a force applied to
> its endpoints where the line of action of the force, initially
> directed along the axis of the beam, does not change.
>
>
> Here 's' describes a position along the beam, 'psi(s)' is the angle
> that the beam makes with the line of action of the force and 'lambda'
> is proportional to the applied force.  I assume that psi can be
> described as: psi = b*cos(n*pi*s) + b**3*a_11*cos**3(n*pi*s) +
> b**5*(a_21*cos**3(n*pi*s) + a_22*cos**5(n*pi*s)) + ... and the
> parameter 'lambda' can be described as lam = n*pi**2*(1 + k_1*b**2 +
> k_2*b**4 + ...)
>
> So if we can accept that, then the perturbation code takes as its
> argument the number of terms wanted in the expansion and then
> calulates the values of k and a.  After k and a have been calculated
> we can pass a value for 'b' (which is arguably analgous to the initate
> angle of the beam) and then convert the solution for 'psi' into
> functions for x and y. Finally plot the result.
>
> Now, in the orginal code I wrote I used a few built in functions
> available in Maxima which I cannot find the proper syntax for in
> sympy. I need to be able to simply an expression around a specfic
> variable and then extract the coefficeints for said variable. Here is
> an example of what I mean:
>
> /* Solve for parameters */
>         for i thru n do (
>                 A:Cpp[i]+ratcoef(lamsinpsi,b,2*i+1),
>                         for j:0  thru  i-1 do (
>                                 map(rhs, 
> solve(ratcoef(A,c,2*(i-j)+1),a[i,i-j])),
>                                 a[i,i-j]:first(ev(%%)) ),
>                 map(rhs, solve(ratcoef(A,c,1),k[i])),
>                 k[i]:first(ev(%%)) ),
>
> here we can see in the declaration for A we use Cpp (where the p
> stands for prime so Cpp is the second derivative of C wrt 's') and add
> it to the specific term in lam*sin*psi. That allows us to solve for k
> and a. So ratcoef(lamsinpsi,b,2*i+1) takes the expression lamsinpsi
> and organizes it around powers of b, and then passes out the
> coefficient of the power of b requested.
>
> Can anyone point me in a quasi-proper direction for preforming the
> same calculations in sympy? Thanks agian for all your help!

Hi Zoho,

first I am sorry for my later reply, I forgot about this.
Unfortunately, I don't have time right now to learn the syntax of
maxima. Could you please post here some examples of usage of the above
code? I.e. which expression you plug in and what you get? It will be
then easy for me to help you do the same in SymPy.

Thanks a lot,
Ondrej

--~--~---------~--~----~------------~-------~--~----~
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