Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I am trying to draw a plot by using the solution of differential equations

z = 0;
Ω = 2.2758;
τ = 13.8;
T2 = 200;
ω0 = 1;
r = 0.7071;
Δ = 1.7758;
ΩR = 2.2758;
ω == 0.5;
system = {u'[t] ==  Ω*v[t],
v'[t] ==  Ω*u[t] - 2*ΩR*w[t] - v[t]/T2,
w'[t] ==  2*ΩR*v[t]};
initialvalues = {u[0] ==  0, v[0] ==  0, w[0] ==  -1};
sol = DSolve[Join[system, initialvalues], {u[t], v[t], w[t]}, t]
FT = (-2*2.2758*r*u[t])/ω0^2 E^(-(r^2/ω0^2) - (t^2/τ^2))* Cos[kz - ωt];
p1 = 
  Plot[FT, {t, -20, 20}, 
    FrameLabel -> {"t", "FT"}, 
    Frame -> True, 
    RotateLabel -> True, 
    PlotRange -> {-0.1, 0},
    PlotStyle -> {Thickness[0.002]}]

my code

right now I went to plot "FT" by using the result of "u" , How I can do that ?

share|improve this question
    
Sorry for the mess earlier, I hope the question is clear now –  saysics Oct 5 '13 at 12:32
    
There are several syntax errors and mistakes in the code, and as there is nothing much else to this question than that, I'm voting to close. A remaining problem is that kz is not defined. –  Oleksandr R. Oct 15 '13 at 17:55
    
Your solution from DSolve is complex. How do you want to plot it in the real plane? You can try to plot Plot[Re[FT /. sol /. {kz -> .1, \[Omega]t -> .2}], {t, -20, 20}] to get an idea, but I only guessed at the kz and \[Omega]t values. –  István Zachar Oct 16 '13 at 7:54

1 Answer 1

Here is one way to make your plot with results from solving your system of ODEs.

z = 0;
Ω = 2.2758;
τ = 13.8;
T2 = 200;
ω0 = 1;
r = 0.7071;
Δ = 1.7758;
ΩR = 2.2758;

ω = 0.5; 

Note: syntax error corrected in expresion for ω.

system = {
  u'[t] == Ω*v[t], 
  v'[t] == Ω*u[t] - 2*ΩR*w[t] - v[t]/T2, 
  w'[t] == 2*ΩR*v[t]
};
initialvalues = {u[0] == 0, v[0] == 0, w[0] == -1};
sol = DSolve[Join[system, initialvalues], {u[t], v[t], w[t]}, t] // Chop // Simplify;

I used Chop and Simplify to get rid of some fuzz produced by DSolve because it was given approximate numbers.

FT = (-2*2.2758*r*u[t])/ω0^2 E^(-(r^2/ω0^2) - (t^2/τ^2))*Cos[k*z - ω*t]
-3.21844 E^(-0.49999 - 0.005251 t^2) Cos[0.5 t] u[t]

Note: syntax errors corrected in the expression for FT.

Plot[FT /. sol, {t, -20, 20}]

plot.png

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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