Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > solving differential equation

Reply
Thread Tools

solving differential equation

 
 
greg.smith
Guest
Posts: n/a
 
      09-22-2003
Hi there,

I've been trying to solve this different via numerical methods(C
programming) and it's
driving me crazy....

I can't post my code because it's simply one big mess and doesn't work.

d^2y/dx^2 - 1/(L^2)*y .... where L is just some arbitrary number......L =
0.2045....

I cannot figure this out, I was thinking matlab might be easier but I really
want to learn to do this via the C language. I just want to solve for
values of Y, and plot them against x.

Any help is appreciated,

gs




 
Reply With Quote
 
 
 
 
Jens.Toerring@physik.fu-berlin.de
Guest
Posts: n/a
 
      09-22-2003
greg.smith <(E-Mail Removed)> wrote:
> I've been trying to solve this different via numerical methods(C
> programming) and it's driving me crazy....


> I can't post my code because it's simply one big mess and doesn't work.


> d^2y/dx^2 - 1/(L^2)*y .... where L is just some arbitrary number......L =
> 0.2045....


That's not an equation, just a sum of two terms (or do you mean that's
the left hand side and the other side is 0), and your also not telling
about the boundary conditions or initial values for y and y' which you
will need for a numerical solution.

> I cannot figure this out, I was thinking matlab might be easier but I really
> want to learn to do this via the C language. I just want to solve for
> values of Y, and plot them against x.


You don't show any code and you don't tell what method you try to use
(there are quite a number of methods of varying quality) so what kind
of help are you expecting? Have you been looking at "Numerical Recipes
in C" by Press et al.? While the code in the book is quite horrible,
chapter 16 and 17 give a useful introduction to numerically solving DEs
(and more information than you can expect from Usenet postings). You
can download the chapters from e.g.

http://www.library.cornell.edu/nr/bookcpdf.html.

Regards, Jens
--
_ _____ _____
| ||_ _||_ _| http://www.velocityreviews.com/forums/(E-Mail Removed)-berlin.de
_ | | | | | |
| |_| | | | | | http://www.physik.fu-berlin.de/~toerring
\___/ens|_|homs|_|oerring
 
Reply With Quote
 
 
 
 
Martin Ambuhl
Guest
Posts: n/a
 
      09-22-2003
greg.smith wrote:

> Hi there,
>
> I've been trying to solve this different via numerical methods(C
> programming) and it's
> driving me crazy....
>
> I can't post my code because it's simply one big mess and doesn't work.
>
> d^2y/dx^2 - 1/(L^2)*y .... where L is just some arbitrary number......L =
> 0.2045....
>
> I cannot figure this out, I was thinking matlab might be easier but I really
> want to learn to do this via the C language. I just want to solve for
> values of Y, and plot them against x.
>
> Any help is appreciated,


Using D to stand for the second derivative of y with respect ot x,
whether the form is

D = 1/(L*L*y)
or
D = y/(L*L)

the answer is trivial as a closed form exercise. When you can do something
trivially in closed form, it is an *error* to use numerical methods.





--
Martin Ambuhl

 
Reply With Quote
 
Bigdakine
Guest
Posts: n/a
 
      09-24-2003
>Subject: solving differential equation
>From: "greg.smith" http://www.velocityreviews.com/forums/(E-Mail Removed)
>Date: 9/21/03 6:58 PM Hawaiian Standard Time
>Message-id: <bpvbb.10880$(E-Mail Removed)>
>
>Hi there,
>
>I've been trying to solve this different via numerical methods(C
>programming) and it's
>driving me crazy....
>
>I can't post my code because it's simply one big mess and doesn't work.
>
>d^2y/dx^2 - 1/(L^2)*y .... where L is just some arbitrary number......L =
>0.2045....
>
>I cannot figure this out, I was thinking matlab might be easier but I really
>want to learn to do this via the C language. I just want to solve for
>values of Y, and plot them against x.


Well you should be able to get the solution to that one with just pencil and
paper.


Stuart
Dr. Stuart A. Weinstein
Ewa Beach Institute of Tectonics
"To err is human, but to really foul things up
requires a creationist"
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Solving System of Linear Equation (SLE) - FuncDesigner example dmitrey Python 0 10-25-2009 04:50 PM
Solving simple mathematical equation solving speed Lionel Java 14 06-23-2008 08:01 AM
solving equation system TG Python 9 07-18-2006 01:16 AM
SCSI Long Cables, High Voltage Differential Signals and Data Skew? Will Hay A+ Certification 1 03-04-2004 06:44 PM



Advertisments