472,989 Members | 3,161 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,989 software developers and data experts.

solving differential equation

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


Nov 13 '05 #1
3 7986
greg.smith <pg*****@hotmail.com> 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
--
_ _____ _____
| ||_ _||_ _| Je***********@physik.fu-berlin.de
_ | | | | | |
| |_| | | | | | http://www.physik.fu-berlin.de/~toerring
\___/ens|_|homs|_|oerring
Nov 13 '05 #2
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

Nov 13 '05 #3
>Subject: solving differential equation
From: "greg.smith" pg*****@hotmail.com
Date: 9/21/03 6:58 PM Hawaiian Standard Time
Message-id: <bp*******************@read1.cgocable.net>

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"
Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: tim groulx | last post by:
I have recently started receiving failures on a differential backup that previously succeeded. Nothing has changed with the structure of the db. Here is the message, any ideas are welcomed. Thanks....
1
by: Burt | last post by:
My company needs to move a 30 Gig SQL Server across the country as soon as possble on July 1. Turns out moving the full db across the network takes a few hours. I'd like to move a full copy of...
7
by: 116Rohan | last post by:
I have been trying to figure out how to solve uneqaulity problems I have two equations which I am trying to figure out What values of n will make 8n^2 < 64 * n * Lg n What I am trying to find...
9
by: TG | last post by:
Hi there. Anyone knows how to use numpy / scipy in order to solve this ? * A is an array of shape (n,) * X is a positive float number * B is an array of shape (n,) * O is an array of shape...
6
by: mismis | last post by:
HELP!..PLEASE..i have a project that asks to write a C++ program solving for the root of the equation (x*x*x)-(x*x)-(9x)+(9) ........huhuhu..please help..i really need to pass..please..
5
by: Deviate | last post by:
Hi again guys :) Ok i have this problem, i need to solve the equation phi(x) = 0.1 (where phi is the area under the gaussian normal distribution function) apparently im supposed to solve it...
1
by: guhu | last post by:
how to solve a second order differential equation with respect to time using c language.
4
by: sdufoo | last post by:
Hallo guys, I have to solve a system of Differential equations: http://picasaweb.google.de/sdufoo/EcuacionesDiferenciales02/photo#5228386949051570594 these are the equations of an induction...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...
3
SueHopson
by: SueHopson | last post by:
Hi All, I'm trying to create a single code (run off a button that calls the Private Sub) for our parts list report that will allow the user to filter by either/both PartVendor and PartType. On...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.