Hello All,
I am new on this forum.
I am trying to solve the following first order ODE:
dy/dt=(w*i-const_G)*y + 2*exp(w*t*i)
Analitacly, the result should have a form Y*exp(w*t*i). When I put it in to the equation I am getting:
Y*exp(w*t*i)*w*i=(w*i-const_G)*Y*exp(w*t*i) + 2*exp(w*t*i)
Now deviding with exp(w*t*i), I am getting:
Y*w*i=(w*i-const_G)*Y + 2
Now Y is:
Y=2/const_G
The solution is y(t)=2/const_G * exp(w*t*i). Which meens that the amplitude is reduced by const_G, the frequency is the same.
Using MATLAB to solve this equation and to get a graph, I have become confused.
This is the function in MATLAB:
------------------------------------------------------------------------------------
function result = mode_decay(inputs)
time=inputs(1);
frequency = inputs(2);
const_G=inputs(3);
y_re=inputs(4);
y_im=inputs(5);
y=y_re+y_im*1i;
input = 2*exp(2*pi*frequency*time*1i);
dydt=(2*pi*frequency*1i-const_G)*y + input;
result = [input; dydt];
end
------------------------------------------------------------------------------------
On the image you can see the simulation and resulting graph.
I am confised, how am I getting this amplitude rising graph. From where it comes.
Any advice will be very helpful for me.
Thanks in advance
I am new on this forum.
I am trying to solve the following first order ODE:
dy/dt=(w*i-const_G)*y + 2*exp(w*t*i)
Analitacly, the result should have a form Y*exp(w*t*i). When I put it in to the equation I am getting:
Y*exp(w*t*i)*w*i=(w*i-const_G)*Y*exp(w*t*i) + 2*exp(w*t*i)
Now deviding with exp(w*t*i), I am getting:
Y*w*i=(w*i-const_G)*Y + 2
Now Y is:
Y=2/const_G
The solution is y(t)=2/const_G * exp(w*t*i). Which meens that the amplitude is reduced by const_G, the frequency is the same.
Using MATLAB to solve this equation and to get a graph, I have become confused.
This is the function in MATLAB:
------------------------------------------------------------------------------------
function result = mode_decay(inputs)
time=inputs(1);
frequency = inputs(2);
const_G=inputs(3);
y_re=inputs(4);
y_im=inputs(5);
y=y_re+y_im*1i;
input = 2*exp(2*pi*frequency*time*1i);
dydt=(2*pi*frequency*1i-const_G)*y + input;
result = [input; dydt];
end
------------------------------------------------------------------------------------
On the image you can see the simulation and resulting graph.
I am confised, how am I getting this amplitude rising graph. From where it comes.
Any advice will be very helpful for me.
Thanks in advance