十元三次(或者更高)方程组怎么解?
楼主 · 1 楼
一个十元三次(再过几个月,将会是五次的)方程组,单位要我写个程序来解,写程序我会,十元一次我也会,一元三次我也会,但二元三次我就不会啦,更别说十元三次。
我查了下,据说五次方程没有代数解,不懂,不知道什么意思。那用计算机求近似解可以吗?我是搞工程的,准不准确没有关系,只要近似就可以,反正工程计量连十位有效数字都用不了。
哪位GGJJ指教一下,多元高次方程有没有准确解法?有没有求近似解的解法?
如果没有,我就正好直接向老板报告,让他因另想高招啦。
我查了下,据说五次方程没有代数解,不懂,不知道什么意思。那用计算机求近似解可以吗?我是搞工程的,准不准确没有关系,只要近似就可以,反正工程计量连十位有效数字都用不了。
哪位GGJJ指教一下,多元高次方程有没有准确解法?有没有求近似解的解法?
如果没有,我就正好直接向老板报告,让他因另想高招啦。
2 楼
就一般形式而论,解一个十元三次方程组相当于解一个一元三十次方程(未证明该结论)。
3 楼
谢谢大哥,再请教一下,那一元三十次有没有一般性的解法。
我们是搞工程的,不要求准确,只要近似值就可以啦。有个五六位有效数字就足够了。
我们是搞工程的,不要求准确,只要近似值就可以啦。有个五六位有效数字就足够了。
4 楼
没有一般性解法.
你可以把方程化简(高次到低次,非线性到线性),然后看看议程的特征,接着根据方程的特征来解.
如果想偷赖的话可以用matlab算一下.
你可以把方程化简(高次到低次,非线性到线性),然后看看议程的特征,接着根据方程的特征来解.
如果想偷赖的话可以用matlab算一下.
5 楼
不好意思,matlab听说过但没有用过,据说学一下挺难的,所以先请教一下,任意一个十元三次方程组输入进去,它都能解出近似值来吗?(如果不计时间的话)既然没有一般性解法,人都无法解,没有努力的方向,它向哪里用劲呢?
不好意思,我对matlab外行,故有此问。
我搞电脑的,数学不行,但单位有解多元高次的需要,如果数学好,我想应该可以从算法本身入手,简化方程,但……
现在才知道当年的数学基础太差了。
不好意思,我对matlab外行,故有此问。
我搞电脑的,数学不行,但单位有解多元高次的需要,如果数学好,我想应该可以从算法本身入手,简化方程,但……
现在才知道当年的数学基础太差了。
6 楼
FSOLVE solves systems of nonlinear equations of several
variables.
FSOLVE attempts to solve equations of the form:
F(X)=0 where F and X may be vectors or matrices.
X=FSOLVE(FUN,X0) starts at the matrix X0 and tries to solve the
equations in FUN. FUN accepts input X and returns a vector (matrix) of
equation values F evaluated at X.
X=FSOLVE(FUN,X0,OPTIONS) solves the equations with the default optimization
parameters replaced by values in the structure OPTIONS, an argument
created with the OPTIMSET function. See OPTIMSET for details. Used
options are Display, TolX, TolFun, DerivativeCheck, Diagnostics,
FunValCheck, Jacobian, JacobMult, JacobPattern, LineSearchType,
NonlEqnAlgorithm, MaxFunEvals, MaxIter, OutputFcn, DiffMinChange and
DiffMaxChange, LargeScale, MaxPCGIter, PrecondBandWidth, TolPCG, and
TypicalX. Use the Jacobian option to specify that FUN also returns a
second output argument J that is the Jacobian matrix at the point X. If
FUN returns a vector F of m components when X has length n, then J is
an m-by-n matrix where J(i,j) is the partial derivative of F(i) with
respect to x(j). (Note that the Jacobian J is the transpose of the
gradient of F.)
[X,FVAL]=FSOLVE(FUN,X0,...) returns the value of the equations FUN at X.
[X,FVAL,EXITFLAG]=FSOLVE(FUN,X0,...) returns an EXITFLAG that describes the
exit condition of FSOLVE. Possible values of EXITFLAG and the corresponding
exit conditions are
1 FSOLVE converged to a solution X.
2 Change in X smaller than the specified tolerance.
3 Change in the residual smaller than the specified tolerance.
4 Magnitude of search direction smaller than the specified tolerance.
0 Maximum number of function evaluations or iterations reached.
-1 Algorithm terminated by the output function.
-2 Algorithm seems to be converging to a point that is not a root.
-3 Trust region radius became too small.
-4 Line search cannot sufficiently decrease the residual along the current
search direction.
[X,FVAL,EXITFLAG,OUTPUT]=FSOLVE(FUN,X0,...) returns a structure OUTPUT
with the number of iterations taken in OUTPUT.iterations, the number of
function evaluations in OUTPUT.funcCount, the algorithm used in OUTPUT.algorithm,
the number of CG iterations (if used) in OUTPUT.cgiterations, the first-order
optimality (if used) in OUTPUT.firstorderopt, and the exit message in
OUTPUT.message.
[X,FVAL,EXITFLAG,OUTPUT,JACOB]=FSOLVE(FUN,X0,...) returns the
Jacobian of FUN at X.
Examples
FUN can be specified using @:
x = fsolve(@myfun,[2 3 4],optimset('Display','iter'))
where myfun is a MATLAB function such as:
function F = myfun(x)
F = sin(x);
FUN can also be an anonymous function:
x = fsolve(@(x) sin(3*x),[1 4],optimset('Display','off'))
If FUN is parameterized, you can use anonymous functions to capture the
problem-dependent parameters. Suppose you want to solve the system of
nonlinear equations given in the function myfun, which is parameterized
by its second argument c. Here myfun is an M-file function such as
function F = myfun(x,c)
F = [ 2*x(1) - x(2) - exp(c*x(1))
-x(1) + 2*x(2) - exp(c*x(2))];
To solve the system of equations for a specific value of c, first assign the
value to c. Then create a one-argument anonymous function that captures
that value of c and calls myfun with two arguments. Finally, pass this anonymous
function to FSOLVE:
c = -1; % define parameter first
x = fsolve(@(x) myfun(x,c),[-5;-5])
See also optimset, lsqnonlin, @, inline.
610912楼不要误导人家
1元30次 和 10元3次 有质的区别
10元3次方程 通常肯定是有无穷多个解的
10元3次方程组,可以用数值方法求解,随便找一本数值分析的书,都会有所介绍。
不要试图对10元3次方程组用公式求解
FSOLVE attempts to solve equations of the form:
F(X)=0 where F and X may be vectors or matrices.
X=FSOLVE(FUN,X0) starts at the matrix X0 and tries to solve the
equations in FUN. FUN accepts input X and returns a vector (matrix) of
equation values F evaluated at X.
X=FSOLVE(FUN,X0,OPTIONS) solves the equations with the default optimization
parameters replaced by values in the structure OPTIONS, an argument
created with the OPTIMSET function. See OPTIMSET for details. Used
options are Display, TolX, TolFun, DerivativeCheck, Diagnostics,
FunValCheck, Jacobian, JacobMult, JacobPattern, LineSearchType,
NonlEqnAlgorithm, MaxFunEvals, MaxIter, OutputFcn, DiffMinChange and
DiffMaxChange, LargeScale, MaxPCGIter, PrecondBandWidth, TolPCG, and
TypicalX. Use the Jacobian option to specify that FUN also returns a
second output argument J that is the Jacobian matrix at the point X. If
FUN returns a vector F of m components when X has length n, then J is
an m-by-n matrix where J(i,j) is the partial derivative of F(i) with
respect to x(j). (Note that the Jacobian J is the transpose of the
gradient of F.)
[X,FVAL]=FSOLVE(FUN,X0,...) returns the value of the equations FUN at X.
[X,FVAL,EXITFLAG]=FSOLVE(FUN,X0,...) returns an EXITFLAG that describes the
exit condition of FSOLVE. Possible values of EXITFLAG and the corresponding
exit conditions are
1 FSOLVE converged to a solution X.
2 Change in X smaller than the specified tolerance.
3 Change in the residual smaller than the specified tolerance.
4 Magnitude of search direction smaller than the specified tolerance.
0 Maximum number of function evaluations or iterations reached.
-1 Algorithm terminated by the output function.
-2 Algorithm seems to be converging to a point that is not a root.
-3 Trust region radius became too small.
-4 Line search cannot sufficiently decrease the residual along the current
search direction.
[X,FVAL,EXITFLAG,OUTPUT]=FSOLVE(FUN,X0,...) returns a structure OUTPUT
with the number of iterations taken in OUTPUT.iterations, the number of
function evaluations in OUTPUT.funcCount, the algorithm used in OUTPUT.algorithm,
the number of CG iterations (if used) in OUTPUT.cgiterations, the first-order
optimality (if used) in OUTPUT.firstorderopt, and the exit message in
OUTPUT.message.
[X,FVAL,EXITFLAG,OUTPUT,JACOB]=FSOLVE(FUN,X0,...) returns the
Jacobian of FUN at X.
Examples
FUN can be specified using @:
x = fsolve(@myfun,[2 3 4],optimset('Display','iter'))
where myfun is a MATLAB function such as:
function F = myfun(x)
F = sin(x);
FUN can also be an anonymous function:
x = fsolve(@(x) sin(3*x),[1 4],optimset('Display','off'))
If FUN is parameterized, you can use anonymous functions to capture the
problem-dependent parameters. Suppose you want to solve the system of
nonlinear equations given in the function myfun, which is parameterized
by its second argument c. Here myfun is an M-file function such as
function F = myfun(x,c)
F = [ 2*x(1) - x(2) - exp(c*x(1))
-x(1) + 2*x(2) - exp(c*x(2))];
To solve the system of equations for a specific value of c, first assign the
value to c. Then create a one-argument anonymous function that captures
that value of c and calls myfun with two arguments. Finally, pass this anonymous
function to FSOLVE:
c = -1; % define parameter first
x = fsolve(@(x) myfun(x,c),[-5;-5])
See also optimset, lsqnonlin, @, inline.
610912楼不要误导人家
1元30次 和 10元3次 有质的区别
10元3次方程 通常肯定是有无穷多个解的
10元3次方程组,可以用数值方法求解,随便找一本数值分析的书,都会有所介绍。
不要试图对10元3次方程组用公式求解
7 楼
这个用迭代的方法可以求数值解的
建议lz把题目发上来
建议lz把题目发上来