Useful python web and sources
Collection #PythonUseful package and corresponding web page
Solveset Solve the equations better than solve
scipy.interpolate.griddata interpolate the data with ununiform grid
scipy.interpolate.interp interpolate the 1d data
scipy.interpolate.interp2d interpolate the 1d data
odeintw provides a wrapper of “scipy.integrate.odeint” that allows it to handle complex and matrix differential equations. That is, it can solve equations of the form.
animatplot could let the animated plot easier and provi ...
How to uninstall ubuntu with windows/ubuntu dual system
Ubuntu #Windows https://www.jianshu.com/p/66a092caaa36?tdsourcetag=s_pctim_aiomsg
This is original from above blog.
On a dual-system computer, if you use Ubuntu’s built-in grub program as boot to boot, you cannot directly format the disk on windows where Ubuntu is located, otherwise the MBR contents on the hard disk will be wiped out and the boot will not succeed.
To uninstall Ubuntu, you need to first delete its MBR content and then format its hard disk. For different computers, there are di ...
PythonPlot (2) ThreeOrthogonalVectors
Python #PlotAll the python study code can be found in my own repository.
PurposeWhen we describe the angle of an vector in 3d space, we will use three vectors to describe them. When We have three orthogonal vectors, how can be describe them and show them via plot? This is the purpose of this note.
To plot three orthogonal vectors in a 3d space. We will use three parameters to describe them.
: the polar angle, angle between the c axis and the z axis
: the azimuthal angle
Ratio_xy : to rotate ...
Python Plot (1) A small ball on a smooth semicircle (Animated)
Python #PlotAll the python study code can be found in my own repository.
PurposeIn high school we learned how to use the energy conservation law to get the velocity for a ball slides down a 1/4 circle. However, the time needed in this process is still unknown. The period for a pendulum also uses a approximated expression. In this note, I will try to solve the time evolution for a ball slide down from a smooth semi-circle numerically via python. I will compare the oscillator approximation and ac ...
How to use COMSOL, MATLAB and COMSOL livelink with MATLAB on Server
MATLAB #COMSOL #Livelink #Server[TOC]
This note is to show the way of using MATLAB, COMSOL,COMSOL Livelink With MATLAB on our server (ubuntu). We hope that we can run them with bash code in background and after we logout or exit the server the simulations will continue. We also need to know the simulation progress from a log file. These needs can all be satisfied only if you write proper bash code.
Run COMSOL on serverIf you want to run COMSOL on server, you can use the command of the followin ...
APS用RevTex投稿全记录
APS本笔记详细技术了如何用latex写一篇论文并投稿。在准备论文的时候,需要用到的软件有
Texlive ,用来编译Latex。
RevTex,APS官方写作包,对于Texlive,一般都会默认安装有Texlive,只是不是最新版的。
Latex编辑器,我比较推荐Texstudio,或者Sublime或者Vs code等。
文献管理软件,我比较推荐Endnote以及Mendeley,文献管理软件很多,找一个适合自己的,我自己用的是Endnote。
当然,实际准备论文时候,还需要准备论文绘图,绘制数据图的时候,我使用了MATLAB和python一起来绘制的,二者都不能完全相互替代。绘制示意图时,用到了Corel draw绘制二维矢量图,Blender绘制三维图。
准备阶段在准备阶段,需要安装一系列软件。每个人用的软件可能会有区别,比如写latex我喜欢用sublime来书写,其在插入文献的时候有其他软件无法比拟的功能。我在此以我用的软件为例,写一下准备一篇文章需要经过哪些步骤。
安装texlive2018: 用来编译latex文件
安装编辑器, 用来书写文章。
推荐TexSt ...
Linux设置远程桌面连接
Ubuntu #RemoteDesktop介绍本篇笔记记述了如何在Ubuntu上面配置好xrdp,并且通过windows或者Ubuntu访问。这种方法对于访问linux服务器比Teamviewer要好用,登录后借助于第三方桌面系统,虚拟了一个桌面出来,所以与原来的ubuntu桌面是不一样的,能够满足我们偶尔连接一下,进行少量的图形桌面操作。对于原理讲的比较清楚的是下面这篇博文https://www.linuxidc.com/Linux/2017-09/147112.htm我在自己的电脑ubuntu 16.04以及另外一台服务器ubuntu 18.04上面分别试验了一下,方法有所区别。
18.04的配置方法:
https://baijiahao.baidu.com/s?id=1619271691270163095&wfr=spider&for=pc
按照上面这篇博文的方法一步步的做就可以,不做过多说明。
16.04的配置方法
https://www.linuxidc.com/Linux/2017-09/147112.htmhttps://www.cnblogs.c ...
EndNote文献管理总结
Endnote #Reference介绍 对于搞科研的人来说,有很大一部分时间都花在读文献上,做不同的课题时,会收集相当数量的文献,如果可以高效的管理文献,将会对科研工作大有裨益。文献管理可以分为两种,一种是通过文件夹来管理,需要自己花额外大的事件来命名文件,比如作者、期刊、年份、卷号,有时候还想加上题目,文献很多时,会非常麻烦。我曾经也是用这种方法来管理文献,现在也没有完全舍弃。第二种方法是采用文献管理软件,用软件对文献进行分类保存。目前市面上的软件也是五花八门,比如大名鼎鼎的“Endnote”,免费的“Mendeley”,”Zotero”,“Docear”,”Papers”,以及最近比较火的“Citavi”,可以参考该讨论 我目前只用过Endnote、Mendeley以及短暂用过一点Citavi,最后选择了Endnote,本来前期很喜欢Mendeley,全平台支持,界面友好。因为课题组的人要统一工具,便于分享,最后用上了Endnote,果然是商业软件,用起来还是非常靠谱的。在自己准备第一篇文章的时候,慢慢的摸索查资料,逐渐知道了怎么用Endnote管理文献并且配合w ...
Windows python 环境配置
Windows说明python在ubuntu的安装比较简单,我装的是Anaconda3, 然后设置环境变量就可以。在办公室的Windows电脑也设置好了,可以直接运行程序。但是在自己新买的HP-Eilte Book 735 G5 AMD 版本里面,总是会出现问题:1.第一个问题是在cmd命令里面没办法运行python,只能在Anaconda自带的命令窗口prompt里面用,发现可以通过将python加入环境变量解决。
2.第二个问题是即使我加入了环境变量,在命令行使用的时候,还是没办法插入插件包,比如numpy,晚上搜索了许多,发现可能是因为版本问题?反正我重新安装了一边numpy就好了。但是那么多插件全部都得自己重新安装,岂不费事?这样Anaconda的优势就体现不出来了。(也和python环境有关,我自己是搞不定)
3.第三个问题是conda更新出现HTTP ERROR,貌似可以通过更改镜像源来解决。以前linux死活不行是因为我设置了代理翻墙。
直接安装python3,然后pip一个个安装由于上面的第二个问题没办法解决,干脆不装anaconda,直接轻量级安装python3,官 ...
Python数据的保存文件类型
Python #DataProcessing最近在用python扫描参数计算,在用MATLAB的时候,比较喜欢保存为CSV文件或者是txt文件,这些文件的好处是可以用记事本或者excel打开看,缺点是占用的空间太大。后来MATLAB我比较倾向于用“.mat”文件来保存,这样文件就会比较小。MATLAB保存为.mat文件只要如下命令
12save('xxx.mat','matA','matB',...) %依次保存matA,matB文件save('xxx.mat') %保存工作区的所有文件
python也支持以上所有的文件格式,还支持npy文件。用法如下,首先导入包
12import numpy as npimport scipy.io as scio
txt 格式1234# 保存为txtnp.savetxt("filename.txt", matA)## 读取为txtdata=np.loadtxt("filename.txt")
mat 格式12345678# 保存为mat文件scio.savemat("filename.mat", {'NameA':matA})# 读取为mat文件d ...