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

SOLVED
Regular Member

## 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

1 ACCEPTED SOLUTION

Accepted Solutions

## Re: Numerical Solutions To Differential Equations

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

21 REPLIES 21

## Re: Numerical Solutions To Differential Equations

here is the zp file

## Re: Numerical Solutions To Differential Equations

did you get the zip file?

## Re: Numerical Solutions To Differential Equations

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

## Re: Numerical Solutions To Differential Equations

"help me with this program"

Which program?

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

hope this works

## Re: Numerical Solutions To Differential Equations

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?

## Re: Numerical Solutions To Differential Equations

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

Luc

## Re: Numerical Solutions To Differential Equations

Sorry, here it is

## Re: Numerical Solutions To Differential Equations

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.

Correct that and come back when you need more help.

Success!
Luc

## Re: Numerical Solutions To Differential Equations

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.

## Re: Numerical Solutions To Differential Equations

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

## Re: Numerical Solutions To Differential Equations

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

## Re: Numerical Solutions To Differential Equations

Thanks Luc, that worked

## Re: Numerical Solutions To Differential Equations

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

Regular Member
(in response to -MFra-)

## Re: Numerical Solutions To Differential Equations

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.

## Re: Numerical Solutions To Differential Equations

Hi ,

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

Regular Member
(in response to -MFra-)

## Re: Numerical Solutions To Differential Equations

Excellent solution procedure, and I will sure try that.

Thanks You very much

Regular Member
(in response to -MFra-)

## Re: Numerical Solutions To Differential Equations

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