0% found this document useful (0 votes)
13 views

On 'Timpul' 'x1, x2, X' 'Compunerea Ecuatiilor Necoerente Armonice' 'x1' 'x2' 'X'

The document defines three functions - mocanu2a, mocanu2b, and mocanu2c. Mocanu2a and mocanu2c calculate and plot the sum of two harmonic oscillations with different frequencies, while mocanu2b is referenced but not defined. The functions are demonstrated by calling them with time and phase shift parameters and plotting the resulting waveforms.

Uploaded by

Andrei Terzi
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

On 'Timpul' 'x1, x2, X' 'Compunerea Ecuatiilor Necoerente Armonice' 'x1' 'x2' 'X'

The document defines three functions - mocanu2a, mocanu2b, and mocanu2c. Mocanu2a and mocanu2c calculate and plot the sum of two harmonic oscillations with different frequencies, while mocanu2b is referenced but not defined. The functions are demonstrated by calling them with time and phase shift parameters and plotting the resulting waveforms.

Uploaded by

Andrei Terzi
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

function [x1,x2,x]=mocanu2a(t);

x1=2.8*sin(2.8*t+0);
x2=1.2*sin(2.0*t+1);
x=x1+x2;
figure(1)
plot(t,x1,t,x2,t,x)
grid on
xlabel ('Timpul')
ylabel ('x1,x2,x')
title ('compunerea ecuatiilor necoerente armonice')
legend('x1','x2','x')

>> t=0:0.005:2*pi;

>> mocanu2a(t);

>> t=0:0.005:2*pi;

>> mocanu2a(t);

function [x1,x2,x]=mocanu2b(t);
x1=2.8*sin(2.8*t+0);
x2=1.2*sin(2.8*t+1);
x=x1+x2;
figure(1)
plot(t,x1,t,x2,t,x)
grid on
xlabel ('Timpul')
ylabel ('x1,x2,x')
title ('compunerea ecuatiilor coerente armonice')
legend('x1','x2','x')
function [x1,x2,x]=mocanu2c(n,alpha);
t=0:0.005:2*pi;
x1=2.8*sin(2.8*t+0);
x2=1.2*sin(2.8*t+alpha);
x=x1+x2;
figure(1)
subplot(3,3,n)
plot(t,x1,t,x2,t,x)
grid on
xlabel('Timpul')
ylabel ('x1,x2,x')
title ('alpha=')

>> mocanu2c(4,pi/3);

>> mocanu2c(5,pi/2);

>> mocanu2c(6,2*pi/3);

>> mocanu2c(7,3*pi/4);

>> mocanu2c(8,5*pi/6);

>> mocanu2c(9,pi);

>> t=0:0.005:5*pi;

>> mocanu2a(t);

>> t=0:0.005:2*pi;
>> mocanu2a(t);

>> mocanu2a(t);

>> t=0:0.005:2*pi;

>> mocanu2a(t);

>> t=0:0.005:2*pi;

>> mocanu2b(t);

??? Undefined command/function 'mocanu2b'.

>> t=0:0.005:2*pi;

>> mocanu2b(t);

>> mocanu2c(1,0)

You might also like