Solving a system of equations using Newton-Raphson in MatLab

6 views (last 30 days)
I'm finding it very difficult to get my head around how best to express the following system of equations in MatLab in order to solve it. The equations come from Von Karman's similarity solution to Navier-Stokes for a rotating disk flow. I've taken the original equations and turned them into a set of five 1st order ODEs, but I'm not clear at all on how I can code it
(1) g1 = U'
(2) g2 = V'
(3) W' = -2*U
(4) g1' = U^2 - (V+1)^2 + g1*W
(5) g2' = 2*U*(V+1)+g2*W
With boundary conditions U(0) = 0, V(0) = 0, W(0) = 0, U(20) = 0, V(20) = -1 and initial guesses for g1(0) = 0.52 and g2(0) = -0.61
The functions U, V, and W themselves then feed into the equations below in order to produce the three components of velocity for the flow:
(6) u = roU(n),
(7) v= roV(n),
(8) v = sqrt(q*o)W(n)
where n = zsqrt(q/o) and q= viscosity, o = angular velocity, z = the axial coordinate and r = radial coordinate
The second set of equations, (6),(7) and (8) I have simply added for clarity, so you can understand what it is I'm actually looking for. Like I said, could someone please help me understand/ show me how to apply a shooting method like Newton-Raphson to equations 1-5 in MatLab?
Many thanks, Mike

Answers (2)

Torsten
Torsten on 4 May 2015
help bvp4c
Best wishes
Torsten.
  1 Comment
Michael
Michael on 4 May 2015
Could you please help me understand how I fit my set of equations into that format? I'm not very knowledgeable at all when it comes to MatLab, and I've been banging my head against a brick wall trying to understand how I format them properly so as to fit- do I just input the right hand side of the equation, or do I take the derivative over and make it all equal zero, or what? The only examples I can find use one equation, typically in the form ax^2 + bx + c = 0. How do I make this work for a system of several derivatives? Please help

Sign in to comment.


Ananya Mondal
Ananya Mondal on 4 Sep 2016
You can find some help here chrome-http://ocw.usu.edu/Civil_and_Environmental_Engineering/Numerical_Methods_in_Civil_Engineering/NonLinearEquationsMatlab.pdf

Products

Community Treasure Hunt

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

Start Hunting!