OK, so, the thing about a state function is that the function has a value for initial conditions and at final conditions.
态函数的特点是,在初始状态有一个值,在末状态也有一个值。
00 Well, it looks like it's dead on 100, which was our initial price in test two.
看上去它就固定在,这和我们测试2的初始值是一样的。
I initialize it to false.
我把它初始化为假值。
So, let's say we start off at the distance being ten angstroms. We can plug that into this differential equation that we'll have and solve it and what we find out is that r actually goes to zero at a time that's equal to 10 to the negative 10 seconds.
也就大约是这么多,所以我们取初始值10埃,我们把它代入到,这个微分方程解它,可以发现,r在10的,负10次方秒内就衰减到零了。
If I then put it back into its original condition, lower the heat say, temperature back to body temperature and reduce the pH down to seven again, the molecules will re-nature.
假如我把烧杯的温度恢复到初始状态,降低温度,温度降低到体温,将pH值降低到七,这些分子会复性
swap I'm going to keep track of a little variable called swap, it's initially true, and as long as it's true, I'm going to keep going, but inside of the loop I'm going to set it to false, and only if I do a swap will I set it to true.
我打算跟踪一个小的变量称为,初始值为真,只要它是真的,算法就会继续,但是在循环里,我打算把他设为假,除非交换发生,就把它设为真。
All right. Second question: or maybe a better way of saying this, and the general format you're likely to see here is, a test involving a variable name, which must be initialized outside of the loop, and which interior to the loop gets changed, so that the test is going to change.
好,第二个问题:,换种更好的方式来说吧,你们通常喜欢的,方式是,这个测试涉及到一个变量名字,变量在循环外已经被初始化,然后循环内部会改变这个变量的值,因此测试结果会改变。
Just to remind you what it does, we bound x to some value, we set up an initial variable called ANS or answer, answer and then we run through a little loop.
记住你要做些什么,我们给x赋一个值,我们建立一个初始变量,命名为ANS或者。
We've seen in class that you get garbage values if you don't initialize something to a value so let me actually initialize x to a value.
我们在课程上了解到,如果你不给一个变量,进行赋值,它会获得一个无效值,让我把x初始化为一个值。
Give it some initial values.
给它一个初始值。
And that shows you one other nice little thing we want to do, which is if I look in this code notice I set up a variable up here called false Solution Found, initially bound to false.
这显示了我们想要做的另一件事,那就是我在这段代码中设置了一个,名为Solution,Found的变量,初始值设为。
So same code up here -- thankful is initialized to false.
所以这里的同样的代码--thankful被初始化为false值。
false Initially it's false, because I have no input.
命名为input,OK,初始值为。
I then print X's now such and such, initializing dot, dot, dot.
然后我打印X的值,如此这般,初始化点,点,点。
But instead in this chemistry course, I will just tell you the solutions to differential equations. And what we can do is we can start with some initial value of r, and here I write r being ten angstroms. That's a good approximation when we're talking about atoms because that's about the size of and atom.
但在这个课里,我会直接,告诉你们微分方程的解,我们可以给距离r一个初始值,我这里把r取10埃,当我们讨论原子时,这是一个很好的近似,因为原子的尺寸。
应用推荐