如何编写工程数学公式的代码 [英] How Do I Write Codes Fo Engineering Maths Formula

查看:183
本文介绍了如何编写工程数学公式的代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个表单,允许用户在各自的文本框中输入m,Eb和Q的值。有一个组合框,其中包含两个值QAM和PSK。



我想写一个程序,当用户点击表格上的计算按钮时

它检查组合框中的值然后它执行计算



如果组合框中的值是QAM那么它应该使用下面的公式



4 [1-(1 /√m)] * Q [√((3log_2 m /(m-1))* Eb)]



否则如果组合框中的值是PSK



2Q [(√(2log_2 m)* Eb * Sin(π/ m) )]



请帮帮我。我没有在c#之前使用任何数学公式

i have a form which allows the user to enter the value of m, Eb and Q in their respective text boxes. there is a combo box which contains two values QAM AND PSK.

I Want to write a program that when a user clicks the calculate button on the form
it checks for the value in the combo box then it performs the calculation

if value in combobox is QAM then it should use the below formula else

4[1-(1/√m)] * Q[√( (3log_2 m / (m-1)) * Eb)]

else if value in combobox is PSK

2Q [ (√(2log_2 m) * Eb * Sin(π / m) ) ]

please help me out. i have not used any math formula in c# before

推荐答案

你可以从翻译其中一个公式开始,这样它只使用.NET运算符:[ ^ ]。



然后,检查System.Math .NET库中的函数,找到使用[]和log_2的等价物:[ ^ ]。如果没有.NET或System.Math库,相当于在公式中使用括号,那么你必须找到一个等价的,写一个,或者,也许这里有人可以提供帮助。
You might start by translating one of the formulas so it uses only .NET operators: [^].

And, examine the functions in the System.Math .NET library to find equivalents to your use of [] and log_2: [^]. If there is no .NET, or System.Math library, equivalent to the use of brackets in the formulas, then you'll have to find an equivalent, write one, or, perhaps, someone here can help.


看看这里: .NET计算引擎 [ ^ ]。这是一个非常有趣的引擎,它提供了将公式变量转换为其值的功能。
Have a look here: A Calculation Engine for .NET[^]. It is very interesting engine which provides functionality to translate formula's variables to its values.


这篇关于如何编写工程数学公式的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆