Python学习笔记

1. Eclipse多行注释 ctrl+/

2. Tuple, string and number is immutable, while list is mutable.

>>> t = 12345, 54321, 'hello!'
>>> t[0] = 88888
 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
 TypeError: 'tuple' object does not support item assignment

    The keys in dictionary can NOT contain any mutable objects.

3.  distutils.text_file.TextFile.readlines(): Read and return the list of all logical lines remaining in the current file. This updates the current line number to the last line of the file.

4. enumerate(iterable, start=0)

>>> seasons = ['Spring', 'Summer', 'Fall', 'Winter']
>>> list(enumerate(seasons))
[(0, 'Spring'), (1, 'Summer'), (2, 'Fall'), (3, 'Winter')]
>>> list(enumerate(seasons, start=1))
[(1, 'Spring'), (2, 'Summer'), (3, 'Fall'), (4, 'Winter')]

5. while加else的意思是只有在while正常结束循环的时候才执行else的语句,如果用非自然中断循环,比如用break跳出,则不执行。如果不加else,while循环不管怎么样结束,后边的语句都执行。(http://zhidao.baidu.com/question/468857592.html)

6. arithmetic:

>>> 5//3
1
>>> 5/3
1.66666666666666667
>>> divmod(5,3)
(1,2)
>>> num=5
>>> num +=1
>>> num
6

7. If you intend to define a function without any body inside, you can just use the built-in word pass.

8. A generator function is a function that returns iterator objects.

9. The difference between yield and return is the former picks up where it was left last time when it call the function again while the later always runs at the beginning of the function.

10. dict.get()key[, default])

     Return the value for key if key is in the dictionary, else default. If default is not given, it defaults to None, so that this method never raises a KeyError. (python.org)

11. Generator Objects are used to be iterators. And __iter__(self) makes an object iterable object.

12. Getting rid of the default new line in print function is achieved by adding end='' in the arguement list.

13. if __name__ == "__main__": main()

14. Users of the package can import individual modules from the package. This loads the submodule sound.effects.echo. It must be referenced with its full name.for example:

>>>import sound.effects.echo
>>>sound.effects.echo.echofilter(input, output, delay=0.7, atten=4)

15. An alternative way of importing the submodule is like following. This also loads the submodule echo, and makes it available without its package prefix, so it can be used as follows:

>>>from sound.effects import echo
>>>echo.echofilter(input, output, delay=0.7, atten=4)


内容概要:本文详细探讨了双馈风力发电机(DFIG)在Simulink环境下的建模方法及其在不同风速条件下的电流与电压波形特征。首先介绍了DFIG的基本原理,即定子直接接入电网,转子通过双向变流器连接电网的特点。接着阐述了Simulink模型的具体搭建步骤,包括风力机模型、传动系统模型、DFIG本体模型和变流器模型的建立。文中强调了变流器控制算法的重要性,特别是在应对风速变化时,通过实时调整转子侧的电压和电流,确保电流和电压波形的良好特性。此外,文章还讨论了模型中的关键技术和挑战,如转子电流环控制策略、低电压穿越性能、直流母线电压脉动等问题,并提供了具体的解决方案和技术细节。最终,通过对故障工况的仿真测试,验证了所建模型的有效性和优越性。 适用人群:从事风力发电研究的技术人员、高校相关专业师生、对电力电子控制系统感兴趣的工程技术人员。 使用场景及目标:适用于希望深入了解DFIG工作原理、掌握Simulink建模技能的研究人员;旨在帮助读者理解DFIG在不同风速条件下的动态响应机制,为优化风力发电系统的控制策略提供理论依据和技术支持。 其他说明:文章不仅提供了详细的理论解释,还附有大量Matlab/Simulink代码片段,便于读者进行实践操作。同时,针对一些常见问题给出了实用的调试技巧,有助于提高仿真的准确性和可靠性。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值