0
$\begingroup$

I have the following set of equations. I want to solve a[n] and f[n] for the indices n=1:5. Note that the relation a[2n+2] involves the derivative of f[2n] and the relation for f[2n+2] involves the derivative of a[2n]. The first four statements are starting conditions.

  1. a[0] == function(z) --> for simplicity lets take z^6
  2. f[0] == function(z) --> for simplicity lets take z^6
  3. a[2n+1] == 0
  4. f[2n+1] == 0,
  5. a[2n+2] == (1/((2n+3)^2 -1))(-k^2 a[2n]-(((2n+3)(D[a[2n],{z,2}]))-2 omega D[f[2n],z])/(2n+1))

  6. f[2n+2] == (1/((2n+3)^2 -1))(-D[f[2 n],{z,2}]-(1/(2n+1))((2n+3) k^2 f[2n]+2k D[a[2 n], z]/c))

Can anyone help ?

Thanks in advance

Jim

$\endgroup$
  • $\begingroup$ Welcome to Mathematica.SE! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Read the faq! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! $\endgroup$ – user9660 Feb 24 '15 at 23:40
2
$\begingroup$

Basically we just put your definitions directly into Mathematica. The only change we have to make is to solve for n given 2n + 2 (which I'm calling m).

a[0] = C[1][z]; (* The C[_] are just placeholder functions *)
f[0] = C[2][z]; (* I would have used a and b or f and g, but... *)
a[_?OddQ] := 0;
f[_?OddQ] := 0; 
a[m_?EvenQ] := 
 Block[{n = 
    m/2 - 1}, (1/((2 n + 3)^2 - 1)) (-k^2 a[
       2 n] - (((2 n + 3) (D[a[2 n], {z, 2}])) - 
        2 omega D[f[2 n], z])/(2 n + 1))];
f[m_?EvenQ] := 
  Block[{n = 
     m/2 - 1}, (1/((2 n + 3)^2 - 1)) (-D[
        f[2 n], {z, 2}] - (1/(2 n + 1)) ((2 n + 3) k^2 f[2 n] + 
         2 k D[a[2 n], z]/c))];

You can get your desired result with

a /@ Range[5]
f /@ Range[5]

$$ \begin{align} a(1)&=0 \\ a(2)&=\frac{-k^2c_1(z)+2 \omega c_2'(z)-3 c_1''(z)}{8} \\ a(3)&=0 \\ a(4)&=\frac{3 c k^4 c_1(z)+2 k \left((7 c k-2 \omega ) c_1''(z)-6 c k \omega c_2'(z)\right)-12 c \omega c_2{}^{(3)}(z)+15 c c_1{}^{(4)}(z)}{576 c} \\ a(5)&=0 \end{align} $$ $$ \begin{align} f(1)&=0 \\ f(2)&=-\frac{3 c k^2 c_2(z)+2 k c_1'(z)+c c_2''(z)}{8 c} \\ f(3)&=0 \\ f(4)&=\frac{15 c k^4 c_2(z)+2 k \left(6 k^2 c_1'(z)+(7 c k-2 \omega ) c_2''(z)+6 c_1{}^{(3)}(z)\right)+3 c c_2{}^{(4)}(z)}{576 c} \\ f(5)&=0 \\ \end{align} $$

To substitute your functions (both $z^6$):

a /@ Range[5] /. {_C -> (#^6 &)} // FullSimplify
f /@ Range[5] /. {_C -> (#^6 &)} // FullSimplify

$$ \begin{align} a(1)&=0 \\ a(2)&=-\frac{1}{8} k^2 z^6+\frac{3 \omega z^5}{2}-\frac{45 z^4}{4} \\ a(3)&=0 \\ a(4)&=z^4 \left(\frac{35 k^2}{48}-\frac{5 k \omega }{24 c}\right)+\frac{k^4 z^6}{192}-\frac{1}{8} k^2 \omega z^5-\frac{5 \omega z^3}{2}+\frac{75 z^2}{8} \\ a(5)&=0 \\ \end{align} $$ $$ \begin{align} f(1)&=0 \\ f(2)&=-\frac{3 k z^5}{2 c}-\frac{3}{8} k^2 z^6-\frac{15 z^4}{4} \\ f(3)&=0 \\ f(4)&=\frac{k^3 z^5}{8 c}+z^4 \left(\frac{35 k^2}{48}-\frac{5 k \omega }{24 c}\right)+\frac{5 k z^3}{2 c}+\frac{5 k^4 z^6}{192}+\frac{15 z^2}{8} \\ f(5)&=0 \\ \end{align} $$

Hope this helps!

$\endgroup$
  • $\begingroup$ Yes it does ! Thank you very much. $\endgroup$ – Jim Feb 26 '15 at 0:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.