Why I can't plot this one?
Show older comments
clear clc
xss=0.01;
omegaf = 40;
omegan = 20;
n=0.1;
syms x(t) A B
v(t) = diff(x,t);
x0 =0.05;
v0 =2;
eq1 = xss * cos(omegaf*t) + (A*sin(omegan*t) +B* cos(omegan*t))*exp(-n*omegan*t) == x;
eq2 = diff(eq);
eq3 = subs( eq1 , [x(t),t] , [x0,0]);
eq4 = subs( eq2 , [v(t),t] , [v0,0]);
[D,C] = equationsToMatrix([eq3,eq4],[A,B]);
Res = linsolve(D,C);
eq1 = subs(eq1, [A,B] ,[Res(1),Res(2)]);
t=0:4;
plot(t,eq1)
Accepted Answer
More Answers (0)
Categories
Find more on Operations on Strings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!