Need help to understand problem to solve it in matlab

azhar293

New member
Joined
Jun 12, 2017
Messages
3
(a)solve LdI/dt + RI(t) = 5cos(ωt) for the current I(t) in the circuit.
(b) one can define a complex impedance Z=R +iωL and formulate I(t) = Ie^iωt in which case, ZI=V and the forumula from part (A) becomes:
LDI/dt +RI(t) = (iωL+R) Ie^iωt = 5e^iωt
what is the magnitude |Z| and the phase angle theta in Z=|Z|e^iƟ ?
Untitled.png
 
(a)solve LdI/dt + RI(t) = 5cos(ωt) for the current I(t) in the circuit.
(b) one can define a complex impedance Z=R +iωL and formulate I(t) = Ie^iωt in which case, ZI=V and the forumula from part (A) becomes:
LDI/dt +RI(t) = (iωL+R) Ie^iωt = 5e^iωt
what is the magnitude |Z| and the phase angle theta in Z=|Z|e^iƟ ?
View attachment 8131

(a)solve LdI/dt + RI(t) = 5cos(ωt) for the current I(t) in the circuit.
(b) one can define a complex impedance Z=R +iωL and formulate I(t) = Ie^iωt in which case, ZI=V and the formula from part (A) becomes:
LDI/dt +RI(t) = (iωL+R) Ie^iωt = 5e^iωt
what is the magnitude |Z| and the phase angle theta in Z=|Z|e^iƟ ?

View attachment 8131

What are your thoughts?

Please share your work with us ...even if you know it is wrong.

If you are stuck at the beginning tell us and we'll start with the definitions.

You need to read the rules of this forum. Please read the post titled "Read before Posting" at the following URL:

http://www.freemathhelp.com/forum/announcement.php?f=33
 
Last edited by a moderator:
Here is what i did now want to make up matlbcoode

What are your thoughts?

Please share your work with us ...even if you know it is wrong.

If you are stuck at the beginning tell us and we'll start with the definitions.

You need to read the rules of this forum. Please read the post titled "Read before Posting" at the following URL:

http://www.freemathhelp.com/forum/announcement.php?f=33
(a)
L dI/dt + RI(t) = 5cos(ωt)
Divide the equation by L to produce
dI/dt – R/L*I = V/L. cos ωt
Assume that: a = -R/L and X = V/L
dI/dt – a*I = X* cos ωt
(b)
The complex impedance Z = R + iωL replaces R when L =/ 0 and I(t) = Ieiωt.
LDI/dt +RI(t) = (iωL+R) Ie^iωt = 5e^iωt
|Z| = √((R^2+ω^2 L^2)) and tan θ = ωL/R
............................................
it will be appreciated if you please check if this code is appropriate for the above question
CODE: by dsolve
solution = dsolve('DI=(5/L)*cos(w*t)- R*(I/L)')
% self assuming the values of resistance inductance and w to plot the data
V=5;
R=250;
L= 10
w=2*pi*50;
s = dsolve('DI=(5/10)*cos(2*pi*50*t)- 250*(I/10)')


ezplot(s,[0 100]); hold on;
xlabel('t (time)','FontSize',14); ylabel('I (ampare)','FontSize',14);
axis([0 5 0 100]); set(gcf,'color','w'); drawnow
Z = sqrt((R^2+w^2*L^2))
theta = atan(w*L/R)

CODE: by ode45
function ode_Q1
tini=0; tend = 8; tspan=tini:0.001:tend;
i0=[1];
opt = odeset('AbsTol',1e-8);
[t, i]=ode45(@fun,tspan,i0,opt);
figure('color','w');
plot(t,i,'LineWidth',1.5); hold on
xlabel('time, t','FontSize',14);
ylabel('I','FontSize',14);
figure('color','w');
end


function di = fun(t,i)
V=5;
R=250;
L=20;
w=2*pi*60;
di = zeros(length(i),1);


di = (V/L)*cos(w*t)-(R/L)*i;
end

waiting for kind response ...
 
Last edited by a moderator:
Here is what i did ,please check if Matlab code are correct according to question ?

L dI/dt + RI(t) = 5cos(ωt)
Divide the equation by L to produce
dI/dt – R/L*I = V/L. cos ωt
Assume that: a = -R/L and X = V/L
dI/dt – a*I = X* cos ωt
In this standard form, equation (3) gives the real solution: M cos ωt + N sin ωt
M = -aX/(ω2 + a2 ) and M = ωX/(ω2 + a2 )
The complex impedance Z = R + iωL replaces R when L =/ 0 and I(t) = Ieiωt.
LDI/dt +RI(t) = (iωL+R) Ie^iωt = 5e^iωt
|Z| = √((R^2+ω^2 L^2)) and tan θ = ωL/R
.........................................................................
code: dsolve
solution = dsolve('DI=(5/L)*cos(w*t)- R*(I/L)')
%assume the values of rsistance indutance and w to plot the data
V=5;
R=250;
L= 10
w=2*pi*50;
s = dsolve('DI=(5/10)*cos(2*pi*50*t)- 250*(I/10)')


ezplot(s,[0 100]); hold on;
xlabel('t (time)','FontSize',14); ylabel('I (ampare)','FontSize',14);
axis([0 5 0 100]); set(gcf,'color','w'); drawnow
Z = sqrt((R^2+w^2*L^2))
theta = atan(w*L/R)
............................
Code: ode45
function ode_Q1
tini=0; tend = 8; tspan=tini:0.001:tend;
i0=[1];
opt = odeset('AbsTol',1e-8);
[t, i]=ode45(@fun,tspan,i0,opt);
figure('color','w');
plot(t,i,'LineWidth',1.5); hold on
xlabel('time, t','FontSize',14);
ylabel('I','FontSize',14);
figure('color','w');
end


function di = fun(t,i)
V=5;
R=250;
L=20;
w=2*pi*60;
di = zeros(length(i),1);


di = (V/L)*cos(w*t)-(R/L)*i;
end
 
Top