Help on conjugate gradient programm in matlab

In summary, the problem the author is having is trying to find the parameters a and b for the equation y = a*(1-exp(b*t)) using the conjugate gradient method. They are trying to do this using a method called Gauss Newton, but they are having trouble finding the matrix symmetric definitions for the values a and b. They hope that by getting help from the author, they will be able to find a solution to their problem.
  • #1
hdixa
1
0
hi 1.i have a problem to find the princip to programm in MATLAB the method of conjugate graduate, in fact ,my broblem is:
1.i want to study caracterisque of charge RC WHICH function is :y=a*(1-exp(b*t)) ,a is supposed to be tension maximal and b =1/RC the problem is that i have to find the parametre a and b as we have the equation y=5*(1-exp(-2*t)) + randn(length (t),1); t=1:20 ( 5 et -2 calculate theoriqement)
2. THE traitement has to be by conjugate gradient method.
in summary i have to estimate parametre a and b.

i calculate before a and b by méthode Gauss Newton that's seem great , the broblem in conjugate gradient that i have not a matrix symetrique define positive
thanks for yr help
and sorry for my bad english
 
Physics news on Phys.org
  • #2
The conjugate gradient method is an iterative algorithm for solving systems of equations. It works by taking the gradient of a function at a given point and then finding the direction of steepest descent. In this case, the system of equations can be written as y = a*(1-exp(b*t)) where t is a vector of values. To solve this system, you need to find the values of a and b that minimize the difference between the measured data (y) and the model (a*(1-exp(b*t))). This can be achieved through the conjugate gradient method. The conjugate gradient method works by taking the gradient of the error function (the difference between the measured data and the model) at a given point and then finding the direction of steepest descent. In this case, the direction of steepest descent will be in the direction of the parameters a and b. You can then take small steps in this direction and update the parameters accordingly. The method will continue until the error function reaches a minimum. To implement the conjugate gradient method in MATLAB, you will need to define the error function, its gradient, and the step size. Once these have been defined, the algorithm can be implemented in MATLAB using a loop. The loop should start with an initial guess for the parameters a and b, calculate the gradient of the error function at this point, find the direction of steepest descent, take a step in this direction, and update the parameters accordingly. The loop should continue until the error function reaches a minimum or a predefined number of iterations has been reached. Once the loop has finished, the optimized parameters a and b should be returned. I hope this helps.
 

1. What is the purpose of a conjugate gradient program in Matlab?

The purpose of a conjugate gradient program in Matlab is to solve a system of linear equations that arise from a minimization problem. It is an iterative algorithm that efficiently finds the minimum of a function by using conjugate gradient directions.

2. How does a conjugate gradient program work?

A conjugate gradient program works by iteratively finding the minimum of a function by using conjugate gradient directions. It starts with an initial guess and updates the solution by minimizing the function along the direction of the steepest descent. It then uses this updated solution to find a new direction of descent that is conjugate to the previous one. This process continues until the minimum of the function is reached.

3. What are the advantages of using a conjugate gradient program in Matlab?

There are several advantages of using a conjugate gradient program in Matlab. Firstly, it is a fast and efficient algorithm for solving large systems of linear equations. It also has a low memory requirement, making it suitable for solving problems with large matrices. Additionally, the conjugate gradient method is guaranteed to converge to the minimum of a function, unlike other optimization methods that may get stuck in local minima.

4. How do I implement a conjugate gradient program in Matlab?

To implement a conjugate gradient program in Matlab, you will need to define your objective function and its gradient. Then, you can use the built-in function "fmincg" to perform the conjugate gradient optimization. You can also write your own code by following the algorithm and updating the solution and direction of descent at each iteration.

5. Are there any limitations of using a conjugate gradient program in Matlab?

One limitation of using a conjugate gradient program in Matlab is that it can only be used for solving linear systems of equations. It is not suitable for solving nonlinear optimization problems. Additionally, the algorithm may not perform well if the problem is ill-conditioned, meaning that small changes in the input can lead to large changes in the output. In such cases, other optimization methods may be more suitable.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
978
  • MATLAB, Maple, Mathematica, LaTeX
Replies
18
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
10
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
8
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
2K
Back
Top