Skip to main content
14-Alexandrite
June 30, 2026
Question

Odesolve "That value must be a function but has the form...."

  • June 30, 2026
  • 5 replies
  • 123 views

Hi,Another Odesolve problem with an error I cannot identify. Google AI says its a syntax problem but I am damned if I can see it.

Any assuistance would be appreciated.

Regards, Ross

5 replies

19-Tanzanite
June 30, 2026

See attached:

 

Alan

remslie14-AlexandriteAuthor
14-Alexandrite
June 30, 2026

Alan, You “saved my bacon” yet again. Many Thanks. Writing functions seems to be the way to go. Do you know the reason why my initial approach failed. It seems using the first derivative approach for the variables works in some instances and not others. Is there a syntax issue that causes my original version to fail? Regards, Ross

25-Diamond I
June 30, 2026

Here's my two cents …

I did something similar to what Alan did, but I let Mathcad's Symbolics doing some work because, to be honest, I'm a bit lazy. Sadly, it didn't work without having to resort to some copy&paste and a bit of editing.

Mathcad 15 file attached

25-Diamond I
June 30, 2026

Now that the system of equations of first order works, we can also use just zeta and phi and their second order ODEs.

So we would only solve for zeta and phi. If you need their first derivatives, you could use the derivative operator, but evaluation takes significantly longer, which, of course, is especially noticeable when plotting, since the derivative has to be calculated at so many points…

EDIT: Just noticed that Alan’s plot of Xu looks quite different from mine. Not sure, why.

 

EDIT2: Got it. Looks like Alan had some minor errors in his equations. Here what I think they should look like:

EDIT3: Ooops! Had not seen that yesterday. My two versions do not match either, nor does any of them seem to match what I claimed to be Alan’s corrected version.
Guess I will have to have a deeper look at it when I find some time tomorrow.

19-Tanzanite
July 1, 2026

I should have specified that my equations need to be checked carefully - I've a tendency to rush! My main aim was to show the form of the equations with just a single first order derivative in each equation.

 

Alan

19-Tanzanite
July 1, 2026

I have done a more detailed and more careful (famous last words!) derivation of the equations - see attached (obviously Ross needs to check even more carefully)  This results in the following graphs;

 

 

Alan

remslie14-AlexandriteAuthor
14-Alexandrite
July 2, 2026

Alan,

Thanks for that detailed response. I was struggling to see how you derived the “couple of useful equations”, but now it makes sense. I have reviewed your equation construct and it seems right to me, although I will check again. Using the syymbolics certainly assists in reducing syntax errors.

I have combined your version with Werner’s in the same sheet to ensure I have identical inputs and the plots look very similar but still not quite the same☹️. There appears to be some integration drift in Alan’s version, so I am not sure how to resolve the differences. I will ponder some more. Thanks Again, Ross

 

remslie14-AlexandriteAuthor
14-Alexandrite
July 4, 2026

Alan, Werner,

When reviewing the response magnitudes I was convinced there was a problem (results way too large). In doing some fault finding I identified an error in variable assignment. Damping and Stiffness are often juxtaposed in some papers with C and K being used for either. I was using Damping CT taking it as being stiffness KT for which there is an order of magnitude difference. When stiffness KT is correctly assigned, low and behold we have convergence of both the Alan (sub a) and Werner (sub w) approaches to the differential equations.

I believe we have finally arrived at the correct solution. Thank you so much for your persistence to resolve my problem. Very much appreciated. 😁. Best Regards, Ross

19-Tanzanite
July 1, 2026

-----------------------------------------------------