Start a topic
With the exception of Windchill, The PTC Community is on read-only status until April 6 in preparation for moving our community to a new platform. Learn more here
cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

The PTC Community is on temporary read only status in preparation for moving our community to a new platform. Learn more here

Translate the entire conversation x

Odesolve Block won't solve

remslie
14-Alexandrite

Odesolve Block won't solve

Hi, I have been trying to get this non-linear gear dynamics system of ODE's to solve but for the life of me cannot seem to correct the errors.

The attached sheet has several attempts at the end to write the equations and initial conditions in different formats but all give "too few initial conditions" or a"floating point error". Like most programming errors its probably glaringly simple!

Any assistance would be appreciated.

Regards,

Ross

 

ACCEPTED SOLUTION

Accepted Solutions
Werner_E
25-Diamond I
(To:remslie)

The error tracing feature is misleading and incorrect in this case.

 

Your amplitude vector A starts with a value zero!

Using this the function Tzz will throw a division by zero error and so does Δkf used in the solve block.

 

So I guess you have three options:

1) Omit the first entry in vector A and use i := 1 .. N3 instead of i := 0 .. N3

2) define vector A so that it does not start with value AA := 0  but rather AA := 1 or AA := 10-6 or whatever seems appropriate

3) Rewrite function  Tzz so that it will return a meaningful result if A=0.

 

Being lazy by nature I used option #1

grafik.png

and got this result

grafik.png

View solution in original post

13 REPLIES 13
Werner_E
25-Diamond I
(To:remslie)

It seems you haven't attached a file!
 
Due to a bug in the forum software, which has persisted already for an unbearably long time and still hasn't been fixed, directly attaching Mathcad and Prime files fails (depending on the browser and the attachment method).
 
The workaround is to put the file into a ZIP archive and then attach that here.
Yes, that's quite annoying, and not without a certain irony that the Prime forum doesn't accept Prime files, but accepts other file types like ZIP or PDF.
 
remslie
14-Alexandrite
(To:Werner_E)

Werner,

Thanks for that lightening fast response. I have attached a Zip file. Lets see how that goes.

Regards,

Ross

Werner_E
25-Diamond I
(To:remslie)

I must confess that your sheet is far too demanding for me so I could not go into the details.

What i noticed us that your odesolve-block function xv fails for any value in vector A and the error traces back to this expression

Werner_E_0-1770536917260.png

I am not sure if the problem might have to do with the fact the the magnitude of Deltak(0) is in the range of as high as 10^10 ?

 

remslie
14-Alexandrite
(To:Werner_E)

Werner,

The stiffness function DeltaK(t) is the gear tooth stiffness with a magnitude of 10^10 is correct. I have had similar programs with this stiffness function solve successfully. The floating point error may relate to the g(lambda) variable which is the relative displacement across the gear mesh due to displacements u, v and rotations thetaMill and thetaPin .

 

At the bottom of the sheet I have 3 different Odesolve versions, the first that you are refering to fails due to a floating point error. The following 2 solve blocks use different syntax for the variables and initial conditions and these fail due to "insufficient initial conditions". Can you comment on what might cause these solve blocks to fail?

Thanks 

Ross

Hi Ross

In the Given-Odesolve block on page 10 and 11.

Includes the variable A in the equations within the block:  A is defined above the block as a 21 element vector?  Is that intended in the equation or is A intended to be a separate single variable.

Capture.JPG

You parameterized the solve block again with A.  Is this the vector A or a single variable A?

Capture2.JPG

Using the function in the program A is a single variable as one element of the A vector?

Capture3.JPG

 

Cheers

Terry

@terryhendicott 

From what I understand the "A" in the solve block equation should be a single scalar amplitude value (in the range from 0 to 1).

If "A" would be meant to be a vector, then function thetamotdot(t) would return a vector as its result which would not correspond to the initial condition, where its value at t=0 should be just single 0.

 

Problem is that the parametrized solve block fails for any amplitude value provided

Werner_E_0-1770585204346.png

The goal seems to be to create ten 21 x 501 matrices. One for each of the 10 function the odesolve block should solve for, The rows of these matrices would be for each of the 21 amplitude values (from 0 to 1..909) in vector A, the columns for 501 time values from 0 to t.end=11.491. 

 

@remslie 

The problem with the second solve block is that an undefined function F(t) is introduced.

11 equations but just 10 initial conditions is what triggers the error message.

If we add function name "F" to the functions to solve for (even if there is no ODE for F) for and add a (dummy ?) we get a "Singular system" error.

Werner_E_1-1770586111494.png

I can't say why or how to fix it, though.

 

In your third try at the end you already suspected that F may need an IC as well.

You again have 11 equations but just 10 ICs and functions to solve for.

But if I add this IC and also add "F" in the list of functions to solve, this time Mathcad still moans about too few ICs

Werner_E_2-1770586408489.png

Again unfortunately I have no idea how to fix this 😞

 

Generally in such a situation it might make sense to check and re-check all equations involved and look, if there is some kind of inconsistency, redundancy or incompleteness.

I could not spot any at first glance, but then, as i already wrote, the system seems to be too demanding for me.

 



Werner_E
25-Diamond I
(To:Werner_E)

The error message in the last Solve block bothered me, so I took another look at it.
 
I only just noticed that, unlike in the first Solve block, you had also used the second derivative here. Of course, as you did, this requires two initial conditions. However, you still have the functions udot, etc., in the Solve block, and there are no initial conditions for these (now unnecessary) functions (and they are sensibly not included in the solution vector). In that sense, Mathcad's error message about the insufficient number of initial conditions makes sense.
 
I removed all these various ...dot functions and also moved the Mesh Force function F to a separate function in front of the solve block (it may be better, though, to use the expression itself directly, as you did in the first Solve block). After that, we're unfortunately back to square one – namely, the floating point error, which possibly means that a quantity exceeds the maximum value of 10^307.
 
And yes, if I use 0.234 as the end value for t instead of your t.end=11.491, we get a solution (I was using A=1.23).
Werner_E_3-1770588642844.png

 

 

I immediately tried the very same in your first solve block and after I set the end value to an even lower value of 0.22 it worked again!

I was first confused because instead of functions there were shown NaN's

Werner_E_4-1770589034184.png

but then I noticed that there is a difference between displaying the result as 'Table' or as "Matrix'.

Werner_E_5-1770589108901.png

I assigned the result to a vector of functions

Werner_E_7-1770589292863.png

 

As you can see the magnitude of ALL functions and their derivatives are about to exceed the allowable limit (which actually is 21024-1 ≈ 1.797*10308) if we let t come close to or exceed 0.22.

So that's clearly the reason for the "floating point error" message and it means that you sure will have to recheck your equations and/or the values you feed into them. I definitely can't help doing so as I have no experience whatsoever in your field of work.

Here plots of some of the functions which clearly show whats happening:

Werner_E_0-1770591906189.png

 

BTW, it may be a matter of personal preference but I would prefer an approach without all those ...dot functions and use the second derivatives instead. If you need to see the derivative functions you can always define them after the solve block as well. On the other hand this numeric differentiation might be much slower and inaccurate which would then again speak in favor of using the ...dot functions ...

 

For whatever it may be worth I attach the worksheet with the modified first and third solve block (have not touched the second one).

 

 

remslie
14-Alexandrite
(To:Werner_E)

Werner, Terry,

Thanks for your probing into my problem. I have been building this model from a simple gear pair with backlash clearance to include a motor/shaft  with resonance and with the two gears mounted on pedestals that also have resonances in the running speed range that cause the gear pair clearance to vary. It is a very non-linear problem.  When vibration amplitudes grow impactive behaviour develops with sub/super harmoics and zones where the response is chaotic.

The Variable A is a forcing function that increases one of the dynamic loads to observe when the chaos starts. In simple models I have developed bifurcation diagrams similar to:

remslie_1-1770615987601.png

 

Before reading your responses I did manage to get a solve also by reducing the number of iterations to a single run.

And yes as you have determined the numbers generated are very large. I clearly have some errors in my equations tha I need to track down. I will investigate further and advise.

Thanks for your efforts to date.

Regards,

Ross

remslie
14-Alexandrite
(To:remslie)

Werner, Terry,

I have reviewed all of my differential equations and found a couple of sign errors (in the source technical papers!) and I now have a working program copy attached "WE_20260208_Mill_Dynamics 5 DOF_Rev2 Test_1.zip". This sheet uses the variable "A" to provide multiple solutions for the pinion dynamic torque. These solutions can be used to create a bifurcation diagram. I now wish to change the sheet so that the variable "A" becomes motor speed (omega m). This increases the complexity as motor speed also changes the tooth mesh period (1/frequency) in the Deltak(t) function. I have copied the above sheet to "WE_20260208_Mill_Dynamics 5 DOF_Rev2 Test_2.zip". and attempted to modify the Deltak(t) function but have hit the wall trying to get a workable sheet. I have highlighted with a Yellow Box where the Deltak(t) function is derived in the upper portion of the sheet and copied this to just above the solve block. Any assistance to modify the Deltak(t) function would be appreciated.

Regards,

Ross

Werner_E
25-Diamond I
(To:remslie)

How about changing the functions that way:

grafik.png

 

But I did not see these functions to be used anywhere in your sheet!??? Maybe I overlooked something.

remslie
14-Alexandrite
(To:Werner_E)

Werner, your knowledge of this program are indeed legendary! Thanks for that update and the Solve Block now runs with very plausible results. However, there remains a glitch in the final program for the bifurcation diagram. 

remslie_0-1774003224968.png

the xv(Ai) throws an error "This function cannot be used here" and this traces back to "tend" with the error "this function cannot be used here". A search on the PTC Community suggests this is due to insufficeint number of iterations so I increased from the default 1,000 to 10,000 and this has not corrected the problem. Can you suggest any changes that will correct the error?

Many Thanks

Ross

 

Werner_E
25-Diamond I
(To:remslie)

The error tracing feature is misleading and incorrect in this case.

 

Your amplitude vector A starts with a value zero!

Using this the function Tzz will throw a division by zero error and so does Δkf used in the solve block.

 

So I guess you have three options:

1) Omit the first entry in vector A and use i := 1 .. N3 instead of i := 0 .. N3

2) define vector A so that it does not start with value AA := 0  but rather AA := 1 or AA := 10-6 or whatever seems appropriate

3) Rewrite function  Tzz so that it will return a meaningful result if A=0.

 

Being lazy by nature I used option #1

grafik.png

and got this result

grafik.png

remslie
14-Alexandrite
(To:Werner_E)

Werner,

So embassingly simple!! Thanks so much for your assistance.

Best wishes

Ross

 

Announcements


Top Tags