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 ...
随机推荐
- 解决IE8 内置JSON.stringify,中文变unicode的问题
转自:http://my.oschina.net/u/919074/blog/191131 项目中出现在IE下出现把json对象转为json串中文变成unicode的问题,最后经过排查,发现是IE8内 ...
- 修改iphone联系人头像
如何通过代码来修改iphone联系人头像 使用如下代码: UIImage *image=[UIImage imageNamed:@"star_full.png"]; NSData ...
- 【Java EE 学习 32 上】【JQuery】【选择器】
一.JQuery简介 1.JQuery是JavaScript库,封装了很多预定义对象和实用函数. 2.JQury的优势: (1)简洁,其宗旨就是写更少的代码做更多的事. (2)文档声明非常全面:htt ...
- javascript设计模式与开发实践
1. js面向对象6种形式(详情) <!DOCTYPE html> <html> <head lang="en"> <meta chars ...
- 题目:解决.NET项目中的平台选项,由x86设置为AnyCPU
问题:开发出的.NET程序在windows7 X64平台无法使用,打开提示异常”stopping work….” 1.打开解决方案中的配置管理器,发现有部分程序集的平台是x86,想改变平台选项,发现无 ...
- MT4平台经验总结
https://www.mql5.com/zh/code/8462 https://www.mql5.com/zh/code/8074 https://www.mql5.com/zh/code/787 ...
- 一步一步打造自己的Android图片浏览器(原创)
今天我们试着来制作一个自己的Android图片浏览器. 图片浏览器应该具有什么功能呢?鉴于不同的人不同的理解,这里提出一个基本的需求: 搜索手机内的所有图片,展示于一个列表中: 列表中展示的是图片的缩 ...
- Redis 基本操作
参考网址:http://doc.redisfans.com/ redis 在操作的时候,不区分大小写(包括php) Key(键) DEL key [key ...] 删除给定的一 ...
- [Leetcode] Roman to Integer
Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 t ...
- 在list_*页面显示出一级栏目下的所有二级栏目
<ul class="nav nav-pills nav-stacked"> {dede:channelartlist typeid='1,1'} <div cl ...