0

For some reason the result of Plot of the following function:

Clear[x]; Clear[a]; Clear[b];

m={{(1+1/k)/x^2,1/k},{-1/k,x^2(1-1/k)}};
{{l1,l2},{v1,v2}}=Eigensystem[m];
g = Solve[{0,1}==a v1 + b v2,{a,b}];
alpha = First[a /. g];
beta = First[b /. g];
d[x_, h_, n_]:= alpha l1^n v1 + beta l2^n v2 /. k-> (2 Log[x])/h
Plot[Last[d[x,4,8]], {x,6.78,8}, PlotStyle->Orange]

is this

enter image description here

How can I remove those blank spaces to see the plot of a continuous function?

1 Answers1

4

Your function seems to produce values with small imaginary components, which Plot deliberately ignores. If you Chop your results, the function seems to plot just fine:

m = {{(1 + 1/k)/x^2, 1/k}, {-1/k, x^2 (1 - 1/k)}};
{{l1, l2}, {v1, v2}} = Eigensystem[m];
g = Solve[{0, 1} == a v1 + b v2, {a, b}];
alpha = First[a /. g];
beta = First[b /. g];
d[x_, h_, n_] := alpha l1^n v1 + beta l2^n v2 /. k -> (2 Log[x])/h
Plot[Last[d[x, 4, 8]] // Chop, {x, 6.78, 8}, PlotStyle -> Orange]

Mathematica graphics

Yves Klett
  • 15,383
  • 5
  • 57
  • 124