分享兴趣,传播快乐,增长见闻,留下美好!亲爱的您,这里是LearningYard学苑。
今天小编为大家带来每周学点Mathmatica——变量的命名,欢迎您的用心访问!本期推文时长大约3分钟,请您耐心阅读。
Share interest, spread happiness, increase knowledge, and leave beautiful. Dear, this is the Learing Yard Academy!
Today, the editor brings the Learn Mathmatica every week -- Variable Usage. Welcome to visit! This tweet usually takes about 3 minutes to read. Please read patiently.
01 变量的命名
Mathematica中有许多常用的内部数学函数,如三角函数—Sin[x],绝对值函数—Abs[x],指数函数—Exp[x]等。除此之外,还包括许多内部常数,如圆周率π—Pi,自然对数的底数e—E,虚数单位i —I,度—Degree等。
Mathematica has many commonly used internal mathematical functions, such as trigonometric function Sin [x], absolute value function Abs [x], exponential function Exp [x], etc. In addition, it also includes many internal constants, such as pi Pi, the base e-E of natural logarithm, imaginary unit i-I, degree Degree, etc.
这些常用的内部数学函数和常用常数都是以大写字母开头。
These commonly used internal mathematical functions and constants begin with capital letters.
为了避免与其混淆,我们自定义变量时,尽量以小写字母开始,后面跟数字或者英文字母的组合,采用这样的一个命名规则。
In order to avoid confusion, we try to use such a naming rule when defining variables, starting with lowercase letters followed by numbers or English letters.
如果在我们没有了解到Mathematica中的内部数学函数或者常用变量时,误将内部数学函数或者常用变量作为我们自定义的变量,那么软件就会弹出对应的提示。
If we do not know the internal mathematical functions or common variables in Mathematica, and mistakenly use the internal mathematical functions or common variables as our user-defined variables, the software will pop up the corresponding prompt.
举个栗子:
For example:
当我们在不了解内部常数自然对数的底数e—E,虚数单位i —I时,误将其用作自定义变量。那么软件在执行相应操作时,就会有橙色字的提示,如下图所示:
When we do not know the base e-E and imaginary unit i-I of the natural logarithm of the internal constant, we mistakenly use it as a user-defined variable. When the software executes the corresponding operation, it will display an orange prompt, as shown in the following figure:
如果我们按照小写字母开头的自定义命名规则,就可以规避这种问题。
If we follow the custom naming rules starting with lowercase letters, we can avoid this problem.
02 常用内部数学函数
指数 | Exp[x] | 正割 | Sec[x] |
对数 | Log[a,x] | 余割 | Csc[x] |
开方 | Sqrt[x] | 实部 | Re[z] |
绝对值 | Abs[x] | 虚部 | Im[z] |
正弦 | Sin[x] | 正切 | Tan[x] |
余弦 | Cos[x] | 余切 | Cot[x] |
END
今天的分享就到这里了,如果您对文章有独特的想法,欢迎给我们留言。让我们相约明天,祝您今天过得开心快乐!
That's all for today's sharing. If you have a unique idea about the article, please leave us a message, and let us meet tomorrow. I wish you a happy day!
参考资料:Deepl翻译、百度
本文由LearningYard学苑整理并发出,如有侵权请在后台留言沟通!