原创 基於列掃描的方法求解線性方程組

基於列掃描的方法求解線性方程組 % 這種方法精度高,但是對初始解的要求比較高 clear; clc n = 10; % 方程組階數 A = rand(n); u = (1:n)'; % 精確解 b = A*u; % 右端項 nw

原创 不完全QR分解

Program QR Implicit none Integer :: i, j Integer, parameter :: m = 4, n = 3 Real(kind=8), parameter :: A(m,n)

原创 Fortran/Matlab/Python三種編程語言數組排列方式小記

對一部分做數值計算的初級編程人員而言,往往分不清數組元素的優先排列順序,本文以Fortran、Matlab、Python三種編程語言進行簡要說明。 1. Fortran:列優先 integer :: a(2,2) a = reshap

原创 Fortran:數組函數詳解

聲明:本博文翻譯自:https://www.tutorialspoint.com/fortran/location.htm等相關網頁 上一篇博文講了數組的基本用法。這一篇博文着重講解關於數組內置函數的用法。 1. 向量與矩陣乘法

原创 三次樣條插值fortran程序

!// 四類三次樣條插值 !// 1.自然三次樣條插值; 2.鉗制三次樣條插值; 3.曲率(二階導數)任意調整的三次樣條插值; 4.拋物線端點的三次樣條曲線; 5.非紐結三次樣條(matlab中的命令爲spline) Module Ca

原创 LM算法求解最小二乘問題

Module VarLM Implicit none !//Nparas爲參數個數,Ndata爲數據個數,Niters爲最大迭代次數 Integer ,Parameter :: Nparas = 2,Ndata =

原创 fortran派生數據類型的動態數組

program test implicit none type :: point real :: x real :: y e

原创 Fortran:do循環

聲明:本博文翻譯自:https://www.tutorialspoint.com/fortran/fortran_loops.htm 編程語言提供各種控制結構,允許更復雜的執行路徑。 循環語句允許我們多次執行一個語句或一組語句。

原创 fortran使用MKL函數庫計算大型稀疏矩陣的特徵值與特徵向量

program scsrev implicit none integer, parameter :: n = 3 !// depend on your equation integer

原创 Fortran計算矩陣2範數

Intel fortran編譯器自帶的MKL函數庫中,只有計算矩陣1範數和無窮範數的程序,所以本文給出fortran使用MKL函數庫計算矩陣2範數的示例。 而矩陣的2範數的值近似於max(svd(A)) 運行環境:win10+vs2

原创 matlab求解逆矩陣_1

clear; clc; t = linspace(0, pi/2, 30)'; x0 = sin(t); n = numel(x0); dt = 1e-9; % A = rand(n); A = hilb(n); temp = A'

原创 matlab求解逆矩陣_3

clear; clc; n = 40; dt = 1e-12; t = linspace(0,2*pi,n)'; A = rand(n); temp = A'; A = temp*A; x0 = cos(t); b = A*

原创 matlab求解逆矩陣_2

%|------------------------------------------------------------------------| %|

原创 使用MKL中的有關函數計算共軛梯度法

program ConjugateGradientMethods use blas95 implicit none integer :: i integer, parame

原创 matlab求解逆矩陣

clear; clc; x0 = sin(0:0.1:10*pi)'; n = numel(x0); dt = 1e-8; A = rand(n); temp = A'; A = temp*A; b = A*x0; H = -