Scipy - Python library - Math tool - Begin
Introduction
Scientific Computing Tools for Python. Seen in Scipy.org.
Environment
Linux, CentOS 7 with KDE, python 2.7
Installation
python -m pip install --upgrade pip
# Do not use sudo for the next command
pip install --user numpy scipy matplotlib ipython jupyter pandas sympy nose
# change the environment
vim ~/.bashrc
# export PATH=$PATH:/home/leaf/.local/bin
A simple demo to solve a Bessel function
Bessel function: most commonly, the canonical solutions y(x) of the differential equation. Seen in wiki.
Code (Python):
from matplotlib.pyplot import *
from numpy import *
from scipy import special, optimize
f = lambda x: -special.jv(3,x)
sol = optimize.minimize(f, 1.0)
x = linspace(0, 10, 5000)
x
plot(x, special.jv(3, x), '-', sol.x, -sol.fun, 'o')
savefig('plot.png', dpi=96)
Result:

Simple case. Just for the beginning of applying Scipy.
Scipy - Python library - Math tool - Begin的更多相关文章
- 分别使用 Python 和 Math.Net 调用优化算法
1. Rosenbrock 函数 在数学最优化中,Rosenbrock 函数是一个用来测试最优化算法性能的非凸函数,由Howard Harry Rosenbrock 在 1960 年提出 .也称为 R ...
- Where is the python library installed?
configure: error: Could not link test program to Python. Maybe the main Python library has been inst ...
- Python library not found: libpython2.7mu.so.1.0
在使用pyinstaller生成python可执行文件的时候,包错误,提示有几个依赖的库找不到:Python library not found: libpython2.7mu.so.1.0 参考st ...
- kivy.org - Open source Python library for rapid development of applications
kivy.org - Open source Python library for rapid development of applicationsthat make use of innovati ...
- python中math常用函数
python中math的使用 import math #先导入math包 1 三角函数 print math.pi #打印pi的值 3.14159265359 print math.radians(1 ...
- Couchbase III(Python Library)
Couchbase III(Python Library) 第一步 安装 使用pip安装: >pip install couchbase --quiet 确认是否安装成功: >python ...
- 机器学习、NLP、Python和Math最好的150余个教程(建议收藏)
编辑 | MingMing 尽管机器学习的历史可以追溯到1959年,但目前,这个领域正以前所未有的速度发展.最近,我一直在网上寻找关于机器学习和NLP各方面的好资源,为了帮助到和我有相同需求的人,我整 ...
- python -m json.tool 中文乱码 Format JSON with python
现在以 json 为数据传输格式的 RESTful 接口非常流行.为调试这样的接口,一个常用的办法是使用 curl 命令: curl http://somehost.com/some-restful- ...
- python数学math和random模块
math模块 关注公众号"轻松学编程"了解更多. 在使用math模块时要先导入 # 导入模块 import math 1.math.ceil(num) 对num进行向上取整 num ...
随机推荐
- QTableWidget去除选中虚边框
m_tableWidget->setFocusPolicy(Qt::NoFocus); //去除选中虚线框
- Xcode 中的相对路径与绝对路径的相关设置
近日闲来无事,与博客园中闲荡,忽至一烟霞照耀祥瑞蒸熏松竹翠秀奇花遍开的神奇之地.如此美景,令人心生向往,故而徜徉于其中不可自拔,独乐乐不如众乐乐: iOS开发之 相对路径与绝对路径 https://d ...
- imageNamed和imageWithContentsOfFile区别
在 Apple 官方帮助文档提供了两个加载图片的方法 imageNamed , 其参数为图片的名字 imageWithContentsOfFile , 其参数是图片文件的路径 下面主要是说一下他们的区 ...
- LeetCode之344. Reverse String
------------------------------- Java也可以实现一行代码反转字符串哦 AC代码如下: public class Solution { public String re ...
- UDK游戏开发基础命令
编译 增量重新编译Debug版本UnrealScript脚本 UDK.exe make -debug 增量重新编译Release版本UnrealScript脚本 UDK.exe make ...
- Mybatis 学习笔记1 不整合Spring的方式使用mybatis
两种方式都包含了: package com.test.mybatis; import java.util.List; import org.apache.ibatis.io.Resources; im ...
- [MongoDB]MongoDB的优缺点及与关系型数据库的比较
汇总: 1. [MongoDB]安装MongoDB2. [MongoDB]Mongo基本使用:3. [MongoDB]MongoDB的优缺点及与关系型数据库的比较4. [MongoDB]MongoDB ...
- .NET开发者如何愉快的进行微信公众号开发
(此文章同时发表在本人微信公众号"dotNET每日精华文章",欢迎右边二维码来关注.) 题记:这篇文章只是一个如何提高开发效率的简单指导和记录,不会涉及具体的微信公众号开发内容. ...
- UWP 禁止Pivot swip 手势
以前想要禁止内置的手势动作,看了一下网上是设置 IsLocked="True". 但是拿到UWP上来,靠,设置了之后header只显示当前的那个header.这样的设计真是丑爆了. ...
- 网络科学 - 社区发现 Community structure and detection及其几个实现工具
首先什么是社区(Community structure)呢?其实并不是指一个网络相互连接的部分,而是一个网络中链接“紧密的部分”,至于怎么定义紧密就有很多方法了. 社区发现算法可以参考下面的博客:博客 ...