0
$\begingroup$

I'm working on an instability problem. The minimum of my code is

(*ClearAll["Global`*"];*)

k = Sqrt[3/8]*wp/V0; wp = 1; wc = wp*V0/c; 
c = 1; V0 = 1/5; gamma0 := 1/Sqrt[1 - V0^2/c^2];

w0[k_] := 
  N[Sqrt[wp^2/2/
      gamma0^3*(Sqrt[1 + 8*k^2*V0^2/wp^2*gamma0^3] - 1 - 
       2*k^2*V0^2/wp^2*gamma0^3)]];

Omega[V_] := w - k*V;
A[V_] := (w - k*V)^2*(w^2 - k^2*c^2 - wp^2/gamma0) - 
   wc^2/gamma0^2*(w^2 - k^2*c^2);
B[V_] := 
  1/c^2*((w - k*V)^2*(w^2 - k^2*c^2 - wp^2/gamma0)^2 - 
     wc^2/gamma0^2*(w^2 - k^2*c^2)^2);

Eq1u = w^2/A[V0]*(wc^2/gamma0^2 + wp^2/gamma0^3 - Omega[V0]^2)*
     Eyu''[x] + 
    w^2/c^2 (wp^2/gamma0^3/Omega[V0]^2 - 1)*
     Eyu[x] - (w*wc/gamma0*wp^2/gamma0)*(k - w*V0/c^2)/A[V0]*
     Ezu'[x] == 0;
Eq2u = Ezu''[x] + 
    B[V0]/A[V0]*
     Ezu[x] - (w*wc/gamma0*wp^2/gamma0)*(k - w*V0/c^2)/A[V0]*
     Eyu'[x] == 0;


sol = N[DSolve[{Eq1u, Eq2u}, {Eyu, Ezu}, x]];

In the instability problems, zero perturbations Eyu[x],Ezu[x] at infinities are required. As a result, I want to extract the coefficients of divergent modes in Eyu[x]/.sol and make them zero. For example, when I use a trial value of w,

(*In[46]:=*) 
Simplify[First[Eyu[x] /. sol] /. w -> 1 + I*w0[k]]

(*Out[46]= 
E^((2.97141 - 0.178628 I)  x)  ((0.148442 - 0.0995556 I)  C[
     1] + (0.0449376 - 0.0376005 I)  C[
     2] - (0.142001 - 0.385287 I)  C[3] - (0.0475322 - 0.119491 I)  C[
     4]) + E^((-2.97141 + 
     0.178628 I) x)  ((0.148442 - 0.0995556 I)  C[
     1] - (0.0449376 - 0.0376005 I)  C[
     2] + (0.142001 - 0.385287 I)  C[3] - (0.0475322 - 0.119491 I)  C[
     4]) + E^((-3.11842 - 
     0.125555 I) x)  ((0.351558 + 0.0995556 I)  C[
     1] - (0.121022 + 0.0335295 I)  C[
     2] - (0.0979695 - 0.379203 I)  C[
     3] + (0.0475322 - 0.119491 I)  C[4]) + 
 E^((3.11842 + 0.125555 I)  x)  ((0.351558 + 0.0995556 I)  C[
     1] + (0.121022 + 0.0335295 I)  C[
     2] + (0.0979695 - 0.379203 I)  C[
     3] + (0.0475322 - 0.119491 I)  C[4])
*)

Clearly the coefficients of the first and fourth term with a positive exponent should be zero for x>0 to meet the requirement. Also, it indicates Eyu[x] /. sol should be a combination of four terms, each in the form of Exp[fi[w]x]*(fi1[w]C[1]+fi2[w]C[2]+fi3[w]C[3]+fi4[w]C[4]).

However, when w is not determined,Simplify[First[Eyu[x] /. sol] or Collect[First[Eyu[x] /. sol,Exp[_x]] just combine all the terms in front of the C[i]s.

Is there any way to Collect and separate the terms with respect to Exp[fi[w]x] when the fi[w]s are unknown?

Thanks for any suggestions!

$\endgroup$
3
  • $\begingroup$ sol does not contain E, because you have replaced it by its machine-precision approximation by using N in the equations. Eliminate N and then use Collect. $\endgroup$
    – bbgodfrey
    Commented Dec 11 at 3:49
  • $\begingroup$ Cases[sol, Exp[_], Infinity] // Union shows that sol contains four exponentials. From this information, you can use Coefficient to obtain the coefficients of the exponentials of your choosing. By the way, the coefficients are enormous, even it you then use N and Simplify (in that order) to reduce their lengths. $\endgroup$
    – bbgodfrey
    Commented Dec 11 at 3:57
  • $\begingroup$ @bbgodfrey Thanks a lot. The Cases function is really helpful. I only need the coefficient to establish another equation so that seems enough for me. $\endgroup$
    – Repentanze
    Commented Dec 11 at 4:33

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.