How can I solve the convergence problems when solving a nonlinear system of equartions with Newton Rapshon?

Hi, I am trying to solve the following system of equations by Newton Raphson: R=S*X-Fe+Fnl,where S is a matrix,dim 3*NX3*N; X,Fe and Fnl vectors, dim 3*NX1. This last vector, Fnl, depends on X, the variable. The matrix S and the vector Fe are constant during the Problem. (R is the residual)
The first Iteration would be: X1=X0-R0*(dR0/dX)\ ,where R0 is R evaluated in X0 and (dR0/dX)\ the inverse of the matrix containing the derivatives of R respective X. That is: dR0/dX = S+ dFnl/dX. This matrix dFnl/dX is obtained numerically by finite differences. S, is a matrix that doesn´t Change.
To start the iterations I am considering the solution of the linear System: X0=S\*Fe. Then I evaluate the Fnl vector in X0 and obtain Fnl0. Fe and S are known and invariant.So I calculate R0=S*X0-Fe+Fnl0 I calculate dFnl0/dX by finite diferences dFnl0/dX=[Fnl(X+Delta)-Fnl(X)]/Delta, where: Delta=sqrt(eps)*norm(X0) (eps is the Floating-point relative accuracy) I can calculate then dR0/dX = S+ dFnl/dX I do that at every Iteration, until norm(X)<1e-12 It happens that for some values of the Parameters that define the vector Fnl the Problem isn´t converging. If anybody could help me please tryinf to find the solution I would be very grateful!!!I am not able to find a solution... Thank you very much!

6 Comments

You are not allowed to use MATLAB's "fsolve" for your problem ?
Best wishes
Torsten.
Hello Torsten, I am new in Matlab and I coded everything on my own because I thought I couldn't do it in another way. The thing is that the system is solved in the frequency domain. X is the vector of the coefficients of the Fourier series of my vector x(t) in time domain. The original system it would be : Mx¨+ Dx˙+Kx + fNL(x)= fe(t)
Obtaining X, Fe and Fnl in the frequency domain it's direct (Fnl will be the FFT of the nonlinear force evaluated in the corresponding x(t) composed of the corresponding X coefficients i each iteration).However, to obtain dFnl0/dX I first have to do the derivatives in time domain by finite differences and then take the FFT. That is,to be more exact I should have written dFnl0/dX=fft([fnl(x(t)+Delta)-fnl(x(t))]/Delta Do you think I could use fsolve?and how?
Thank you very much!
The only thing you will have to supply for fsolve is
Res:=R-(S*X-Fe+Fnl)
fsolve will approximate the derivatives on its own.
Best wishes
Torsten.
But what about Fnl? It Changes in every Iteration because it depends on the velocities dx(t), which is a vector that is reconstructed from the Fourier coefficients X calculated in each Iteration.
Thank you
As far as I understand, you want to have S*X-Fe+Fnl(X) = 0.
If X is the vector of unknowns and you can calculate S*X-Fe+Fnl(X) in every iteration given X, and S*X-Fe+Fnl has as many components as X (number of unknowns = number of equations), you can use fsolve to solve your system.
Best wishes
Torsten.

Sign in to comment.

Answers (0)

Asked:

on 12 Feb 2015

Commented:

on 16 Feb 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!