MATLAB Answers

0

Shooting Method to solve simple harmonic equation

Asked by Alexander Kimbley on 13 Feb 2019 at 17:01
Latest activity Edited by Alexander Kimbley on 14 Feb 2019 at 18:46
I need to solve the following harmonic equation, y'' + (a^2)*y=0 with y(0)=0 and y'(pi)=0. Obviously we can do this analytically but I require the numerical sol by taking a guess of the eigenvalue a and y at the boundary x=0. Then by intergrating the equation we compare the value of y with the boundary conditon at x=pi, to see how accurate our solution is. I'm looking for 10^-5 error or less.

  3 Comments

But y at the boundary x=0 is given as y(0)=0, so why do you want to take a guess ?
Then take a guess, integrate the function, check the boundary condition, modify the guess, use the new result at the boudary to estimate the sensitivity of changes of the guess to the result to modify the guess iteratively. This is the simple shooting method. So what is your question? Do you want us to solve your homework?
I know it's simple shooting method, I'm just very new to MATLAB, this isn't the problem I'm actually required to solve, I just thought it would be useful to get a grasp of the code first. I'll attach a link to the true problem if you're intrested. If you could help at all i would be very grateful, otherwise anything on the harmonic problem would also be amazing.
Thanks.

Sign in to comment.

0 Answers