1
$\begingroup$

I have this equation but it takes so long and no answer comes out. Could you please suggest me what to do or should I just wait more. Even if you could help me understand different numerical solves, that would be great. Note that want it to be solved with respect to q and other variables are positive and from 0 to infinity.

Sqrt[1 + q^2 + w^2] ((q^2 + w^2) Subscript[\[Alpha], 
 1] - (l^2 + q^2 + w^2) (-1 + Subscript[\[Alpha], 2] - 
   Subscript[\[Alpha], 3])) (Subscript[C, 
 3333] (l^2 + (q^2 + w^2) (1 + Subscript[\[Alpha], 1]) - (1 + 
      q^2 + w^2) Subscript[\[Alpha], 2]) - (q^2 + w^2) Subscript[
 C, 1133] Subscript[\[Alpha], 3]) - Sqrt[l^2 + q^2 + w^2] (Subscript[C, 
 3333] ((q^2 + w^2) Subscript[\[Alpha], 
    1] - (l^2 + q^2 + w^2) (-1 + Subscript[\[Alpha], 2])) - (q^2 +
    w^2) Subscript[C, 1133] Subscript[\[Alpha], 
 3]) (l^2 + (q^2 + w^2) (1 + Subscript[\[Alpha], 1]) + (1 + q^2 + 
   w^2) (-Subscript[\[Alpha], 2] + Subscript[\[Alpha], 3]))
$\endgroup$
5
  • $\begingroup$ Welcome to Mathematica StackExchange! Do you want to have a general symbolic result, or do you know the values of the parameters and just want a numerical result? $\endgroup$
    – Domen
    Commented Mar 11, 2023 at 16:42
  • 3
    $\begingroup$ The symbols C and K are used by Mathematica and should be avoided. It is also better to avoid using subscripts. Indexed variables are better (you can display indexed variables as subscripts using Format). $\endgroup$
    – Bob Hanlon
    Commented Mar 11, 2023 at 16:56
  • $\begingroup$ If you look carefully you should find that your expression is not just up to q^4, it looks like it has has even powers up to q^6. I saw that by using Expand on your expression. It might make your problem slightly easier if you replace all q^(2n) by newq^n and solve for newq and then look at the two square roots of newq. But none of that is going to help deal with the Sqrt[l^2+q^2+w^2] and Sqrt[1+q^2+w^2] that will complicate finding any "simple" solution in q.. $\endgroup$
    – Bill
    Commented Mar 12, 2023 at 3:58
  • $\begingroup$ @Bill thank you for your asnwer. I get what you mean. yes it's q^6. i used Expand and Factor and tried even Collect for some parts but as you said, Sqrt[l^2+q^2+w^2] and Sqrt[1+q^2+w^2] are my real problems which doesn't let me have an answer. I don't know it can help but for Alpha 1 to 3 (which are constants), I have them and w changes from 0 to infinity and q is what i want. This expression has real and imaginary parts as well but it can not be shown in what i wrote. i want to try numerical ways to calculate it in order to see where it can make roots. could you help me on that? $\endgroup$
    – Ali Taher
    Commented Mar 12, 2023 at 9:34
  • $\begingroup$ @Bill maybe even using the absolute value of the function helps better to solve numerically. however, if you can help me with an example or a link of video or anything, i would really apreciate $\endgroup$
    – Ali Taher
    Commented Mar 12, 2023 at 9:35

1 Answer 1

1
$\begingroup$

Use Solve.

expr = -Sqrt[
      l^2 + q^2 + 
       w^2] (Subscript[c, 
        3333] ((q^2 + w^2) Subscript[α, 
           1] - (l^2 + q^2 + w^2) (-1 + 
            Subscript[k, d]^2 Subscript[α, 2])) - (q^2 + 
         w^2) Subscript[c, 1133] Subscript[α, 
        3]) (l^2 + (q^2 + w^2) (1 + Subscript[α, 1]) + (1 + 
         q^2 + w^2) Subscript[k, d]^2 (-Subscript[α, 2] + 
         Subscript[α, 3])) + 
   Sqrt[1 + q^2 + 
      w^2] (Subscript[c, 
        3333] (l^2 + (q^2 + w^2) (1 + Subscript[α, 1]) - (1 + 
            q^2 + w^2) Subscript[k, d]^2 Subscript[α, 
           2]) - (q^2 + w^2) Subscript[c, 1133] Subscript[α, 
        3]) (l^2 + (q^2 + w^2) (l^2 + q^2 + w^2) Subscript[k, 
         d]^2 (1 + Subscript[α, 1]) (-Subscript[α, 2] + 
         Subscript[α, 3]));
params = {Subscript[α, 1] -> 3.5, 
   Subscript[α, 2] -> 1,  Subscript[α, 3] -> 1.75, 
   l -> 1.25, Subscript[c, 1133] ->  0.75, 
   Subscript[c, 3333] -> 0.167, Subscript[k, d] -> 1};

sol = q /. Solve[expr == 0 /. params, q, Reals] // Quiet;

Plot[sol, {w, 0, 1}, AspectRatio -> Automatic, 
 AxesLabel -> {w, q}] // Quiet

Plot

$\endgroup$
8
  • $\begingroup$ thank you very much. Is it possible to plot it from 0<w<infinity as well? $\endgroup$
    – Ali Taher
    Commented Mar 12, 2023 at 18:40
  • $\begingroup$ Can you please write down the value of parameters ($\alpha_1, \alpha_2, \alpha_3, C_{3333}, K_d, \dots$) so that I can get a realistic plot? $\endgroup$
    – Domen
    Commented Mar 12, 2023 at 19:13
  • $\begingroup$ Yes. Subscript[[Alpha], 1] -> 3.5, Subscript[[Alpha], 2] -> 1, \ Subscript[[Alpha], 3] -> 1.75, l -> 1.25, Subscript[C, 1133] -> \ 0.75, Subscript[C, 3333] -> 0.167 and let me make the expr a bit simple without K_d. I also have 0<w<infinity but seems this condition is not entirely true. I have updated the question part. $\endgroup$
    – Ali Taher
    Commented Mar 13, 2023 at 6:24
  • $\begingroup$ @AliTaher, is solution q supposed to be real? Because given your parameters, I only get complex solutions ... $\endgroup$
    – Domen
    Commented Mar 13, 2023 at 11:18
  • $\begingroup$ yes it is complex. it came from fourier integrals. i just wrote the results here which i wanted to evaluate numerically. $\endgroup$
    – Ali Taher
    Commented Mar 14, 2023 at 9:22

Your Answer

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

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