精华内容
下载资源
问答
  • 使用 fprintf 以表格的形式给出 RLC 电路的仿真和不同的电流图
  • MatLab RLC 模拟器 MatLab 中的 RLC 电路模拟器 制作图形用户界面 这是显示如何制作 GUI 的视频,以防 .fig 文件与您的 MatLab 无法正常工作 演示 这是显示如何在 MatLab 中使用模拟器的视频
  • 哟偶那个matlab分析的 RLC电路
  • 通过 RLC 电路的电流值。
  • RLC 电路状态空间模型和使用 ODE45 求解。 阅读帮助文件。
  • RLC电路matlab仿真m文件

    2014-06-14 15:18:41
    RLC电路matlab仿真的M文件,用三种不同的方法仿真RLC电路,是一个系统仿真的简单实例
  • MATLAB求解一阶RC电路和二阶RLC电路理论知识:交互界面介绍一阶RC全相应Multisim仿真:仿真结果为:二阶RLC电路Multisim仿真:仿真结果为:实现代码: 理论知识: 一阶RC电路全相应:根据节点电压法求出戴维宁等效...

    理论知识:

    一阶RC电路全相应:根据节点电压法求出戴维宁等效电路,列写微分方程求得Uc与t之间的关系,并绘图。
    二阶RLC电路: 根据节点电压法求出戴维宁等效电路,列写微分方程求得Uc,UL和t之间的关系,并绘图。

    交互界面介绍

    一阶RC全相应

    Multisim仿真:

    我们先用仿真软件Multisim绘制出待测电路图以及Uc-t曲线:
    左边是电路图,右边是仿真得出的曲线
    易得 t = 5s 时,Uc = 6.541V

    仿真结果为:

    在这里插入图片描述
    易得 t = 5s 时,Uc = 6.541V

    二阶RLC电路

    Multisim仿真:

    在这里插入图片描述
    易得 t = 5s 时,Uc = 8.707VUL = 0.3712V

    仿真结果为:

    在这里插入图片描述
    易得 t = 5s 时,Uc = 9.078VUL = 0.3711V

    实现代码:

    classdef dianlu2 < matlab.apps.AppBase
    
        % Properties that correspond to app components
        properties (Access = public)
            UIFigure           matlab.ui.Figure
            TabGroup           matlab.ui.container.TabGroup
            Tab                matlab.ui.container.Tab
            Label              matlab.ui.control.Label
            EditField          matlab.ui.control.NumericEditField
            EditField_2Label   matlab.ui.control.Label
            EditField_2        matlab.ui.control.NumericEditField
            Label_2            matlab.ui.control.Label
            EditField_3        matlab.ui.control.NumericEditField
            CaculateButton     matlab.ui.control.StateButton
            UIAxes             matlab.ui.control.UIAxes
            Label_3            matlab.ui.control.Label
            EditField_4        matlab.ui.control.NumericEditField
            Label_4            matlab.ui.control.Label
            EditField_5        matlab.ui.control.NumericEditField
            Label_5            matlab.ui.control.Label
            EditField_6        matlab.ui.control.NumericEditField
            Label_6            matlab.ui.control.Label
            EditField_7        matlab.ui.control.NumericEditField
            Tab_2              matlab.ui.container.Tab
            CaculateButton_2   matlab.ui.control.StateButton
            UIAxes_2           matlab.ui.control.UIAxes
            EditField_8Label   matlab.ui.control.Label
            EditField_8        matlab.ui.control.NumericEditField
            Label_7            matlab.ui.control.Label
            EditField_9        matlab.ui.control.NumericEditField
            EditField_10Label  matlab.ui.control.Label
            EditField_10       matlab.ui.control.NumericEditField
            EditField_11Label  matlab.ui.control.Label
            EditField_11       matlab.ui.control.NumericEditField
            EditField_12Label  matlab.ui.control.Label
            EditField_12       matlab.ui.control.NumericEditField
            EditField_13Label  matlab.ui.control.Label
            EditField_13       matlab.ui.control.NumericEditField
            Label_8            matlab.ui.control.Label
            EditField_14       matlab.ui.control.NumericEditField
            RLCTab             matlab.ui.container.Tab
            CaculateButton_3   matlab.ui.control.StateButton
            UIAxes_3           matlab.ui.control.UIAxes
            EditField_15Label  matlab.ui.control.Label
            EditField_15       matlab.ui.control.NumericEditField
            EditField_16Label  matlab.ui.control.Label
            EditField_16       matlab.ui.control.NumericEditField
            Label_12           matlab.ui.control.Label
            EditField_17       matlab.ui.control.NumericEditField
            EditField_18Label  matlab.ui.control.Label
            EditField_18       matlab.ui.control.NumericEditField
            Label_9            matlab.ui.control.Label
            EditField_19       matlab.ui.control.NumericEditField
            Label_10           matlab.ui.control.Label
            EditField_20       matlab.ui.control.NumericEditField
            Label_11           matlab.ui.control.Label
            EditField_21       matlab.ui.control.NumericEditField
            Label_13           matlab.ui.control.Label
            EditField_22       matlab.ui.control.NumericEditField
            EditField_23Label  matlab.ui.control.Label
            EditField_23       matlab.ui.control.NumericEditField
            GLCTab             matlab.ui.container.Tab
            CaculateButton_4   matlab.ui.control.StateButton
            UIAxes_4           matlab.ui.control.UIAxes
            EditField_24Label  matlab.ui.control.Label
            EditField_24       matlab.ui.control.NumericEditField
            EditField_25Label  matlab.ui.control.Label
            EditField_25       matlab.ui.control.NumericEditField
            EditField_26Label  matlab.ui.control.Label
            EditField_26       matlab.ui.control.NumericEditField
            Label_14           matlab.ui.control.Label
            EditField_27       matlab.ui.control.NumericEditField
            EditField_28Label  matlab.ui.control.Label
            EditField_28       matlab.ui.control.NumericEditField
            Label_15           matlab.ui.control.Label
            EditField_29       matlab.ui.control.NumericEditField
            Label_16           matlab.ui.control.Label
            EditField_30       matlab.ui.control.NumericEditField
            EditField_31Label  matlab.ui.control.Label
            EditField_31       matlab.ui.control.NumericEditField
            EditField_32Label  matlab.ui.control.Label
            EditField_32       matlab.ui.control.NumericEditField
        end
    
        % Callbacks that handle component events
        methods (Access = private)
    
            % Value changed function: CaculateButton
            function CaculateButtonValueChanged(app, event)
              
                x=(0:0.1:100);
                R=app.EditField.Value;
                C=app.EditField_2.Value;
                U0=app.EditField_3.Value;
                T=R*C;
                U1=app.EditField_4.Value;
                app.EditField_5.Value=T;
                time=app.EditField_6.Value;
                app.EditField_7.Value=U1+(U0-U1)*exp(-time/T);
                y=U1+(U0-U1)*exp(-x/T);
                plot(app.UIAxes,x,y);
            end
    
            % Value changed function: CaculateButton_2
            function CaculateButton_2ValueChanged(app, event)
                
                x=(0:0.1:100);
                R=app.EditField_8.Value;
                L=app.EditField_9.Value;
                I0=app.EditField_10.Value;
                T=L/R;
                U1=app.EditField_11.Value;
                app.EditField_12.Value=T;
                time=app.EditField_13.Value;
                %app.EditField_14.Value=abs(U1-(U1+(U0-U1)*exp(-time/T))*R);
                %y=U1+(U0-U1)*exp(-x/T);
                syms t
                i = dsolve('L*Di + i*R = U1,i(0) = I0','t');
                ul1=zeros(1,1001);
                ul= L*diff(i,t);
                h = 1;
                for t=0:0.1:100
                    ul1(h)=eval(ul);
                    h=h+1;
                end
                t = time;
                app.EditField_14.Value=abs(eval(ul));
                plot(app.UIAxes_2,x,ul1);
                
    
            end
    
            % Value changed function: CaculateButton_3
            function CaculateButton_3ValueChanged(app, event)
               
                r=app.EditField_15.Value;
                c=app.EditField_16.Value;
                l=app.EditField_17.Value;
                us=app.EditField_18.Value;
                time=app.EditField_19.Value;
                u0=app.EditField_22.Value;
                i0=app.EditField_23.Value;
                syms uc t 
                uc = dsolve('u+r*c*Du+l*c*D2u=us','u(0) =u0','Du(0) = i0/c','t');
                i = c*diff(uc,t);
                ul= l*diff(i,t);
                uc1=zeros(1,1001);
                ul1=zeros(1,1001);
                i1=zeros(1,1001);
                h=1;
                for t=0:0.1:100
                    uc1(h)=eval(uc);
                    ul1(h)=eval(ul);
                    i1(h)=eval(i);
                    h=h+1;
                end
                t=0:0.1:100;
                plot(app.UIAxes_3,t,uc1,'r-',t,ul1,'b',t,i1,'g-.');
                
                t=app.EditField_19.Value;
                app.EditField_20.Value=eval(uc);
                app.EditField_21.Value=eval(ul);
            end
    
            % Value changed function: CaculateButton_4
            function CaculateButton_4ValueChanged(app, event)
    
                r=app.EditField_24.Value;
                c=app.EditField_25.Value;
                l=app.EditField_26.Value;
                is=app.EditField_27.Value;
                time=app.EditField_28.Value;
                u0=app.EditField_31.Value;
                i0=app.EditField_32.Value;
                g=1/r;
                syms il t
                il = dsolve('i + l*c*D2i + Di*l*g = is','i(0) = i0,Di(0) = u0/l','t');
                u= l*diff(il,t);
                ic= c*diff(u,t);
                il1=zeros(1,1001);
                u1=zeros(1,1001);
                ic1=zeros(1,1001);
                h=1;
                for t=0:0.1:100
                    il1(h)=eval(il);
                    u1(h)=eval(u);
                    ic1(h)=eval(ic);
                    h=h+1;
                end
                t=0:0.1:100;
                plot(app.UIAxes_4,t,il1,'r-',t,ic1,'b',t,u1,'g-.');
                
                t=time;
                app.EditField_29.Value=eval(il);
                app.EditField_30.Value=eval(ic);
            end
        end
    
        % Component initialization
        methods (Access = private)
    
            % Create UIFigure and components
            function createComponents(app)
    
                % Create UIFigure and hide until all components are created
                app.UIFigure = uifigure('Visible', 'off');
                app.UIFigure.Position = [100 100 698 579];
                app.UIFigure.Name = 'MATLAB App';
    
                % Create TabGroup
                app.TabGroup = uitabgroup(app.UIFigure);
                app.TabGroup.Position = [1 4 700 576];
    
                % Create Tab
                app.Tab = uitab(app.TabGroup);
                app.Tab.Title = '电容';
    
                % Create Label
                app.Label = uilabel(app.Tab);
                app.Label.HorizontalAlignment = 'right';
                app.Label.Position = [65 53 37 22];
                app.Label.Text = '电阻';
    
                % Create EditField
                app.EditField = uieditfield(app.Tab, 'numeric');
                app.EditField.Position = [34 87 100 22];
    
                % Create EditField_2Label
                app.EditField_2Label = uilabel(app.Tab);
                app.EditField_2Label.HorizontalAlignment = 'right';
                app.EditField_2Label.Position = [168 53 29 22];
                app.EditField_2Label.Text = '电容';
    
                % Create EditField_2
                app.EditField_2 = uieditfield(app.Tab, 'numeric');
                app.EditField_2.Position = [133 87 100 22];
    
                % Create Label_2
                app.Label_2 = uilabel(app.Tab);
                app.Label_2.HorizontalAlignment = 'right';
                app.Label_2.Position = [261 53 41 22];
                app.Label_2.Text = '初始值';
    
                % Create EditField_3
                app.EditField_3 = uieditfield(app.Tab, 'numeric');
                app.EditField_3.Position = [232 87 100 22];
    
                % Create CaculateButton
                app.CaculateButton = uibutton(app.Tab, 'state');
                app.CaculateButton.ValueChangedFcn = createCallbackFcn(app, @CaculateButtonValueChanged, true);
                app.CaculateButton.Text = 'Caculate';
                app.CaculateButton.Position = [254 10 100 22];
    
                % Create UIAxes
                app.UIAxes = uiaxes(app.Tab);
                title(app.UIAxes, '电容电压')
                xlabel(app.UIAxes, '时间/s')
                ylabel(app.UIAxes, '电压/V')
                app.UIAxes.TitleFontWeight = 'bold';
                app.UIAxes.Position = [34 160 628 379];
    
                % Create Label_3
                app.Label_3 = uilabel(app.Tab);
                app.Label_3.HorizontalAlignment = 'right';
                app.Label_3.Position = [360 53 41 22];
                app.Label_3.Text = '电压源';
    
                % Create EditField_4
                app.EditField_4 = uieditfield(app.Tab, 'numeric');
                app.EditField_4.Position = [331 87 100 22];
    
                % Create Label_4
                app.Label_4 = uilabel(app.Tab);
                app.Label_4.HorizontalAlignment = 'right';
                app.Label_4.Position = [482 120 53 22];
                app.Label_4.Text = '时间常数';
    
                % Create EditField_5
                app.EditField_5 = uieditfield(app.Tab, 'numeric');
                app.EditField_5.Position = [550 120 100 22];
    
                % Create Label_5
                app.Label_5 = uilabel(app.Tab);
                app.Label_5.HorizontalAlignment = 'right';
                app.Label_5.Position = [506 74 29 22];
                app.Label_5.Text = '时间';
    
                % Create EditField_6
                app.EditField_6 = uieditfield(app.Tab, 'numeric');
                app.EditField_6.Position = [550 74 100 22];
    
                % Create Label_6
                app.Label_6 = uilabel(app.Tab);
                app.Label_6.HorizontalAlignment = 'right';
                app.Label_6.Position = [494 32 41 22];
                app.Label_6.Text = '电压值';
    
                % Create EditField_7
                app.EditField_7 = uieditfield(app.Tab, 'numeric');
                app.EditField_7.Position = [550 32 100 22];
    
                % Create Tab_2
                app.Tab_2 = uitab(app.TabGroup);
                app.Tab_2.Title = '电感';
    
                % Create CaculateButton_2
                app.CaculateButton_2 = uibutton(app.Tab_2, 'state');
                app.CaculateButton_2.ValueChangedFcn = createCallbackFcn(app, @CaculateButton_2ValueChanged, true);
                app.CaculateButton_2.Text = 'Caculate';
                app.CaculateButton_2.Position = [254 10 100 22];
    
                % Create UIAxes_2
                app.UIAxes_2 = uiaxes(app.Tab_2);
                title(app.UIAxes_2, '电感电压')
                xlabel(app.UIAxes_2, '时间/s')
                ylabel(app.UIAxes_2, '电压/V')
                app.UIAxes_2.TitleFontWeight = 'bold';
                app.UIAxes_2.Position = [34 160 628 379];
    
                % Create EditField_8Label
                app.EditField_8Label = uilabel(app.Tab_2);
                app.EditField_8Label.HorizontalAlignment = 'right';
                app.EditField_8Label.Position = [65 53 37 22];
                app.EditField_8Label.Text = '电阻';
    
                % Create EditField_8
                app.EditField_8 = uieditfield(app.Tab_2, 'numeric');
                app.EditField_8.Position = [34 87 100 22];
    
                % Create Label_7
                app.Label_7 = uilabel(app.Tab_2);
                app.Label_7.HorizontalAlignment = 'right';
                app.Label_7.Position = [168 53 29 22];
                app.Label_7.Text = '电感';
    
                % Create EditField_9
                app.EditField_9 = uieditfield(app.Tab_2, 'numeric');
                app.EditField_9.Position = [133 87 100 22];
    
                % Create EditField_10Label
                app.EditField_10Label = uilabel(app.Tab_2);
                app.EditField_10Label.HorizontalAlignment = 'right';
                app.EditField_10Label.Position = [261 53 41 22];
                app.EditField_10Label.Text = '初始值';
    
                % Create EditField_10
                app.EditField_10 = uieditfield(app.Tab_2, 'numeric');
                app.EditField_10.Position = [232 87 100 22];
    
                % Create EditField_11Label
                app.EditField_11Label = uilabel(app.Tab_2);
                app.EditField_11Label.HorizontalAlignment = 'right';
                app.EditField_11Label.Position = [360 53 41 22];
                app.EditField_11Label.Text = '电压源';
    
                % Create EditField_11
                app.EditField_11 = uieditfield(app.Tab_2, 'numeric');
                app.EditField_11.Position = [331 87 100 22];
    
                % Create EditField_12Label
                app.EditField_12Label = uilabel(app.Tab_2);
                app.EditField_12Label.HorizontalAlignment = 'right';
                app.EditField_12Label.Position = [482 120 53 22];
                app.EditField_12Label.Text = '时间常数';
    
                % Create EditField_12
                app.EditField_12 = uieditfield(app.Tab_2, 'numeric');
                app.EditField_12.Position = [550 120 100 22];
    
                % Create EditField_13Label
                app.EditField_13Label = uilabel(app.Tab_2);
                app.EditField_13Label.HorizontalAlignment = 'right';
                app.EditField_13Label.Position = [506 74 29 22];
                app.EditField_13Label.Text = '时间';
    
                % Create EditField_13
                app.EditField_13 = uieditfield(app.Tab_2, 'numeric');
                app.EditField_13.Position = [550 74 100 22];
    
                % Create Label_8
                app.Label_8 = uilabel(app.Tab_2);
                app.Label_8.HorizontalAlignment = 'right';
                app.Label_8.Position = [494 32 41 22];
                app.Label_8.Text = '电压值';
    
                % Create EditField_14
                app.EditField_14 = uieditfield(app.Tab_2, 'numeric');
                app.EditField_14.Position = [550 32 100 22];
    
                % Create RLCTab
                app.RLCTab = uitab(app.TabGroup);
                app.RLCTab.Title = '二阶RLC';
    
                % Create CaculateButton_3
                app.CaculateButton_3 = uibutton(app.RLCTab, 'state');
                app.CaculateButton_3.ValueChangedFcn = createCallbackFcn(app, @CaculateButton_3ValueChanged, true);
                app.CaculateButton_3.Text = 'Caculate';
                app.CaculateButton_3.Position = [254 10 100 22];
    
                % Create UIAxes_3
                app.UIAxes_3 = uiaxes(app.RLCTab);
                title(app.UIAxes_3, '')
                xlabel(app.UIAxes_3, '时间/s')
                ylabel(app.UIAxes_3, '电压/V')
                app.UIAxes_3.TitleFontWeight = 'bold';
                app.UIAxes_3.Position = [34 160 628 379];
    
                % Create EditField_15Label
                app.EditField_15Label = uilabel(app.RLCTab);
                app.EditField_15Label.HorizontalAlignment = 'right';
                app.EditField_15Label.Position = [65 53 37 22];
                app.EditField_15Label.Text = '电阻';
    
                % Create EditField_15
                app.EditField_15 = uieditfield(app.RLCTab, 'numeric');
                app.EditField_15.Position = [34 87 100 22];
    
                % Create EditField_16Label
                app.EditField_16Label = uilabel(app.RLCTab);
                app.EditField_16Label.HorizontalAlignment = 'right';
                app.EditField_16Label.Position = [168 53 29 22];
                app.EditField_16Label.Text = '电容';
    
                % Create EditField_16
                app.EditField_16 = uieditfield(app.RLCTab, 'numeric');
                app.EditField_16.Position = [133 87 100 22];
    
                % Create Label_12
                app.Label_12 = uilabel(app.RLCTab);
                app.Label_12.HorizontalAlignment = 'right';
                app.Label_12.Position = [273 53 29 22];
                app.Label_12.Text = '电感';
    
                % Create EditField_17
                app.EditField_17 = uieditfield(app.RLCTab, 'numeric');
                app.EditField_17.Position = [232 87 100 22];
    
                % Create EditField_18Label
                app.EditField_18Label = uilabel(app.RLCTab);
                app.EditField_18Label.HorizontalAlignment = 'right';
                app.EditField_18Label.Position = [360 53 41 22];
                app.EditField_18Label.Text = '电压源';
    
                % Create EditField_18
                app.EditField_18 = uieditfield(app.RLCTab, 'numeric');
                app.EditField_18.Position = [331 87 100 22];
    
                % Create Label_9
                app.Label_9 = uilabel(app.RLCTab);
                app.Label_9.HorizontalAlignment = 'right';
                app.Label_9.Position = [506 120 29 22];
                app.Label_9.Text = '时间';
    
                % Create EditField_19
                app.EditField_19 = uieditfield(app.RLCTab, 'numeric');
                app.EditField_19.Position = [550 120 100 22];
    
                % Create Label_10
                app.Label_10 = uilabel(app.RLCTab);
                app.Label_10.HorizontalAlignment = 'right';
                app.Label_10.Position = [482 74 53 22];
                app.Label_10.Text = '电容电压';
    
                % Create EditField_20
                app.EditField_20 = uieditfield(app.RLCTab, 'numeric');
                app.EditField_20.Position = [550 74 100 22];
    
                % Create Label_11
                app.Label_11 = uilabel(app.RLCTab);
                app.Label_11.HorizontalAlignment = 'right';
                app.Label_11.Position = [482 32 53 22];
                app.Label_11.Text = '电感电压';
    
                % Create EditField_21
                app.EditField_21 = uieditfield(app.RLCTab, 'numeric');
                app.EditField_21.Position = [550 32 100 22];
    
                % Create Label_13
                app.Label_13 = uilabel(app.RLCTab);
                app.Label_13.HorizontalAlignment = 'right';
                app.Label_13.Position = [138 149 89 22];
                app.Label_13.Text = '电容电压初始值';
    
                % Create EditField_22
                app.EditField_22 = uieditfield(app.RLCTab, 'numeric');
                app.EditField_22.Position = [133 120 100 22];
    
                % Create EditField_23Label
                app.EditField_23Label = uilabel(app.RLCTab);
                app.EditField_23Label.HorizontalAlignment = 'right';
                app.EditField_23Label.Position = [237 149 89 22];
                app.EditField_23Label.Text = '电感电流初始值';
    
                % Create EditField_23
                app.EditField_23 = uieditfield(app.RLCTab, 'numeric');
                app.EditField_23.Position = [232 120 100 22];
    
                % Create GLCTab
                app.GLCTab = uitab(app.TabGroup);
                app.GLCTab.Title = '二阶GLC';
    
                % Create CaculateButton_4
                app.CaculateButton_4 = uibutton(app.GLCTab, 'state');
                app.CaculateButton_4.ValueChangedFcn = createCallbackFcn(app, @CaculateButton_4ValueChanged, true);
                app.CaculateButton_4.Text = 'Caculate';
                app.CaculateButton_4.Position = [254 10 100 22];
    
                % Create UIAxes_4
                app.UIAxes_4 = uiaxes(app.GLCTab);
                title(app.UIAxes_4, '')
                xlabel(app.UIAxes_4, '时间/s')
                ylabel(app.UIAxes_4, '电流/I')
                app.UIAxes_4.TitleFontWeight = 'bold';
                app.UIAxes_4.Position = [34 160 628 379];
    
                % Create EditField_24Label
                app.EditField_24Label = uilabel(app.GLCTab);
                app.EditField_24Label.HorizontalAlignment = 'right';
                app.EditField_24Label.Position = [65 53 37 22];
                app.EditField_24Label.Text = '电阻';
    
                % Create EditField_24
                app.EditField_24 = uieditfield(app.GLCTab, 'numeric');
                app.EditField_24.Position = [34 87 100 22];
    
                % Create EditField_25Label
                app.EditField_25Label = uilabel(app.GLCTab);
                app.EditField_25Label.HorizontalAlignment = 'right';
                app.EditField_25Label.Position = [168 53 29 22];
                app.EditField_25Label.Text = '电容';
    
                % Create EditField_25
                app.EditField_25 = uieditfield(app.GLCTab, 'numeric');
                app.EditField_25.Position = [133 87 100 22];
    
                % Create EditField_26Label
                app.EditField_26Label = uilabel(app.GLCTab);
                app.EditField_26Label.HorizontalAlignment = 'right';
                app.EditField_26Label.Position = [273 53 29 22];
                app.EditField_26Label.Text = '电感';
    
                % Create EditField_26
                app.EditField_26 = uieditfield(app.GLCTab, 'numeric');
                app.EditField_26.Position = [232 87 100 22];
    
                % Create Label_14
                app.Label_14 = uilabel(app.GLCTab);
                app.Label_14.HorizontalAlignment = 'right';
                app.Label_14.Position = [360 53 41 22];
                app.Label_14.Text = '电流源';
    
                % Create EditField_27
                app.EditField_27 = uieditfield(app.GLCTab, 'numeric');
                app.EditField_27.Position = [331 87 100 22];
    
                % Create EditField_28Label
                app.EditField_28Label = uilabel(app.GLCTab);
                app.EditField_28Label.HorizontalAlignment = 'right';
                app.EditField_28Label.Position = [506 120 29 22];
                app.EditField_28Label.Text = '时间';
    
                % Create EditField_28
                app.EditField_28 = uieditfield(app.GLCTab, 'numeric');
                app.EditField_28.Position = [550 120 100 22];
    
                % Create Label_15
                app.Label_15 = uilabel(app.GLCTab);
                app.Label_15.HorizontalAlignment = 'right';
                app.Label_15.Position = [482 74 53 22];
                app.Label_15.Text = '电容电流';
    
                % Create EditField_29
                app.EditField_29 = uieditfield(app.GLCTab, 'numeric');
                app.EditField_29.Position = [550 74 100 22];
    
                % Create Label_16
                app.Label_16 = uilabel(app.GLCTab);
                app.Label_16.HorizontalAlignment = 'right';
                app.Label_16.Position = [482 32 53 22];
                app.Label_16.Text = '电感电流';
    
                % Create EditField_30
                app.EditField_30 = uieditfield(app.GLCTab, 'numeric');
                app.EditField_30.Position = [550 32 100 22];
    
                % Create EditField_31Label
                app.EditField_31Label = uilabel(app.GLCTab);
                app.EditField_31Label.HorizontalAlignment = 'right';
                app.EditField_31Label.Position = [138 149 89 22];
                app.EditField_31Label.Text = '电容电压初始值';
    
                % Create EditField_31
                app.EditField_31 = uieditfield(app.GLCTab, 'numeric');
                app.EditField_31.Position = [133 120 100 22];
    
                % Create EditField_32Label
                app.EditField_32Label = uilabel(app.GLCTab);
                app.EditField_32Label.HorizontalAlignment = 'right';
                app.EditField_32Label.Position = [237 149 89 22];
                app.EditField_32Label.Text = '电感电流初始值';
    
                % Create EditField_32
                app.EditField_32 = uieditfield(app.GLCTab, 'numeric');
                app.EditField_32.Position = [232 120 100 22];
    
                % Show the figure after all components are created
                app.UIFigure.Visible = 'on';
            end
        end
    
        % App creation and deletion
        methods (Access = public)
    
            % Construct app
            function app = dianlu2
    
                % Create UIFigure and components
                createComponents(app)
    
                % Register the app with App Designer
                registerApp(app, app.UIFigure)
    
                if nargout == 0
                    clear app
                end
            end
    
            % Code that executes before app deletion
            function delete(app)
    
                % Delete UIFigure when app is deleted
                delete(app.UIFigure)
            end
        end
    end
    
    展开全文
  • 此条目包含用于并行和串联 RLC 电路的自然和阶跃响应的图形用户界面程序。 要运行该程序,请在 MATLAB 提示符下键入>> rlc响应 其他资源如下: 实时控制系统实验室手册 - http://saadat.us/ee371lab.htm 数字控制...
  • 在这个模拟中只需输入电阻电容和电感的值,模拟就会给你所有的参数1. 电阻电流2. 容性电流3.感应电流4. 无功功率5.真正的力量6. 视在功率7....根据 Simulink 的要求,电容器支路加上一个非常低的电阻值,并加上一个恒定...
  • 示例文件: RLC_symbolic.m:使用符号数学建模和分析电路RLC_nonlinear.m:使用数值数学对电路进行建模和分析RLC_nonlinear.pdf:使用 MATLAB 的发布功能生成的文档RLC_simulink.slx:使用图形建模对电路进行建模和...
  • 这是使用 MATLAB R2010a 模拟的基本串联 rlc 电路
  • Parallel RLC circuitIn this simulation just enter the value of resistor capacitor and inductor and simulation gives u all the parameters1. resistive current2. capacitive current3. inductive current4. ...

    Parallel RLC circuit

    In this simulation just enter the value of resistor capacitor and inductor and simulation gives u all the parameters

    1. resistive current

    2. capacitive current

    3. inductive current

    4. reactive power

    5. true power

    6. apparent power

    7. Power Factor

    According to the requirement of Simulink the capacitor branch is added up with a very low value of resistance and a constant value is added up with apparent power so that at any time its value cannot be zero.

    展开全文
  • 通过观察显示波形的 R、L 和 C 上的电流和电压变化来研究 RLC 电路 - AC。 R = 100 欧姆; L = 1mH; 和 C = 0.01 法拉。 施加的交流正弦输入的峰值幅度为 100 伏,频率 = 1 Hz
  • 利用Matlab分析交流电路摘要:探讨利用Matlab软件辅助分析交流电路的方法。以Matlab 软件为辅助工具,具体分析了动态电路、正弦稳态电路及非正弦交流电路。结果表明,利用Matlab软件辅助分析交流电路问题,逻辑清晰...

    利用Matlab分析交流电路

    摘要:探讨利用Matlab软件辅助分析交流电路的方法。以Matlab 软件为辅助工具,具体分析了动态电路、正弦稳态电路及非正弦交流电路。结果表明,利用Matlab软件辅助分析交流电路问题,逻辑清晰、程序简短、结果精确。因此,Matlab软件是分析和研究电路的有效工具。

    关键词:动态电路;正弦稳态电路;非正弦交流电路;Matlab

    0 引言

    Matlab软件是实现科学计算、符号运算和图形处理的高效工具,是教学和科研的得力助手。比如,其在电路分析及计算机仿真等方面的应用,目前仍然是人们研究的热点。交流电路是生产设备的重要组成部分,其结构复杂,分析和计算过程烦琐而费时,引入Matlab软

    83d1a8880e1198c105962f99d210c2d3.png

    件进行辅助分析和研究是化解这一难题的有效手段。

    本文通过实例,探讨利用Matlab软件辅助分析动态电路、正弦稳态电路及非正弦交流电路的方法。

    659db70d1ee17cad30237c52102a11c4.png

    1 利用Matlab分析动态电路

    例1 RLC与U-S串联的电路如图1所示。已知,R=100Ω,L=0.5H,C=500μF,U-S=10V。求开关S闭合后电容C的端电压u-c

    aa4e0a8ae7219c18c77137034402cd93.png

    建立数学模型。依据基尔霍夫电压定律,电路的微分方程为:

    展开全文
  • MATLAB/Simulink 中的串联谐振(Series RLC电路
  • 有功功率P = V * I *cosφ 无功功率Q = V * I *sinφ 视在功率S = V * I S =√(P ^ 2 + Q ^ 2) 功率因数cosφ=(有功功率P)/(视在功率S)
  • 给定值为-.... R = 10欧姆,L = 0.4亨利,C = 100uf。 交流峰值电压= 220v。 使用的公式: 有功功率P = V * I *cosφ 无功功率Q = V * I *sinφ 视在功率S = V * I S =√(P ^ 2 + Q ^ 2) 功率因数,cosφ=(有功...
  • 在这个模拟中只需输入电阻电容和电感的值,模拟就会给你所有的参数1. 电阻电流2. 容性电流3.感应电流4. 无功功率5.真正的力量6. 视在功率7....根据 Simulink 的要求,一个常数值与视在功率相加,因此它的值在任何时候都...
  • 我不知道这个文件是做什么的。
  • MATLAB/Simulink 中的串联谐振电路
  • RL,RC&RLC系列的瞬态响应-MATLAB / Simulink中RL,RC&RLC系列电路的阶跃响应
  • RLC动态电路Matlab编程

    2020-12-31 04:53:21
    • 实现一个一阶RC电路,二阶RLC电路暂态分析程序; • 对于指定电路结构,程序应能分析电路零状态、零输入响应过程; • 程序能够展示各种分析结果,可以是图片、动画等。 思路 输入电路参数值(电流、电压、电阻...

    电路课程设计的产物 /头秃

    要求

    • 实现一个一阶RC电路,二阶RLC电路暂态分析程序;
    • 对于指定电路结构,程序应能分析电路零状态、零输入响应过程;
    • 程序能够展示各种分析结果,可以是图片、动画等。

    思路

    1. 输入电路参数值(电流、电压、电阻、电容、电感等);
    2. 一阶电路的分析则将参数值代入微分方程的通式中,得到电容和电感各自的电压;
    3. 二阶电路有通式解的同样代入参数值,否则列写微分方程组进行求解;
    4. 绘制电容/电感电压随时间变化图像。

    一阶动态电路程序

    clear;clc;
    a='2bcdd';
    a=input('输入求解情况:\n1rcs一阶RC零输入,1rls一阶RL零输入\n1rcz一阶RC零状态,1rlz一阶RL零状态\n1rcq一阶RC全响应,1rlq一阶RL全响应\n','s');
    
    if a=='1rcs'    %一阶RC零输入
        u0=input('输入电压初始值:\n');
        r=input('输入电阻值:\n');
        c=input('输入电容值:\n');
        tao=r*c
        t=0:0.1:10*tao;
        u=u0*exp(-t/tao);
        plot(t,u,'linewidth',2)
        grid on
        title('一阶RC零输入电路')
    
    elseif a=='1rls'    %一阶RL零输入
        i0=input('输入电流初始值:\n');
        r=input('输入电阻值:\n');
        l=input('输入电感值:\n');
        tao=l/r
        t=0:0.1:10*tao;
        u=-r*i0*exp(-t/tao);
        plot(t,u,'linewidth',2)
        grid on
        title('一阶RL零输入电路')
    
    elseif a=='1rcz'    %一阶RC零状态
        us=input('输入电压源电压:\n');
        r=input('输入电阻值:\n');
        c=input('输入电容值:\n');
        tao=r*c
        t=0:0.1:10*tao;
        u=us*(1-exp(-t/tao));
        plot(t,u,'linewidth',2)
        grid on
        title('一阶RC零状态电路')
    
    elseif a=='1rlz'    %一阶RL零状态
        us=input('输入电压源电压:\n');
        r=input('输入电阻值:\n');
        l=input('输入电感值:\n');
        tao=l/r
        t=0:0.1:10*tao;
        u=us*exp(-t/tao);
        plot(t,u,'linewidth',2)
        grid on
        title('一阶RL零状态电路')
        
    elseif a=='1rcq'    %一阶RC全响应
        u0=input('输入电压初始值:\n');
        us=input('输入电压源电压:\n');
        r=input('输入电阻值:\n');
        c=input('输入电容值:\n');
        tao=r*c
        t=0:0.1:5*tao;
        u=us+(u0-us)*exp(-t/tao);
        plot(t,u,'linewidth',2)
        grid on
        title('一阶RC全响应电路')
        
    elseif a=='1rlq'    %一阶RL全响应
        i0=input('输入电流初始值:\n');
        us=input('输入电压源电压:\n');
        r=input('输入电阻值:\n');
        l=input('输入电感值:\n');
        tao=l/r
        t=0:0.1:10*tao;
        %i=is+(i0-is)*exp(-t/tao);
        u1=-r*i0*exp(-t/tao);
        u2=us*exp(-t/tao);
        u=u1+u2;
        plot(t,u,'linewidth',2)
        grid on
        title('一阶RL全响应电路')
    end
    

    其他

    其他内容后期逐渐更新。

    展开全文
  • 本科毕业论文 题目基于 MATLABRLC 阻尼振荡电路 仿真分析 姓 名 张皖川 学 号 1042051349 专 业 电子信息工程 院 系 电子通信工程学院 指导老师 谈玲珑 职称学历 讲师 硕士 完成时间 2014年 5月 教务处 安徽新华...
  • 笔记本matlab程序 MATLAB程序--RLC振荡电路分析
  • 为了研究RLC电路弹簧耦合系统的非线性振动,用统一的能量法考虑机电耦合系统的电场能、磁场能和机械能,应用拉格朗日-麦克斯韦方程建立起一个受到简谐激励的RLC电路弹簧耦合系统的数学模型,该机电耦合系统具有平方...
  • 在这个版本中,对于 RL、RC、RLC 串联电路零初始条件,i = f (t) & I = f (s)。 下一版本:并联电路,非零初始条件。
  • MATLAB 的 SPICE 网表仿真工具完整文档可从https://github.com/nik1106/MNA-MAT获得
  • 这是对串联电路中的RLC及其频率响应的简单分析
  • OpenModelica仿真RLC电路

    千次阅读 2017-07-09 01:03:47
    前几天课程设计做电机仿真要用MATLAB,当时想找有没有Python做的类似simulink的程序,后来就找到了OpenModelica,模型是用建模语言modelica写的,查看了modelica的官网才知道Wolfram旗下的SystemMolder也是基于...

空空如也

空空如也

1 2 3 4
收藏数 63
精华内容 25
关键字:

matlabrlc电路

matlab 订阅