Question
This is MathLab - C Programming Implement a function m-file named nonlinear_name.m that implements the system of two differential equations describing voltages v1 and v2
This is MathLab - C Programming
Implement a function m-file named nonlinear_name.m that implements the system of two differential equations describing voltages v1 and v2 in the nonlinear circuit example. Use the provided driver file nonlinear_solver.m to solve the system of differential equations and plot out the source voltage and voltages v1 and v2.
% % nonlinear_solver.m % % clear all close all
% Call the ODE stiff solver for tstart=0, tstop=300ns, I.C.s all zero [t, v] = ode15s(@nonlinear_circuit,[0 300e-9],[0;0],[]);
% Since the source voltage is defined within nonlinear_circuit.m, we need % to recreate it here so that we can plot it out. time = linspace(0,300e-9,300); source_freq = 10e6; % 10 MHz E = 2*sin(2*pi*source_freq*time);
subplot(311) plot(time*1e9,E) title('Nonlinear Circuit Simulation') ylabel('source voltage') subplot(312) plot(t*1e9,v(:,1)) ylabel('v(1)') subplot(313) plot(t*1e9,v(:,2)) ylabel('v(2)') xlabel('time [nanoseconds]')
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