PDA

View Full Version : Problem on QDAWO in fortran



Aarahan
05-01-2008, 04:00 AM
Hi everyone:);)
I have a question about IMSL library ,use of QDAWO function in Fortran90
As you know in this function we can use X as variable , but I want to solve this problem;

U(t)=integral(0,t){f(x)*sin[ω(t-x) ]}dx

And here we have ω as OMEGA and ( t-x ) as variable x ,what can I do to solve this problem?:confused:
Is there any function in fortran90 library which can solve this?
Anybody can help me?:confused:

Richard Hanson
05-01-2008, 06:42 AM
There are codes in the Fortran library or algorithms in books that can do this calculation. But more detail about the problem is needed before specifics.


What is a typical f(x) that occurs for you?
Give a range for t.
Give a range for \omega.
State the accuracy requirements.

Aarahan
05-01-2008, 02:40 PM
Thank you:);
here is the complete problem;

http://www.freewebs.com/sartipjoon/Math/integ.gif

Where;
>>a and b are limits of integration;
>>ωd, ωn,ξ,t and A are input number;
>>x is variable;
I use QDAWO function of IMSL library, in this function the weight you can use x as variable(sinx) but I should use sin(t-x);
Do you think this is the correct function?
If so help me solve the problem if not give me the correct function, thank again:)

Richard Hanson
05-01-2008, 04:07 PM
Using that routine would probably be fine. But change integration variables to get U(t) into a form where the routine directly applies. This change of variable can be done once, no matter how you do the integration.

Define the integration variable by \omega_d(t-x)=s. So dx=-\omega{_d}^{-1}ds. And if my algebra is correct, U(t)=(A/\omega{_d}^{2})\int_{\omega_d(t-b)}^{\omega_d(t-a)}exp{-(\xi \omega_n / \omega_d) s}\ sin(s) \ ds.

If you call the routine QDAWO your input value of \omega is =1.

This particular problem can be integrated explicitly. To do this consider the complex valued integral
V(t)=(A/\omega{_d}^{2})\int_{\omega_d(t-b)}^{\omega_d(t-a)}exp{-(\xi \omega_n / \omega_d -i) s}\ \ ds. This is a familiar and trivial problem. Your required values are given by the imaginary part of V(t). Check the algebra here!

If your function was something different than the exponential * sine, then the use of QDAWO is a good routine to start with.

Aarahan
05-02-2008, 11:41 AM
Thank you dear Richard for your help:)
I try it and give you the results; but is there any better routine that I can use?
If so which one; and as you know I programming in Fortran90 so which routine is better to use?

And I have an other question, how can I use Microsoft spread sheets OLE in visual Fortran?;)

Richard Hanson
05-02-2008, 12:18 PM
The point here is that you do not need a quadrature routine for this problem. Since you ask the question it may be you do not understand that you analytically calculate the anti-derivative and evaluate it at the limits of integration. It amounts to evaluations of a complex function exp(z). Then take the imaginary part of the algebraic result. You can use variables of type COMPLEX(kind(1.D0)) in Fortran 90 for efficiency and accuracy.

I have no background in your other question. Perhaps some other reader can comment on what to do. You may need to give more details.