# Can anyone help to write a code for plotting the following equation with time please?

1 view (last 30 days)
Avan Al-Saffar on 9 Feb 2015
Commented: Torsten on 10 Feb 2015
x = exp( (-B/omega) * cos(omega * t) ) ...
./ ( (B/A)*(integral(exp( (-B/omega)* cos(omega * t) ))))
Where
A= 1;
B= 10;
omega= 1;
x0 =0.1;
t = 0 :0.0001:1000;
Avan Al-Saffar on 9 Feb 2015
We can find the constant at x(t=0).

per isakson on 9 Feb 2015
Edited: per isakson on 9 Feb 2015
With a little bit of guessing
A= 1;
B= 10;
omega= 1;
x0 =0.1;
t = 0 :0.0001:1000;
fi = @(ti) exp( (-B/omega).*cos(omega*ti) );
fx = @(tj) exp( (-B/omega) .* cos(omega*tj) ) ...
./ ( (B/A).*(integral( fi, 0, tj )));
ezplot( fx, 0:1e-3:12*pi )
produces this &nbsp
I don't use x0 =0.1; and I get a warning
Warning: Function failed to evaluate on array inputs; [...]
Torsten on 10 Feb 2015
If lower limit and upper limit of an integral are identical (t=0 in this case), its value is zero - independent of the function to be integrated.
Best wishes
Torsten.