Matlab, code to eval Jacobian Matrix numerically

In summary, the conversation is about a homework question with five parts related to Newton's Method. The person has completed parts a, b, d, and e, but is struggling with understanding part c. They have been given code but are unsure how to modify it for the question. They also mention having trouble running the code given to them. The person then talks about their own code and how they wrote a Newton iteration solver, but had difficulty defining the Jacobian. They describe their MATLAB program, which involved computing the Jacobian using the definition and defining a set of equations to solve. They mention having two functions and needing to figure out the inputs and how the functions use them. Finally, they ask for help with implementing Newton's Method
  • #1
Gameowner
45
0

Homework Statement



The question is in 5 parts all mainly to do with Newton's Method, I've done parts a,b,d and e, but am struggling with the understanding of part c. They have given us the code but unsure as to how to modify my own code to suit the question.

Another problem is I don't seem to know how to run the code they gave us.



Homework Equations





The Attempt at a Solution



I've attached my code(which is the answer to part b and also what they refer to in part c as ''your Newton's method code'
 

Attachments

  • mycode.jpg
    mycode.jpg
    40.6 KB · Views: 2,328
  • Given code.jpg
    Given code.jpg
    25.9 KB · Views: 2,314
  • q2.jpg
    q2.jpg
    39.7 KB · Views: 1,326
Physics news on Phys.org
  • #2
I wrote my own Newton interation solver, and it wasn't too hard to do either (once I got my Jacobian defined correctly, 4 months to figure that one out...)

My MATLAB program was it two parts, one was computing the Jacobian by computing the Jacobian using the definition of the Jacobian. The other part defined the set of equations I wish to solve, this would usually be written as a function.

What you have here are two functions. so what you have to figure out is what are the inputs of these functions and how the function makes use of them. I would post my program but I fear that I would get slapped by the mods...
 
  • #3
Hola amigos necesito el de N-R pero con la derivada numérica y el jacobiano con la derivada numérica me pueden ayudar saludos
 

Related to Matlab, code to eval Jacobian Matrix numerically

1. What is Matlab and why is it useful for evaluating Jacobian Matrix numerically?

Matlab is a high-level programming language and interactive environment commonly used in scientific and engineering applications. It is useful for evaluating Jacobian Matrix numerically because it has built-in functions and tools for performing numerical computations and analyzing data, making it an efficient and accurate tool for this task.

2. What is a Jacobian Matrix and why is it important?

A Jacobian Matrix is a matrix of partial derivatives that describes the rate of change of a system of equations with respect to its variables. It is important because it allows us to analyze the behavior and stability of a system, as well as calculate important properties such as gradients, Hessians, and determinants.

3. How can I write code to evaluate Jacobian Matrix numerically in Matlab?

To write code to evaluate Jacobian Matrix numerically in Matlab, you can use the built-in function "jacobian" or create your own function using the "diff" function to calculate the partial derivatives. It is also important to properly define the variables and equations in your code for accurate results.

4. What are some common challenges when evaluating Jacobian Matrix numerically in Matlab?

Some common challenges when evaluating Jacobian Matrix numerically in Matlab include determining the appropriate step size for numerical differentiation, handling nonlinear equations and singularities, and dealing with errors and inaccuracies due to rounding and truncation.

5. Can Matlab be used to evaluate Jacobian Matrix for large systems?

Yes, Matlab can be used to evaluate Jacobian Matrix for large systems. However, the computational time and memory required may increase significantly for larger systems, so it is important to optimize your code and consider using parallel computing techniques for faster and more efficient evaluation.

Similar threads

  • Calculus and Beyond Homework Help
Replies
4
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • Computing and Technology
Replies
3
Views
2K
  • Calculus and Beyond Homework Help
Replies
24
Views
2K
  • General Math
Replies
11
Views
2K
  • Mechanical Engineering
Replies
2
Views
796
  • Introductory Physics Homework Help
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
871
  • Engineering and Comp Sci Homework Help
Replies
7
Views
1K
Back
Top