Algorithm code
Solinit = bvpinit (linspace (, 5), [1 0]); % linspace (, 5) is the initial mesh, [] is the initial estimated value Sol = bvp4c (@ twoode, @ twobc, solinit); % twoode and twobc are the functions of the differential equation and the boundary condition, respectively, solinit is structured X = linspace (); % determines the X range y = Deval (sol, x); % determines the y range plot (X, Y (1 ,:)); % plot the graph % of Y-X to define the twoode function (the following code is saved as
In essence, Newtons is the iterative way, so that the approximate solution (Taylor Formula) constantly approximation to the real solution, when the accuracy requirements, you can think of the approximate solution as the real solutionThe following Newtons method is implemented in R languageNewtons{indexKwhile (K{X1XNormif (NORM{IndexBreak}K}ObjList (ROOT=X,IT=K,INDEX=INDEX,FUNVAL=OBJ$F,JACOBI=OBJ$J)}Now to construct the equation (group) to be solved and its jacobj matrixFuns{FJList (F=F,J=J)}Calc
) pseudo-code writing:Variable types are usually not writtenOperators are consistent with language, and or notCopy Language AContent Interchange Afor VAR init to limit by incr do//init assignment var variable if varEndIf ThenDoelse thenElseEnd If 1. Theory of the solution of the linear equation groupFor a linear equation groupIdentification of the solution:Step1: Elementary Line transformation to row-stepped matrix, Gaussian elimination elementAlgorithm:Step2 Solution:Algorithm:Step3: sufficien
The continues to solve the equation group. Gauss elimination Method: http://blog.csdn.net/qq_26025363/article/details/53027926 Column main element Gauss elimination method: Http://blog.csdn.net/qq_ 26025363/article/details/53044843, This time using LU decomposition to solve a system of equations, the idea is to decompose a matrix into a unit of the lower triangular matrix L and an upper triangular matrix U, which belongs to the triangular decompos
Afternoon Group of friends on a problem, the following posted figure:
Just for a while, the answers of the great gods began to gush out, and the following answers were posted:
1:for i in {111..999..111}
2:do
3:
4:for j in {1..9..1}
5:do
6:c=
[MATLAB] numerical calculation of differential equation sets
We use the ode45 function When we cannot use dsolve to do symbolic solving.
The function prototype is
[T,y] = Ode45 (odefun,tspan,y0) Example
[t,y] = Ode45 (odefun,tspan,y0,options)
/* Solve the equation micro_lee using the string truncation method */
# Include # Include # Include
Void asterisk_triangle (int n );
Float F (float X){Return x * (X-5) + 16)-80;}
Float xpoint (float X1, float x2){Return (x1 * F (X2)-X2 * F (X1)/(f (
Question address: http://acm.hdu.edu.cn/showproblem.php? PID = 1, 4569
Question: Here is a polynomial with a maximum power of 4. Let you find an X to make the result p * P 0.
Question: F (x) % (P * P) = 0, f (x) % P = 0, f (x) % P = 0 then f (x + p)
Solution x for solving AX = d
1. Lu Decomposition
% File: mylu. m
Function [L, u] = mylu (a) % implements Lu decomposition of matrix A. L is the lower Triangle Matrix A [n, n] = size (); L = zeros (n, n); U = zeros (n, n); for I = 1: n l (I, I) =
# Include
Long long Mod (long a, long B)
{Return (a % B + B) % B ;}
Struct triple {long d, X, Y ;};
Long long
Euclid
(Long a, long B)
{
If (B = 0) return;
Else return
Euclid
(B,
Poj1830 is one of the few Chinese questions! I don't need to ask for a visit from Google.
DescriptionThere are n identical switches, each of which is associated with some switches. Whenever you turn a switch on or off, other switches associated
# Include
# Include
# Include
# Define N 3
Void guass (double A [] [n + 1], double X [])
{
Double L [N];
Int I, J, K;
L [0] = 1.0;
For (I = 0; I {
If (FABS (A [I] [I]) {
Printf ("cannot solve! /N ");
Return;
}
For (j = I + 1; j L [J] = A [J]
Question link:
Http://uva.onlinejudge.org/index.php? Option = com_onlinejudge & Itemid = 8 & category = 457 & page = show_problem & problem = 1258
1. perform the shift in a peering manner. If the original value is 1 + 2 = 4-5 + 6, then the
Original article: http://blog.stevenlevithan.com/archives/algebra-with-regexesI calculated the result based on the regular expression in the original text. Php example:
Copy codeThe Code is as follows: /**
* Calculate Ax + By = C
*/
Function suan ($
Question:
X1 = x-SQRT (y)Y1 = Y-SQRT (X)
For X1 and Y1, calculate X and Y. If there are multiple types, the output X is the smallest.
Analysis:
Convert the equation
X = X1 + SQRT (y );
Y = Y1 + SQRT (X );
X> = x1, Y> = y1.
So we can
As if it was a hash, direct enumeration will definitely time out. The AB records must be divided into two groups. Then find the corresponding CD There are still many questions For example, the end of * 16 And amazing STL # Include #
A quartile quadratic equation is used to give the values of a, B, c, d, and xi between [-100,100] but not equal to zero. How many solutions are there when the equation is equal to zero.
Questions can be violent... but they are always not harmonious.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.