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

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

Numerical Solutions To Differential Equations

rayakannu2
6-Contributor

Numerical Solutions To Differential Equations

Can someone help me with this program. I cannot seem to plot the graphs nor can I get the output matrices.

 

Thanks

RA

ACCEPTED SOLUTION

Accepted Solutions
LucMeekes
23-Emerald III
(To:LucMeekes)

Instead of ending the program with [t f u u'']  end it with:

augment(t,f,u,u'')

Then you should be able to plot u versus t for example.

 

Success!
Luc

View solution in original post

21 REPLIES 21

Show please your ODEs!

here is the zp file

 

did you get the zip file?

LucMeekes
23-Emerald III
(To:rayakannu2)

Yep, the zip file was found. I'm limited to Prime Express (no programming a.o.) so I cannot run the program.

At first glance:

In your Solution program you assign n*delta_t to each of the values t[i (That is t with index i). Note that n*delta_t is a constant of 2 seconds. I guess you want to assign i*delta_t to each value of t[i...

Then you go and test the t[i value against, 0, t.1 and t.2 .... Note that there is a difference between t[1 and t.1

t[1 is the second (!) value in the array t, that is because array inexing starts at 0 (controlled by the constant ORIGIN)

t.1 is just a variable t with subscript 1.

 

Try to correct your sheet with the above notions in mind and come back for further advice if needed.

 

Success!

Luc

 

LucMeekes
23-Emerald III
(To:rayakannu2)

"help me with this program"

Which program?

Please send in your Mathcad or Prime worksheet.

You may have to zip it first. A serious bug in this forum prevents direct uploading of Mathcad and Prime worksheets for most users. But a .ZIP file can be attached to a posting.

To get the .zip file, use Windows Explorer, select the file, right-mouse click and select "Send to" then "Compressed (.zip) folder". this results in a .zip file containing the worksheet that you can attach.

 

Luc

rayakannu2
6-Contributor
(To:LucMeekes)

hope this works

rayakannu2
6-Contributor
(To:LucMeekes)

Luc, thanks for you help. I got the program to work, but not very sure how to output the all the results. Can you please show me?

LucMeekes
23-Emerald III
(To:rayakannu2)

You attached the very same sheet file, not the corrected one.

Hence no results for me to work with.

 

 

Luc

rayakannu2
6-Contributor
(To:LucMeekes)

 
rayakannu2
6-Contributor
(To:LucMeekes)

Sorry, here it is

LucMeekes
23-Emerald III
(To:rayakannu2)

You still have a problem in your program.

The calculation for u'' gives units of ft^2/s^4, where it most probably would need to result in ft/s^2.

LM_20171113_Numerical.png

 

Correct that and come back when you need more help.

 

Success!
Luc

rayakannu2
6-Contributor
(To:LucMeekes)

Luc, I am able to get individual results for t, f, u and u'' not not all the results together. The units are also consistent when individually extracted.

LucMeekes
23-Emerald III
(To:rayakannu2)

Sorry, my mistake. I multiplied f.i/m with omega^2*u.0, instead of subtracting.

But I do get an error message saying Solution is undefined.

What do you get when you evaluate t[0=

?

 

Luc

 

 

LucMeekes
23-Emerald III
(To:LucMeekes)

Instead of ending the program with [t f u u'']  end it with:

augment(t,f,u,u'')

Then you should be able to plot u versus t for example.

 

Success!
Luc

rayakannu2
6-Contributor
(To:LucMeekes)

Thanks Luc, that worked

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

Hi RA,
you could use the finite difference method below:

fdm0.jpgfdm1.jpgfdm2.jpg

rayakannu2
6-Contributor
(To:-MFra-)

Yes, FDM is one of the several ways, and thanks for sharing that program with us. The time intervals need to be no more than 1/10 of the peak forcing function, which means that the number of iterations for a 2 sec response would be in the thousands.

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

Hi ,

For any order matrix, you can do so as indicated below:

fdm3.jpg

rayakannu2
6-Contributor
(To:-MFra-)

Excellent solution procedure, and I will sure try that.

 

Thanks You very much

rayakannu2
6-Contributor
(To:-MFra-)

I got my program to work, but unable to extract the t, u, and u''. Can you please show me how to display a table of all these values?

Announcements

Top Tags