Group Abstract Group Abstract

Message Boards Message Boards

0
|
5.3K Views
|
6 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Need help! : Integrating the function to be solved

Posted 10 years ago

Hello, guys,

I think that I am always stuck in the mathmatica grammar. -_-a. Now I am trying to get the time-dependent function H[t], which is correlated to what happens at t'. So I need to integrate the time t' (from -infinity to infinity) to obtain the function with the time t. The code is simple as follows. I think that there are simple problems in Integrate or NSolve... Could you please help me ? Thank you very much in advance.

Remove["Global`*"];
\[Lambda] = 800.0; 
n = 2.48; k = 4.38 ; 
\[Xi] = \[Lambda]/(4 \[Pi] k); 
\[Chi] = \[Lambda]/(4 \[Pi] n);
v = 5.894; 
P1 = 0.5; P2 = 0.5;
W[t_] = -6 Cos[0.25 t] Exp[-(t/10)^2];
Plot[W[t], {t, -100, 100}, PlotRange -> All]
F[t_] = v ((P1/\[Chi] - P2/\[Xi]) Cos[
       v/\[Chi] t] - (P2/\[Chi] + P1/\[Xi]) Sin[
       v/\[Chi] Abs[t]]) Exp[-Abs[t] v/\[Xi]];
Sol = NSolve[
    8 \[Pi] v (2 P2 H[t] + 
         Integrate[
          F[tt - t] H[tt], {tt, -Infinity, Infinity}]) - \[Lambda] W[
        t] == 0, H, {t, -30, 30}][[1]];
Plot[H[t] /. Sol, {t, -30, 30}, PlotStyle -> {Blue}, PlotRange -> All]
POSTED BY: hwoarang Polar
6 Replies
Posted 10 years ago

Than you Frank for thoughtful suggestion. :-)

Actually, I tried this, but this problem cannot be converged to the differential equation, I think. Rather, if I integrate the previous equation (I mean the equation in NSolve), the simpler equation is obtained as follows.

8 \[Pi] v (Intg[t, H]) - \[Lambda] G[t] == 0

Here, Intg[t,H] and G[t] are already defined before. If we differentiate this function with t, then the previous equation (that I want to solve) is obtained again. If we differentiate higher order, it will be more complex to solve. Maybe, is it good to model/guess H[t] first (using some parameters) and then to use FindFit ? In the meantime, I will try if some transformation (Laplace or Fourier...) can reduce the complexity of this problem...

POSTED BY: hwoarang Polar

Are you trying to solve an integral equation? If so, NSolve is not the way to do it. Also, your definition of Intg has H_?NumericQ which will not accept a function as a second argument.

In[76]:= Intg1[q_?NumericQ, H_] := 
  NIntegrate[F[T - q] H[T], {T, -Infinity, Infinity}];

In[77]:= Intg1[1, #^2 &]

Out[77]= -13.6357
POSTED BY: Frank Kampas
Posted 10 years ago

Thank you, Frank.

But, in the integral, H[T] is an unknown function, which should be solved using the following equation.

8 \[Pi] v (2 P2 H[t] + Intg[t, H]) - 10^12 \[Lambda] W[t] == 0

Here, W[q] is a known function (and sorry for typos in previous one, it's better that q needs to be exchanged to t). If H[T] is not known, the integration cannot be done. Maybe, just by guessing H[t] and solving above equation iteratively (or self-consistent ?), then H[t] may be solved. Then, the problem that I have is that how I let the program recognize this. -_____- a

POSTED BY: hwoarang Polar

I was illustrating that your definition of Intg would not handle a function as a second argument. However, the main point is that you're trying to solve an integral equation, which NSolve won't do. Can you convert your problem to a differential equation and use NDSolve?

POSTED BY: Frank Kampas

Suggest you do the Integrate outside of NSolve and see what you get. That will help you diagnose the problem.

POSTED BY: Frank Kampas
Posted 10 years ago

Thank you, Frank, for the suggestion but I couldn't understand exactly what you suggested. Actually, the difficulty that I think is that the function H[t] which I want to obtain is in the symbolic integration and is even a function of time. Even I am not sure if NSolve is a right command in this case. I have fully tried to search for any leads in archives, but I couldn't find a similar situation to this. Could you help me, please? Any information would be very appreciated. Here is the code which I corrected some typos and unit dimensions.

Remove["Global`*"];
\[Lambda] = 800000.0; 
A1 = 0.6; A2 = -1.8;  
n = 2.48; k = 4.38 ; 
\[Xi] = \[Lambda]/(4 \[Pi] k); 
\[Chi] = \[Lambda]/(4 \[Pi] n);
v = 5894; 
P1 = 0.5; P2 = 0.5;
G[t_] = -6 10^-4 (Cos[0.25 t] - 0.209611) Exp[-(t/10)^2];
W[t_] = D[G[t], t]
Plot[W[t], {t, -100, 100}, PlotRange -> All]
F[t_] = v ((P1/\[Chi] - P2/\[Xi]) Cos[
       v/\[Chi] t] - (P2/\[Chi] + P1/\[Xi]) Sin[
       v/\[Chi] Abs[t]]) Exp[-Abs[t] v/\[Xi]];
Intg[q_?NumericQ, H_?NumericQ] := 
 NIntegrate[
  F[T - q] H[T], {T, -Infinity, 
   Infinity}]; (* H is unknown function *)
Sol = NSolve[
   8 \[Pi] v (2 P2 H[t] + Intg[q, H]) - 10^12 \[Lambda] W[t] == 0, 
   H][[1]];
Plot[H[t] /. Sol, {t, -30, 30}, PlotStyle -> {Blue}, PlotRange -> All]
POSTED BY: hwoarang Polar
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard