Solved

A simple question

Posted on 2000-02-15
4
198 Views
Last Modified: 2010-04-15
I have been asked to use the cephes math library to write a C program which will generate the values of the zeroth order Bessel function [j0(x)] for 50 values of x evenly spaced in the interval 0 < x < 10. But I am totally confuse about this question. What is that mean? Please help. Thanks !
0
Comment
Question by:clo1
  • 3
4 Comments
 
LVL 10

Accepted Solution

by:
rbr earned 10 total points
ID: 2526061
Assume that you have a function j0 which generates the bessel function.


Then you have to divide the interval (0,10) in 50 steps

int n=50;
double a=0,b=10,x;
for (i=1;i<=n;i++) {

    x=(b-a)*i/(n+1)+a;

    printf ("Bessel for x=%f:%f\n",x,j0(x));
}
0
 
LVL 10

Expert Comment

by:rbr
ID: 2526068
if you need the boundaries too (0<=x<=10) use
for (i=0;i<n;i++) {

x=(b-a)*i(n-1)+a;
0
 
LVL 10

Expert Comment

by:rbr
ID: 2526070
sorry
x=(b-a)*i/(n-1)+a;
0
 
LVL 2

Author Comment

by:clo1
ID: 2526124
Oic, I finally know what it means now. But I would like to know where do you get the information on how to use the bessel function?? Cause I have try to read the double.doc file in the cephes's doc directory, but no clue. Anway, Thanks very much !!
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question