## Shooting Method to solve simple harmonic equation

### Alexander Kimbley (view profile)

on 13 Feb 2019 at 17:01
Latest activity Edited by Alexander Kimbley

### Alexander Kimbley (view profile)

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.

Torsten

### Torsten (view profile)

on 14 Feb 2019 at 9:19
But y at the boundary x=0 is given as y(0)=0, so why do you want to take a guess ?
Jan

### Jan (view profile)

on 14 Feb 2019 at 10:18
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?
Alexander Kimbley

### Alexander Kimbley (view profile)

on 14 Feb 2019 at 18:44
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.