cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

Newmark Integration

fkcom
6-Contributor

Newmark Integration

Dear helpers,

 

I am currently trying to solve the reaction of a laminated plate by using the Newmark-Integration-Scheme based on the First Order Shear Deformation Theory (the force acting on the plate is sinusoidal in time). Therefor I wrote a loop which calculates the needed Wmn for every next time step dependent on values of the current timestep.

 

My problem is that this calculation needs a lot of time at the moment (especially when I try to plot the last equation) so I can't see if my calculations are correct. 

 

My question is if there is any mistake I did by programming the loop because this is the first time I was programming in mathcad. 

 

I am thankful for every advice.

Thanks,

Felix

 

 

7 REPLIES 7
-MFra-
21-Topaz II
(To:fkcom)

Halo,

In den Mathcad-Programmen können die Werte der rechten Seite nicht den Funktionen von zwei Variablen auf der linken Seite zugeordnet werden. Stattdessen kann dies getan werden, wenn auf der linken Seite ein Element der Matrix ist. Siehe Fotos:

fkcom.jpg

fkcom
6-Contributor
(To:-MFra-)

Hello,

 

thank you very much for your reply and sorry for my late answer.

I understand what you mentioned and I tried it out (see attached file). Now the loop should work better.

Unfortunately I'm still not getting the results that I want. Is there another mistake you can see in the file?

 

Thank you very much in advance!

 

deutsch:

Besten Dank für deine Antwort und sorry für meine späte Rückmeldung.

Deinen Vorschlag habe ich verstanden und umgesetzt (s. angehängte Datei). Ich denke, die Schleife sollte jetzt funktionieren. 

Leider bekomme ich immer noch nicht die Ergebnisse, die ich gern hätte. Ist da noch etwas, was ich übersehen haben könnte? Meine Mathcad-Kenntnisse sind nicht die besten, vielleicht habe ich noch einen ähnlichen Fehler drin wie der bereits von dir erwähnte.

 

Besten Dank vorab.

 

-MFra-
21-Topaz II
(To:fkcom)

Hi fkcom,
at the beginning of the file it is good to define the origin of the indexes, in this case one. Then I defined the intervals for the x and y. It seems that it works, even if the times are very long when you choose high-order matrices in the "createmash" arguments. (10x10 is fast enough while 20x20 takes etwa 30 seconds)

fkcom1.jpg

fkcom
6-Contributor
(To:-MFra-)

Thank you very much, MF.

With these settings I get reasonable results.

fkcom
6-Contributor
(To:fkcom)

Hello MF,

 

I have one more questions and it would be great if you can help me out.

 

I try to export the minimum of the funktion w(x,y) for every time step. Therefore I have to define the function inside the program/loop and I know Minimize doesn't work inside of a program (see attached file at the end of the program). I tried to create function that calls minimize but it did not work. Do you have another idea?

 

Thank you in advance!

 

EDIT: It is interesting that when I define an additional function w(x,y) before the program it seems that the program is working with the minimize function inside the loop. But I think the minimize function is still working with w(x,y) I defined inside the program, not with the one which is defined before the program. Is that possible?

Werner_E
24-Ruby V
(To:fkcom)

Minimize ca be quite tricky and your observation is absolutely correct.

Minimize used from within a program will not use a function locally defined in that program.

So your program fails until you define a function w() outside the program and in front of it. And of course only this function is the function which gets minimized.

 

To be honest I am not 100% sure if the following workaround really does what it pretends to do. You should double check the resulting data for correctness.

B1.png

Here we defined a function with a function argument g which calls minimize to minimize an already defined function f which on its part relies on argument function g.

Its fine that in Mathcad one can omit the third argument of the function f  and minimize will happily minimize only for the first two arguments. I guess that for this reason the same trick would not work in Prime any more.

The order of the arguments in function f are mandatory - the function f must be the third argument. The order of the arguments in function minimaus can be changed at will as long as you do the same when you call the function from within your program:

B2.png

I had another look at the sheet and tried to create an animation. I found that the position of the minimum often was calculated wrong. Thats strange as it seems that like in the other thread of yours the minimum always is at 0.25 / 0.2.

When I use guesses x= 0.24 and y=0.21 instead of x=y=0.15 I always get 0.25 / 0.20.

Still don't understand why the values are that far off with the original guesses (0.15). Looking at the surface it seems to me that this are good guesses anyway and should yield the correct result but obviously they don't.

See the (hopefully) correct animation attached.

 

Top Tags