i am not able to get graph

2 views (last 30 days)
Sanjay N
Sanjay N on 23 Mar 2022
Commented: Star Strider on 23 Mar 2022
H= 2.7
E= 1.05
V=1
g=5000000
p=5000000
f=50
dt=0.05
omega=0
base=g
G=g/base
M=(H*G)/(180*f)
Xs=0.4
Xe=1
pt=1
delta=asin((pt*Xs)/(E*V))
delta_d=delta*180/pi
dd=1
for t=0:0.05:0.5
pe_n=(E*V*sin(delta)/Xe)
pe=1-pe_n
pa=pe/M
if t==0
pa=pa/2
else
pa=pa
end
d_omega=pa*dt
omega=omega+d_omega
d_delta=omega*dt
plot(t,delta_d)
xlabel('in seconds')
ylabel('in \delta(degree')
delta_d=d_delta+delta_d
dd=dd+1
end

Accepted Answer

Star Strider
Star Strider on 23 Mar 2022
Try this —
H= 2.7;
E= 1.05;
V=1;
g=5000000;
p=5000000;
f=50;
dt=0.05;
omega=0;
base=g;
G=g/base;
M=(H*G)/(180*f);
Xs=0.4;
Xe=1;
pt=1;
delta=asin((pt*Xs)/(E*V));
delta_d=delta*180/pi;
dd=1;
tv=0:0.05:0.5;
figure
hold on
for k = 1:numel(tv)
t = tv(k);
pe_n=(E*V*sin(delta)/Xe);
pe=1-pe_n;
pa=pe/M;
if t==0
pa=pa/2;
else
pa=pa;
end
d_omega=pa*dt;
omega=omega+d_omega;
d_delta = omega*dt;
plot(t,delta_d, 'p');
xlabel('in seconds')
ylabel('in \delta(degree')
delta_d=d_delta+delta_d;
dd=dd+1;
end
hold off
Plotting individual points in the loop requires plotting with a marker.
.
  10 Comments
Sanjay N
Sanjay N on 23 Mar 2022
got it scalars have no direction and vector has direction
Star Strider
Star Strider on 23 Mar 2022
Not annoying at all!
Just short time intervals. I cannot immediately respond.

Sign in to comment.

More Answers (0)

Categories

Find more on Variables in Help Center and File Exchange

Products


Release

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!