逆Laplace数值逆变换
01拉普拉斯变换定义
1.变换公式
2. 常见函数的Laplace变换
02 Laplace数值逆变换
根据拉普拉斯逆变换的公式,可以看到,f(t)可以变成如下的公式。
#!/usr/local/bin/python
# -*- coding: gbk -*-
#============================================================
# TEST1.PY -- by Dr. ZhuoQing 2020-07-10
#
# Note:
#============================================================from headm import *#################################################################
# Function InvLap(t,omega,sigma,nint), numerically inverts a #
# Laplace transform F(s) into f(t) using the Fast Fourier #
# Transform (FFT) algorithm for a specific time "t", an #
# upper frequency limit "omega", a real parameter "sigma" #
# and the number of integration intervals "nint" . #
# #
# Function F(s) is defined in separate as Fs(s) (see code #
# below). Fs(s) has to be changed accordingly everytime the #
# user wants to invert a different function. #
# #
# I suggest to use omega>100 and nint=50*omega. The higher #
# the values for omega, the more accurate the results will be #
# in general, but at the expense of longer processing times. #
# #
# Sigma is a real number which must be a little bigger than #
# the real part of rightmost pole of the function F(s). For #
# example, F(s) = 1/s + 1/(s-2) + 1/(s+1) has poles for s=0, #
# s=2 and s=-1. Hence, sigma must be made equal to, say, #
# 2.05 so as to keep all poles at the left of this value. #
# The analytical inverse for this simple function is #
# f(t) = 1 + exp(-t) + exp(2t). For t=1.25, omega=200, #
# nint=10000 and sigma=2.05, the numerical inversion yields #
# f(1.25) ~= 13.456844516, or -0.09% away from the actual #
# analytical result, 13.468998757 (results truncated to 9 #
# decimal places). This is the example used in this code. #
# #
# Creator: Fausto Arinos de Almeida Barbuto (Calgary, Canada) #
# Date: May 18, 2002 #
# E-mail: fausto_barbuto@yahoo.ca #
# #
# Reference: #
# Huddleston, T. and Byrne, P: "Numerical Inversion of #
# Laplace Transforms", University of South Alabama, April #
# 1999 (found at http://www.eng.usouthal.edu/huddleston/ #
# SoftwareSupport/Download/Inversion99.doc) #
# #
# Usage: invoke InvLap(t,omega,sigma,nint), for t>0. #
# #
#################################################################
# We need cmath because F(s) is a function operating on the
# complex argument s = a + bj
from math import ceil
from cmath import *# *** Driver InvLap function ***
def InvLap(t,omega,sigma,nint):
# Sanity check on some parameters.omega = ceil(omega)nint = ceil(nint)if omega <= 0:omega = 200if nint <= 0:nint = 10000return (trapezoid(t,omega,sigma,nint))# *** Function trapezoid computes the numerical inversion. ***
def trapezoid(t,omega,sigma,nint):sum = 0.0delta = float(omega)/nintwi = 0.0# The for-loop below computes the FFT Inversion Algorithm.
# It is in fact the trapezoidal rule for numerical integration.for i in range(1,(nint+1)):witi = complex(0,wi*t)wf = wi + deltawfti = complex(0,wf*t)fi = (exp(witi)*Fs(complex(sigma,wi))).realff = (exp(wfti)*Fs(complex(sigma,wf))).realsum = sum + 0.5*(wf-wi)*(fi+ff)wi = wfreturn ((sum*exp(sigma*t)/pi).real)# *** The Laplace function F(s) is defined here. ***
def Fs(s):
# return (1.0/s + 1.0/(s+1.0) + 1.0/(s-2.0))return 1.0/s# Function InvLap(t,omega,sigma,nint) is invoked.
printf(InvLap(1.25, 200, 3.05, 10000))#------------------------------------------------------------
# END OF FILE : TEST1.PY
#============================================================
03一些常见函数数值逆变换结果
- f(t)=sin(t)
def Fs(s):return 1/(s*s+1)
▲ sin(t)数值逆变换结果
f(t)=t
▲ 函数t的Laplace数值逆变换结果
f(t)=exp(-t)
▲ exp(-t)函数数值逆变换结果
※ 结论
本文测试了 一个简易版本的数值Laplace逆变换的程序。
这个算法需要人工给出积分的上下限,积分限的实部等。如果参数给定不合适,计算出来的数值误差较大。
逆Laplace数值逆变换相关推荐
- Laplace数值逆运算的讨论
■ 问题提出 在博文 逆Laplace数值逆变换 给出了数值计算Laplace逆变换的简易程序.其中存在以下几个问题需要讨论: 问题1: 程序实现过程原理以及优化: 问题2: 运算参数:σ\sigma ...
- python计算机器人运动学分析_V-rep学习笔记:机器人逆运动学数值解法(The Jacobian Transpose Method)...
机器人运动学逆解的问题经常出现在动画仿真和工业机器人的轨迹规划中:We want to know how the upper joints of the hierarchy would rotate ...
- python计算机器人运动学分析_机器人学之逆运动学数值解法及SVD算法
机器人学之逆运动学数值解法及SVD算法 文章目录 前言 这半个月的业余时间研究了机器人逆运动学的解析解法和迭代数值解法,并用程序实现.由于解析法只适合于特定结构的机器人,不具有通用性,因此这里不讨论解 ...
- V-rep学习笔记:机器人逆运动学数值解法(Cyclic Coordinate Descent Method)
When performing inverse kinematics (IK) on a complicated bone chain, it can become too complex for a ...
- V-rep学习笔记:机器人逆运动学数值解法(Damped Least Squares / Levenberg-Marquardt Method)...
The damped least squares method is also called the Levenberg-Marquardt method. Levenberg-Marquardt算法 ...
- 【机器人学】《现代机器人学》学习笔记:(1)逆运动学的数值求解(C++版)
在过去的好几个月的时间,因为工作需要,把<现代机器人学>这本书认真地学习了一下,个人感觉这本书的阅读价值极高,可显著提高机器人学算法,数学能力. 这本教材是提供了所讲算法的官方的matla ...
- python输入一个三位数、输出它的逆序数值_c语言 从键盘输入一个三位数,输出该数的逆序数。c语言中从键盘输入一个三位整数...
c语言 从键盘输入一个三位数,输出该数的逆序数. c语言中从键盘输入一个三位整数 www.zhiqu.org 时间: 2020-12-08 c语言中从键盘输入一个三位数,输出该数的逆序数,可以 ...
- 信号与系统 2023(春季) 作业要求 - 第10次作业
信号与系统 2023年春季作业要求与参考答案汇总 信号与系统2022春季作业-第九次作业 信号与系统2022春季作业-第十次作业 信号与系统分析2022春季作业-参考答案:第十次作业 信号与系统 20 ...
- 一道拉普拉斯逆变换练习题和对应的数值计算方法
摘 要: 针对于一些不太适合因式分解或者留数方法进行Laplace逆变换的问题,通过数值求解可以比较方便获得时域波形.本文给出了利用梯形积分方法进行Laplace逆变换,对于指数衰减周期方波进行逆变换 ...
- laplace 偏微分方程 MATLAB help
clc,clear all syms L C I1(t) Q(t) s R = sym('R%d',[1 3]) %矩阵变量 assume([t L C R] > 0) %positive E( ...
最新文章
- Hadoop学习笔记(8) ——实战 做个倒排索引
- Python-OpenCV 杂项(一):图像绘制
- 「递归」第6集 | 是鹅厂技术青年的模样
- 使用gdal和java对TIF格式正射影像进行拉普拉斯锐化
- pythonjam怎么运行_第二十四天 PYTHON学习
- u盘iso安装服务器系统怎么安装win7系统安装方法,win7 iso,手把手教你U盘如何安装win7系统...
- 如何解除服务器注册,《天龙八部手游》服务器注册上限怎么办 服务器注册方法...
- 转:安卓android开源项目(汇总)
- 《你必须知道的.NET》书中对OCP(开放封闭)原则的阐述
- 4月23 nuTonomy的语义层(人行横道,人行道,交通信号灯,停车线,车道等)的扩展包
- 【POJ 3666】Making the Grade【线性DP】
- 计算机无法映射网络驱动器,win7系统无法映射网络驱动器的解决方法
- Linux 的shell脚本的分享,运用了多个不同的方法,实现使用脚本批量巡检服务器,非常有借鉴作用...
- springboot+责任链模式初体验
- 征途LINUX服务端脚本,征途【改版教程】-版本内脚本文件-转载于-喜欢玩网游单机站...
- ld.exe: cannot find -l?eclipse上用C/C++时,如何链接静态库?
- 计算机管理 存储空间不足,Win7系统提示“存储空间不足,无法处理此命令”怎么办?...
- PC微信3.3.0内测版(新增朋友圈功能)
- 批处理删除注册表分支方法
- 分享几个免费书籍的网站
热门文章
- [3]、Swagger——解决前后端打架问题
- SH7218T拆解手记(7)Clockworkmod recovery的编译
- sms实现wap push的方法和格式
- QQ MSN 网页互动代码
- 关于计算机音乐编创的论文,有关浅谈少儿舞蹈音乐的编创论文
- 微PE系统安装包下载及安装教程,纯净微pe系统安装
- dex2jar的使用
- 深入浅出MySQL第一天
- 算法图解第四章笔记与习题(快速排序)
- 小米随身wifi驱动linux驱动下载,小米随身无线wifi电脑驱动下载|小米随身wifi驱动 v2.5 官方版 - 软件下载 - 绿茶软件园|33LC.com...