Use ode45 to solve the following first-order problem. An RL circuit includes a v
ID: 3777850 • Letter: U
Question
Use ode45 to solve the following first-order problem. An RL circuit includes a voltage source, V_s, a resistor, R = 1.8 ohms, and an inductor, L = 0.4 H, as shown in the figure. The differential equation that describes the response of the circuit is L/R di_L/dt + i_L = V_s/R where i_L is the current in the inductor. Initially, at t = 0, i_L = 0. Determine the response of the circuit for the following voltage source: v_s = 10 sin(30 pi t) volts for t > 0 (the switch is closed at t = 0). The solution is the current in the inductor as a function of time. Find the solution and plot both vk and i_L versus time for 0Explanation / Answer
function [ Didt ] = lozieldiff4(t1,y)
syms y t
vs=-y+10*sin(30*pi*t);
vs(1)=0;
Didt=(1.8/.4).*((vs)/1.8)
end
mfile:
[t,y]=ode45(lozieldiff4,[0,.4],[0;0])
subplot(2,1,1);
plot(t,y,'r')
title('Graph')
xlabel('Time');
ylabel('Current');
subplot(2,1,2)
plot(t,vs);
xlabel('Time');
ylabel('Voltage');
xlabel('Time')
ylabel('I-Current')
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.