コード例 #1
0
        private void button7_Click(object sender, EventArgs e)
        {
            double Ie, Ic, Ib, Rb, Rc, Re, Vcc, Vce, Vbe, Imax, vmax, beta;

            try
            {
                Rc   = Convert.ToDouble(txtgeribeslemelirc.Text) * 1000;
                Rb   = Convert.ToDouble(txtgeribeslemelirb.Text) * 1000;
                Re   = Convert.ToDouble(txtgeribeslemeliRe.Text) * 1000;
                Vcc  = Convert.ToDouble(txtgeribeslemeliVcc.Text);
                beta = Convert.ToDouble(txtgeribeslemelibeta.Text);
                Vbe  = Convert.ToDouble(txtgeribeslemelivbe.Text);
                if (Rc > 0 & Rb > 0 & Re > 0)
                {
                    Imax = (1000 * Vcc) / (Rc + Re);

                    Ib   = (Vcc - Vbe) / (Rb + (beta + 1) * (Re + Rc));
                    Ie   = (beta + 1) * Ib;
                    Ic   = beta * Ib;
                    Vce  = Vcc - Ie * (Rc + Re);
                    vmax = Vcc;



                    lblgeribeslemeliIb.Text   = " = " + (Math.Pow(10, 6) * Ib).ToString() + "μA";
                    lblgeribeslemeliIc.Text   = " = " + (1000 * Ic).ToString() + "mA";
                    lblgeribeslemeliIe.Text   = " = " + (1000 * Ie).ToString() + "mA";
                    lblgeribeslemeliımax.Text = " = " + Imax.ToString() + "mA";

                    lblgeribeslemeliVce.Text = Vce.ToString() + "Volt";



                    Ic = Ic * 1000;



                    ZedGraph.ZedGraphControl g = new ZedGraph.ZedGraphControl();
                    g.Size = new Size(panel5.Width - 2, panel5.Height - 2);
                    ZedGraph.GraphPane myGraphPane = g.GraphPane;
                    myGraphPane.Title.Text       = "Dc yük eğrisi ";
                    myGraphPane.XAxis.Title.Text = "Volt (V)";
                    myGraphPane.YAxis.Title.Text = "Akım(ma)";
                    PointPairList list1 = new PointPairList();
                    myGraphPane.AddCurve("", new double[] { 0, vmax }, new double[] { Imax, 0 }, Color.Blue, ZedGraph.SymbolType.None);
                    myGraphPane.AddCurve("", new double[] { 0, Vce }, new double[] { Ic, Ic }, Color.Blue, ZedGraph.SymbolType.None);
                    myGraphPane.AddCurve("", new double[] { Vce, Vce }, new double[] { Ic, 0 }, Color.Blue, ZedGraph.SymbolType.None);

                    myGraphPane.Chart.Fill = new ZedGraph.Fill(Color.White, Color.Red, 3.0f);

                    g.AxisChange();

                    panel5.Controls.Add(g);
                }
                else
                {
                    MessageBox.Show("Direnc Degerlerini yanlış girdiniz:");
                }
            }
            catch (Exception)
            {
                Form1.HataMesaji();
            }
        }
コード例 #2
0
        private void button6_Click(object sender, EventArgs e)
        {
            double Ie, Ic, Ib, Vth, Rth, Rc, Re, Vcc, Vce, Vbe, Imax, vmax, beta, R1, R2;

            try
            {
                Rc   = Convert.ToDouble(txtgerilimbölücüpolarmarc.Text) * 1000;
                R1   = Convert.ToDouble(txtgerilimbölücüpolarmaR1.Text) * 1000;
                R2   = Convert.ToDouble(txtgerilimbölücüpolarmaR2.Text) * 1000;
                Re   = Convert.ToDouble(txtgerilimbölücüpolarmare.Text) * 1000;
                Vcc  = Convert.ToDouble(txtgerilimbölücüpolarmavcc.Text);
                beta = Convert.ToDouble(txtgerilimbölücüpolarmabeta.Text);
                Vbe  = Convert.ToDouble(txtgerilimbölücüpolarmavbe.Text);

                if (Rc > 0 & R1 > 0 & R2 > 0 & Re > 0)
                {
                    Imax = (1000 * Vcc) / (Rc + Re);
                    Vth  = R2 * Vcc / (R1 + R2);
                    Rth  = R2 * R1 / (R1 + R2);
                    Ib   = (Vth - Vbe) / (Rth + (beta + 1) * Re);
                    Ie   = (beta + 1) * Ib;
                    Ic   = Ie - Ib;
                    Vce  = Vcc - Ic * Rc - Ie * Re;
                    vmax = Vcc;

                    lblgerilimbölücüpolarmaıb.Text   = " = " + (Math.Pow(10, 6) * Ib).ToString() + "μA";
                    lblgerilimbölücüpolarmaıc.Text   = " = " + (1000 * Ic).ToString() + "mA";
                    lblgerilimbölücüpolarmaıe.Text   = " = " + (1000 * Ie).ToString() + "mA";
                    lblgerilimbölücüpolarmaImax.Text = " = " + Imax.ToString() + "mA";
                    lblgerilimbölücüpolarmavth.Text  = Vth.ToString() + "Volt";
                    lblgerilimbölücüpolarmarth.Text  = Rth.ToString();
                    lblgerilimbölücüpolarmavce.Text  = Vce.ToString() + "Volt";
                    Ic = Ic * 1000;


                    ZedGraph.ZedGraphControl g = new ZedGraph.ZedGraphControl();
                    g.Size = new Size(panel4.Width - 2, panel4.Height - 2);
                    ZedGraph.GraphPane myGraphPane = g.GraphPane;
                    myGraphPane.Title.Text       = "Dc yük eğrisi ";
                    myGraphPane.XAxis.Title.Text = "Volt (V)";
                    myGraphPane.YAxis.Title.Text = "Akım(ma)";
                    PointPairList list1 = new PointPairList();
                    myGraphPane.AddCurve("", new double[] { 0, vmax }, new double[] { Imax, 0 }, Color.Blue, ZedGraph.SymbolType.None);
                    myGraphPane.AddCurve("", new double[] { 0, Vce }, new double[] { Ic, Ic }, Color.Blue, ZedGraph.SymbolType.None);
                    myGraphPane.AddCurve("", new double[] { Vce, Vce }, new double[] { Ic, 0 }, Color.Blue, ZedGraph.SymbolType.None);

                    myGraphPane.Chart.Fill = new ZedGraph.Fill(Color.White, Color.Red, 3.0f);

                    g.AxisChange();

                    panel4.Controls.Add(g);
                }
                else
                {
                    MessageBox.Show("Direnc Degerlerini yanlış girdiniz:");
                }
            }
            catch (Exception)
            {
                Form1.HataMesaji();
            }
        }