This is very easy w=2*pi*f, where f - frequency I just set 50 Hz. You can set desired frequency. tn,tk - start time and end time step - step for tabulation So button onClickHandler for 5*sin(w*t) building looks like this procedure TForm1.Button1Click(Sender: TObject); var y,w,t,step,f,tn,tk:double; begin tn:=0; tk:=2; f:=50; step:=0.001; t:=tn; w:=2*pi*f; while(tk>t) do begin y:=5*Sin(w*t); t:=t+step; Chart1.Series[0].AddXY(t,y); end; end; I have result like this :) drive.google.com/file/d/1CAoY0lq6CA2Dya1ajh3cOPnizIeq-bt3/view?usp=share_link
@@АндрейБабаш-ю9п Thank you bro but I can’t solve this is the question. Plot these signs and their sums at 1ms intervals in the range of t=0-100ms S1=5sin(wt) f1=50Hz S2=2.5cos(wt) f2=100Hz
I have this variant for you, Bro :) procedure TForm1.Button1Click(Sender: TObject); var s1,s2,s,t,tn,tk,step,w1,w2,f1,f2:double; begin step:=0.0001; t:=tn; tk:=0.05; f1:=50; f2:=100; w1:=2*pi*f1; w2:=2*pi*f2; while(tk>t) do begin s1:=5*Sin(w1*t); s2:=2.5*Cos(w2*t); t:=t+step; s:=s1+s2; Chart1.Series[0].AddXY(t,s1); Chart1.Series[1].AddXY(t,s2); Chart1.Series[2].AddXY(t,s); end; end; drive.google.com/file/d/1gBq0uq0hqkFPt9J-8NXE_HW4xMrCOAOV/view?usp=share_link Source code: drive.google.com/file/d/1CIfm0F9QwhNyzU9BYDoxiki1DQSP2MFN/view?usp=sharing Is it what you want?
gracias, no sé ruso, pero encontré lo que necesitaba. XD
Очень интересно! Поставите Юле Солод 5-ку?
хааххаахах
How can I draw 5sin(wt) ?
This is very easy
w=2*pi*f, where f - frequency
I just set 50 Hz. You can set desired frequency.
tn,tk - start time and end time
step - step for tabulation
So button onClickHandler for 5*sin(w*t) building looks like this
procedure TForm1.Button1Click(Sender: TObject);
var y,w,t,step,f,tn,tk:double;
begin
tn:=0;
tk:=2;
f:=50;
step:=0.001;
t:=tn;
w:=2*pi*f;
while(tk>t) do
begin
y:=5*Sin(w*t);
t:=t+step;
Chart1.Series[0].AddXY(t,y);
end;
end;
I have result like this :)
drive.google.com/file/d/1CAoY0lq6CA2Dya1ajh3cOPnizIeq-bt3/view?usp=share_link
@@АндрейБабаш-ю9п Thank you bro but I can’t solve this is the question.
Plot these signs and their sums at 1ms intervals in the range of t=0-100ms
S1=5sin(wt) f1=50Hz
S2=2.5cos(wt) f2=100Hz
@@merttunnall Just w1=2*pi*f1 and w2=2*pi*f2. Step will be 1 ms. S1=5*sin(w1*t), S2=2.5*cos(w2*t)
I have this variant for you, Bro :)
procedure TForm1.Button1Click(Sender: TObject);
var s1,s2,s,t,tn,tk,step,w1,w2,f1,f2:double;
begin
step:=0.0001;
t:=tn;
tk:=0.05;
f1:=50;
f2:=100;
w1:=2*pi*f1;
w2:=2*pi*f2;
while(tk>t) do
begin
s1:=5*Sin(w1*t);
s2:=2.5*Cos(w2*t);
t:=t+step;
s:=s1+s2;
Chart1.Series[0].AddXY(t,s1);
Chart1.Series[1].AddXY(t,s2);
Chart1.Series[2].AddXY(t,s);
end;
end;
drive.google.com/file/d/1gBq0uq0hqkFPt9J-8NXE_HW4xMrCOAOV/view?usp=share_link
Source code:
drive.google.com/file/d/1CIfm0F9QwhNyzU9BYDoxiki1DQSP2MFN/view?usp=sharing
Is it what you want?
@@АндрейБабаш-ю9п Yes Bro Thanks a lot. It’s really helped me. :) I will follow your channel.