Message Boards Message Boards

0
|
3667 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:
GROUPS:

How can I use NDSolve for parametric functions ?

Posted 9 years ago

Hello,

I am trying to solve partial differential equation of parametric functions, but I think that NDSolve does not recognize the parametric function. Maybe I am wrong in defining the parametric function before solving differential equations. How can I fix this problem, could you help me ? In the following code, I wanted to make that d[t] is function of t (time). Thank you in advance. Have a nice day.

R1 = 5.0;
n = 9;
dst = 19.26 10^3;
mAu = dst (4[Pi])/3 (R1 10^-9)^3;
eV = 1.6 10^-19;
AAu = 3.0; ANi = 2.0; AVac = 0;
A = (AAu^0.5 - AVac^0.5) (ANi^0.5 - AVac^0.5);
\[Sigma]Au = 0.332; \[Sigma]Ni = 0.326;
\[Sigma]tot = (((\[Sigma]Au)^6 + (\[Sigma]Ni)^6)/2)^(1/6); 
HvdW[d, t] = -(A/6) (1/(d[t]/R1) + 1/(2 + d[t]/R1) + 
    Log[(d[t]/R1)/(2 + d[t]/R1)]); 
HBorn[d, t, B_] = 
 4 A (B)^(n - 
     6) 1/(n - 
      2)! ((6 - 2 d[t]/R1)/(2 + d[t]/R1)^(n - 5) + (6 - 
       2 d[t]/R1)/(d[t]/R1)^(n - 5)); 
En[d, t, B_] := HvdW[d, t] + HBorn[d, t, B];
Utot[d, t, B_] = eV 10^-15 En[d, t, B];
NDSolve[mAu 10^15 D[d[t], t, t] + 
   10^-3 (D[Utot[d, t, B], d[t]] /. B -> \[Sigma]tot/R1) == 
  0, (d[t] /. t -> 0) == -0.05, (D[d[t], t] /. t -> 0) == 0, d, {t, 0,
   100}, MaxSteps -> Infinity]
POSTED BY: hwoarang Polar
Posted 9 years ago

I made a mistake. I forgot {} in NDSolve. So stupid. The code works fine.

Thank you all. Have a good day.

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

Group Abstract Group Abstract