Generate Possion Dis. step1:Generate a random number between [0,1] step2:Let u=F(x)=1-[(1/e)x] step3:Slove x=1/F(u) step4:Repeat Step1~Step3 by using different u,you can get x1,x2,x3,...,xn step5:If the first packet was generated at time [0], than the second packet will be generated at time [0+x1],The third packet will be generated at time [0+x1+x2], and so on …. Random-number generation 1.static method random from class Math -Returns doubles in the range 0.0 <= x < 1.0 2.class Random from package java.util -Can produce pseudorandom boolean, byte, float, double, int, long and Gaussian values -Is seeded with the current time of day to generate different sequences of numbers each time the program executes
標簽: Generate Possion between random
上傳時間: 2017-05-25
上傳用戶:bibirnovis
BP神經網絡程序,C語言源代碼 如下: #include "iostream.h" #include "iomanip.h" #include "stdlib.h" #include "Math.h" #include "stdio.h" #include "time.h" #include "fstream.h" #define N 120 //學習樣本個數 #define IN 3 //輸入層神經元數目 #define HN 2 //隱層神經元數目 #define ON 2 //輸出層神經元數目 #define Z 20000 //舊權值保存-》每次study的權值都保存下來 double P[IN] //單個樣本輸入數據 double T[ON] //單個樣本教師數據 double U11[IN][HN] //輸入層至第一隱層權值 double V[HN][ON] //隱層至輸出層權值 double X1[HN] //第一隱層的輸入 double Y[ON] //輸出層的輸入 double H1[HN] //第一隱層的輸出 double O[ON] //輸出層的輸出 double YU_HN1[HN] //第一隱層的閾值 double YU_ON[ON] //輸出層的閾值 double err_m[N] //第m個樣本的總誤差 double a //學習效率 double alpha //動量因子
標簽: include iostream iomanip stdlib
上傳時間: 2017-06-15
上傳用戶:xinzhch
此程序是用來計算高等數學里的微積分運算的,調用一些Math的方法
上傳時間: 2013-12-23
上傳用戶:王慶才
此文檔包含有AOP,Annotation,xml讀寫,一般文件讀寫,各種屬性文件讀寫, 安全控制基礎,還有Reflect功能的測試。 還有在Math中,自己寫一個數的n次冪算式 各種框架的核心基礎基本都在這里邊,當然只是一個簡單基礎類的探討,更 深的技術,需要在具體環境下在擴展設計...
上傳時間: 2013-12-31
上傳用戶:小碼農lz
1.入門教程文件夾 在該文件夾中包括了JavaScript的大部分知識,可以幫助讀者快速入門。主要包括:JavaScript語言概述,JavaScript語言入門,JavaScript事件處理,JavaScript基于對象編程,文檔對象模型(DOM),String、Math、Array等數據對象,Window及相關頂級對象,Document對象等 。 2.視頻動畫文件夾 在該文件夾中包括5個視頻動畫,可以通過他們快速學習JavaScript。
標簽: JavaScript 入門教程 分
上傳時間: 2017-09-02
上傳用戶:sdq_123
自己寫的算平方根的函數sqrt,并且用C庫的sqrt進行了驗證,十分精確。可以用在沒有Math庫的情況,尤其是嵌入式程序中。
上傳時間: 2017-09-09
上傳用戶:comua
本程序使用數值分析的方法找出任意函數指定區間內的所有實根。算法是通過一系列Chebyshev多項式畢竟目標函數,然后使用一種高效的數值分析方法(J.P. Boyd [see Appl. Num. Math. 56 pp.1077-1091 (2006)])求解出逼近函數的根。
上傳時間: 2015-04-02
上傳用戶:chen971103
Boost C++ Libraries Free peer-reviewed portable C++ source libraries Boost C++ Libraries 基本上是一個免費的 C++ 的跨平臺函式庫集合,基本上應該可以把它視為 C++ STL 的功能再延伸;他最大的特色在於他是一個經過「同行評審」(peer review,可參考維基百科)、開放原始碼的函式庫,而且有許多 Boost 的函式庫是由 C++ 標準委員會的人開發的,同時部分函式庫的功能也已經成為 C++ TR1 (Technical Report 1,參考維基百科)、TR2、或是 C++ 0x 的標準了。 它的官方網站是:http://www.boost.org/,包含了 104 個不同的 library;由於他提供的函式庫非常地多,的內容也非常地多元,根據官方的分類,大致上可以分為下面這二十類: 字串和文字處理(String and text processing) 容器(Containers) Iterators 演算法(Algorithms) Function objects and higher-order programming 泛型(Generic Programming) Template Metaprogramming Preprocessor Metaprogramming Concurrent Programming 數學與數字(Math and numerics) 正確性與測試(Correctness and testing) 資料結構(Data structures) 影像處理(Image processing) 輸入、輸出(Input/Output) Inter-language support 記憶體(Memory) 語法分析(Parsing) 程式介面(Programming Interfaces) 其他雜項 Broken compiler workarounds 其中每一個分類,又都包含了一個或多個函式庫,可以說是功能相當豐富。
上傳時間: 2015-05-15
上傳用戶:fangfeng
matlab有限元網格劃分程序 DistMesh is a simple MATLAB code for generation of unstructured triangular and tetrahedral meshes. It was developed by Per-Olof Persson (now at UC Berkeley) and Gilbert Strang in the Department of Mathematics at MIT. A detailed description of the program is provided in our SIAM Review paper, see documentation below. One reason that the code is short and simple is that the geometries are specified by Signed Distance Functions. These give the shortest distance from any point in space to the boundary of the domain. The sign is negative inside the region and positive outside. A simple example is the unit circle in 2-D, which has the distance function d=r-1, where r is the distance from the origin. For more complicated geometries the distance function can be computed by interpolation between values on a grid, a common representation for level set methods. For the actual mesh generation, DistMesh uses the Delaunay triangulation routine in MATLAB and tries to optimize the node locations by a force-based smoothing procedure. The topology is regularly updated by Delaunay. The boundary points are only allowed to move tangentially to the boundary by projections using the distance function. This iterative procedure typically results in very well-shaped meshes. Our aim with this code is simplicity, so that everyone can understand the code and modify it according to their needs. The code is not entirely robust (that is, it might not terminate and return a well-shaped mesh), and it is relatively slow. However, our current research shows that these issues can be resolved in an optimized C++ code, and we believe our simple MATLAB code is important for demonstration of the underlying principles. To use the code, simply download it from below and run it from MATLAB. For a quick demonstration, type "meshdemo2d" or "meshdemond". For more details see the documentation.
標簽: matlab有限元網格劃分程序
上傳時間: 2015-08-12
上傳用戶:凜風拂衣袖
題目:古典問題:有一對兔子,從出生后第3個月起每個月都生一對兔子,小兔子長到第三個月后每個月又生一對兔子,假如兔子都不死,問每個月的兔子總數為多少? //這是一個菲波拉契數列問題 public class lianxi01 { public static void main(String[] args) { System.out.println("第1個月的兔子對數: 1"); System.out.println("第2個月的兔子對數: 1"); int f1 = 1, f2 = 1, f, M=24; for(int i=3; i<=M; i++) { f = f2; f2 = f1 + f2; f1 = f; System.out.println("第" + i +"個月的兔子對數: "+f2); } } } 【程序2】 題目:判斷101-200之間有多少個素數,并輸出所有素數。 程序分析:判斷素數的方法:用一個數分別去除2到sqrt(這個數),如果能被整除, 則表明此數不是素數,反之是素數。 public class lianxi02 { public static void main(String[] args) { int count = 0; for(int i=101; i<200; i+=2) { boolean b = false; for(int j=2; j<=Math.sqrt(i); j++) { if(i % j == 0) { b = false; break; } else { b = true; } } if(b == true) {count ++;System.out.println(i );} } System.out.println( "素數個數是: " + count); } } 【程序3】 題目:打印出所有的 "水仙花數 ",所謂 "水仙花數 "是指一個三位數,其各位數字立方和等于該數本身。例如:153是一個 "水仙花數 ",因為153=1的三次方+5的三次方+3的三次方。 public class lianxi03 { public static void main(String[] args) { int b1, b2, b3;
上傳時間: 2017-12-24
上傳用戶:Ariza