c# 标准正太分布函数_《可靠性设计》——常见的失效分布

本文介绍了正态分布的概念、性质以及在可靠性设计中的应用,包括标准正态分布的转换,正态概率图的使用方法,同时提到了对数正态分布、Weibull分布和指数分布的基本概念和特点。
摘要由CSDN通过智能技术生成

正态分布

前提知识:正态分布又称Gauss分布,是最常见和应用最广泛的一种分布。若随机变量X的概率密度函数为

3f2548f55ef7e0ba78d1640fe93763f3.png

其中σ为母体(母体就是总体,而不是样本)标准偏差,μ为母体中心倾向尺度,可以是均值、中位数或众数,则称X服从参数为σ和 μ的正态分布,X~N(μ,σ)。

正太分布的性质:

1)f(x)曲线以x=μ为对称

2)f(x)曲线在μ±σ处有拐点

3)当x=μ时,f(x)有最大值

4)当x→±∞时,f(x) →0

5)在整个定义域的范围内积分为1

(这些性质没什么好记的,只要脑海里面有那个正太分布的图就可以)

当X为产品的寿命时,就得到正态失效概率密度函数

303130df6aefcac69d96e23fe1b87cfb.png

由前面推导得到的f(t),F(t),λ(t)之间的

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
要画正态分布曲线,可以使用C#的Math库中的Erf函数,其可以计算误差函数,进而计算正态分布函数。以下是一个简单的示例代码: ```csharp using System; using System.Drawing; using System.Windows.Forms; public class NormalDistribution : Form { private const int margin = 20; private const int width = 500; private const int height = 300; private const int samples = 1000; public NormalDistribution() { Text = "Normal Distribution"; Size = new Size(width + 2 * margin, height + 2 * margin); } protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); Graphics g = e.Graphics; Pen pen = new Pen(Color.Red, 2); Font font = new Font("Arial", 10); StringFormat format = new StringFormat(); format.Alignment = StringAlignment.Center; float[] x = new float[samples]; float[] y = new float[samples]; float min = -3.0f; float max = 3.0f; float step = (max - min) / samples; for (int i = 0; i < samples; i++) { x[i] = min + i * step; y[i] = (float)(Math.Exp(-x[i] * x[i] / 2) / Math.Sqrt(2 * Math.PI)); } float scaleX = width / (max - min); float scaleY = height / y[0]; g.TranslateTransform(margin, margin + height); g.ScaleTransform(scaleX, -scaleY); g.DrawLines(pen, x, y); g.ResetTransform(); g.DrawString("μ = 0, σ = 1", font, Brushes.Black, margin + width / 2, margin + height + 5, format); g.DrawString("x", font, Brushes.Black, margin + width - 10, margin + height + 5, format); g.DrawString("y", font, Brushes.Black, margin - 20, margin + height / 2, format); } public static void Main() { Application.Run(new NormalDistribution()); } } ``` 该代码使用了Graphics类的一些属性和方法来绘制正态分布曲线。运行上述代码,将会得到一个简单的窗口,窗口中心的红线即为所求的正态分布曲线。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值