把内容过程中经常用到的一些内容段做个备份,如下的内容是关于Evaluate X and Y returned from the differential equation solvers using printput frequency in Python的内容,应该是对码农们也有好处。

''' printSoln(X,Y,freq).
Prints X and Y returned from the differential
equation solvers using printput frequency 'freq'.
freq = n prints every nth step.
freq = 0 prints initial and final values only.
'''
def printSoln(X,Y,freq):

def printHead(n):
print "n x ",
for i in range (n):
print " y[",i,"] ",
print

def printLine(x,y,n):
print "%13.4e"% x,
for i in range (n):
print "%13.4e"% y[i],
print

m = len(Y)
try: n = len(Y[0])
except TypeError: n = 1
if freq == 0: freq = m
printHead(n)
for i in range(0,m,freq):
printLine(X[i],Y[i],n)
if i != m - 1: printLine(X[m - 1],Y[m - 1],n)

Evaluate X and Y returned from the differential equation solvers using printput frequency in Python的代码的更多相关文章

  1. [Mathematics][MIT 18.03] Proof of a Theory about the Solution to Second-order Linear Homogeneous Differential Equation

    At first, I'd like to say thank you to MIT open courses which give me the privilege to enjoy the mos ...

  2. [Mathematics][MIT 18.03] Detailed Explanation of the Frequency Problems in Second-Order Differential Equation of Oscillation System

    Well, to begin with, I'd like to say thank you to MIT open courses twice. It's their generosity that ...

  3. Scipy - Python library - Math tool - Begin

    Introduction Scientific Computing Tools for Python. Seen in Scipy.org. Environment Linux, CentOS 7 w ...

  4. robotframework中的用evaluate关键字进行运算(随机数+转换+运算)

    当我们在写rf测试用例时,可能需要随机产生一些数据,可能需要将已有的数据进行转换,做简单的运算等:此时我们可以用万能的evaluate来实现 ,后面一般均适用python表达式来进行实现. 接下来详细 ...

  5. symmetry methods for differential equations,exercise 1.4

    tex文档: \documentclass[a4paper, 12pt]{article} % Font size (can be 10pt, 11pt or 12pt) and paper size ...

  6. Solving ordinary differential equations I(Nonstiff Problems),Exercise 1.2:A wrong solution

    (Newton 1671, “Problema II, Solutio particulare”). Solve the total differential equation $$3x^2-2ax+ ...

  7. 怎么让self.view的Y从navigationBar下面开始计算

    原文地址 http://blog.sina.com.cn/s/blog_1410870560102wu9a.html 在iOS 7中,苹果引入了一个新的属性,叫做[UIViewController s ...

  8. query flot 直方图上显示对应的y值

    方法1:使用在图上加 相对定位的 div 提示对应的直方图数量. 具体实现:获取直方图上所有的点,得到y值和对应的坐标位置,插入相对div 主要js代码:plot 为对应的图对象 //初始化柱状图数据 ...

  9. 函数的光滑化或正则化 卷积 应用 两个统计独立变量X与Y的和的概率密度函数是X与Y的概率密度函数的卷积

    http://graphics.stanford.edu/courses/cs178/applets/convolution.html Convolution is an operation on t ...

随机推荐

  1. nfs 共享目录

    依赖的包 yum -y install nfs-utils vim /etc/exports /data/test_nfs 10.125.37.12/16(rw,sync,no_root_squash ...

  2. 关于.net后台的异步刷新的问题

    我在.net后台做了一个功能.这里我简单话的描述这个功能. 一个下拉框,然后选择其中的不同的下拉信息,下面会有不同的材料表的显示. 其中一个表中如果有必填的字段,那么你切换这个的时候,会导致下拉框不会 ...

  3. XML CDATA识别“<,>”

    http://www.w3school.com.cn/xml/xml_cdata.asp 术语 CDATA 指的是不应由 XML 解析器进行解析的文本数据(Unparsed Character Dat ...

  4. 使用JavaScript实现单向链表

    一.实现功能 1.链表元素头部插入 this.unShift = function(data) {} 2.链表元素尾部插入 this.append= function(data) {} //返回boo ...

  5. 搭建apache本地服务器·Mac

    1. 打开终端,开启Apache: //开启apache: sudo apachectl start //重启apache: sudo apachectl restart //关闭apache: su ...

  6. 蓝桥杯c/c++省赛真题——日志统计

    标题:日志统计 [问题描述]小明维护着一个程序员论坛.现在他收集了一份"点赞"日志,日志共有N行.其中每一行的格式是:ts id  表示在ts时刻编号id的帖子收到一个" ...

  7. Spring boot 源码分析(前言)

    开坑达人 & 断更达人的我又回来了 翻译的坑还没填完,这次再开个新坑= = 嗯,spring boot的源码分析 本坑不打算教你怎么用spring boot = = 也不打算跟你讲这玩意多方便 ...

  8. HTML学记笔记

    <!DOCTYPE html><html lang="zh-CN"><head> <meta charset="UTF-8&qu ...

  9. 2017-2018-2 20155228 《网络对抗技术》 实验九:Web安全基础

    2017-2018-2 20155228 <网络对抗技术> 实验九:Web安全基础 1. 实践内容 1.1 标理解常用网络攻击技术的基本原理 1.2 在Webgoat实验环境下实践相关实验 ...

  10. cshtml razor

    禁止转换字符 @(Html.Raw(@item.conent)) 三目运算 @(ViewBag.submitType==1?"blue":"")