0

I am trying to solve numerically three simultaneous ODE functions:

dw/ds = sin(theta)

dx1/ds = cos(theta)

dtheta/ds = - a * cos(theta) * (w-w0) + a * sin(theta) * x1

I am solving for a column which is separated in two halves, I want to plot w against x1 and have a positive w (something that is seeming to be impossible right now). There are three main functions:

  • first_sec_w: the one that is using RK4 method with the already found out initial value for theta (using shoot_first and shoot_second).
  • shoot_first: a function that solves the function using RK4 assuming initial values for theta until the boundary condition of 0 at L0/2 is achieved and return this initial value.
  • shoot_second: pretty much does the same thing as the above, but it starts from L0 and goes until L0/2.

Can anyone help me out?

I will upload the codes so here it does not appear too messy.

RK.zip

Mostafiz
  • 7,243
  • 3
  • 28
  • 42
  • dan, what is the problem? – Amir Sagiv Jul 16 '16 at 12:33
  • I am getting weird plots, it seems that my initial guesses for the shooting method are not alright. Do you any way to do the initial value guesses knowing a boundary value (in my case w'(L0/2)=0 )? – dan.ABQ Jul 18 '16 at 23:45

0 Answers0