2
$\begingroup$

I have got to solve a second order equation, where the coefficient depend on the parameter $k$:

$$(A_k - \omega) (D_k- \omega) - B_kC_k = 0$$

so that also the solution $\omega=\omega(k)$ will depend on $k$. Here's my code.

Parameters:

L = 10; l = 1; w = 0.13; 
Subscript[ϕ, 0] = 1; β = 0.1; α = 0.06; η = 0.5; d = 1; 
λ = 0.1;

Coefficients:

AA = (((1 - w) kk^2 Pi^2 l^2) / L^2) + (α (Subscript[ϕ, 0 ]^2) (1 - λ))/η;
BB = Pi l w (1 + ((1 - λ)^2/2 η))/L;
CC = -β (Subscript[ϕ, 0 ]^2) Pi l kk/ L;
dd = (Pi l (d - w) kk^2 Pi^2 l^2)/ L^2 ;

Then solving:

sol = Last[Simplify[Solve[(AA - ω) (dd - ω) - BB CC == 0, ω]]]

Now, how do I make Mathematica plot this solution as a function of $k$?

If I try:

Plot[Evaluate[ω[kk]/.sol], {kk, -10, 10}, PlotRange -> All]

it does not work.

$\endgroup$

1 Answer 1

3
$\begingroup$
Plot [ω /. sol, {kk, -10, 10} ]

enter image description here

$\endgroup$
2
  • $\begingroup$ Thanks so much! Just another comment: if I wanted to plot $\omega$ both as a function of k and then show on the same plot several $\omega(k)$ for different values of $\alpha$? $\endgroup$ Nov 22, 2013 at 14:51
  • $\begingroup$ @usumdelphini Run your code without setting a value for Alpha and then Plot3D[\[Omega] /. sol, {kk, -10, 10}, {\[Alpha], 0, 20}, PlotRange -> All] $\endgroup$ Nov 22, 2013 at 14:57

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.