Skip to main content
15-Moonstone
September 6, 2015
Solved

Odesolve Question

  • September 6, 2015
  • 2 replies
  • 4792 views

I have been using Odesolve successfully for a system of equations. But when I make (to me a seemingly innocuous) change, adding a term (that is zero in this case), I get the error "This value must be a function but has the form: any1". What I am doing wrong?

Best answer by AlanStevens

I think you need to do it as in the attached (note, I've redone your first solve block in such a way as to help with the second one).

Alan

2 replies

23-Emerald V
September 6, 2015

John Rudnicki wrote:

I have been using Odesolve successfully for a system of equations. But when I make (to me a seemingly innocuous) change, adding a term (that is zero in this case), I get the error "This value must be a function but has the form: any1". What I am doing wrong?

You've added another derivative (dv(t)/dt) without a relational / initialization equation, hence you've got more derivatives to solve for than you've got equations; the fact you've multiplied it by zero doesn't make any difference ... It Knows!

Stuart

15-Moonstone
September 7, 2015

Sorry if I am being dense, but dont I still have four equations for v, tau, phi and theta, with four initial conditions? If I differentiated the 4th equation, for tau, (I was trying to avoid this), dv(t)/dt would enter that way even without the adding it in the first equation.

19-Tanzanite
September 7, 2015

I think you need to do it as in the attached (note, I've redone your first solve block in such a way as to help with the second one).

Alan

15-Moonstone
September 8, 2015

Thanks. So basically, I needed to turn the constraint tau = ... into an ode for v(t). This is what I did in the 2nd worksheet I posted but I like yours better.

19-Tanzanite
September 8, 2015

Sorry, I should have looked at your second worksheet first, but didn't!  In fact you have expressed the equations more succinctly than I did.  However, for some reason, in your second sheet, in the equation for dphi/dt you replaced the v(t)/vratio of your first sheet with ln(v(t)/vratio).  This might have led to a mix-up that explains why your two approaches in the second worksheet don't result in graphs that lie on top of each other.

Alan