Question
An inductor L = 15 H and a resistor R = 1000 are connected in series with an AC power source providing voltage of V
An inductor L = 15 H and a resistor R = 1000 are connected in series with an AC power source providing voltage of V = 10sin(2 f t) V, where f = 100 kHz, as shown in the figure on the next page. The current I in the cicuit is determined from the solution of the equation: dI/dt = 10sin(2 f t)/L R/L*I. Solve the equation and plot the current as a function of time for 0 t 104 s with I(0) = 0. Solve the problem using your 4th Order Runge-Kutta Function. Use a time step of 1 109 s. (Note that the ODE depends on the current and time and be careful with units in the sin function.)
This problem performed in Matlab. Thank you so much.
Four order funge-kutta function below
function [t,y] = rk4(dydt,tmin,tmax,y0,h)
% calc number of times to go through loop
N=(tmax-tmin)/h;
%
% %initialize arrays for time and y values
y(1) = y0;
t(1)=tmin;
% %for loop to fill rest of y and t arrays
for i=1:N;
%calc ks%
k1 = dydt(t(i),y(i));
k2 = dydt(t(i)+.5*h,y(i)+.5*h*k1);
k3 = dydt(t(i)+.5*h,y(i)+.5*h*k2);
k4 =dydt(t(i)+h,y(i)+h*k3);
%
%update t and y arrays
t(i+1)= t(i)+h;
y(i+1)= y(i)+h*k2;
end
end
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started