Fitting solution function of NDSolve with a curve

  • Mathematica
  • Thread starter joshmccraney
  • Start date
  • #1
joshmccraney
Gold Member
2,253
143
The following solves an IVP, giving the output as the function f3[x]:

Code:
s3 = NDSolve[{(-z1[t]^(3/2) + (1 + z1[t]^2)^(3/4))/(
    3 (-z1[t] + Sqrt[1 + z1[t]^2])) == z1[t] z1'[t], z1[0] == 0.0001},
   z1, {t, 0, 30}

f3[x_] := z1[x] /. First[s3];
My question is, how do I curve fit f3[x] to the function ##at^b## over domain ##t\in[0,1]##? Looks like ##t^{0.6}## does a good job (by eye) but is there a better way?
 

Answers and Replies

  • #2
joshmccraney
Gold Member
2,253
143
Nevermind, the solution is here: https://reference.wolfram.com/language/ref/FindFit.html which gives: ## 0.96556 t^{0.573358}##

FYI for future people I used

Code:
Table[f3[x], {x, 0, 1, 0.01}];
FindFit[%, a x^b, {a, b}, x]
and then used the ##a,b## output as ##a(100t)^b## where I used 100 since I incremented by 0.01, or 1/100.
 

Suggested for: Fitting solution function of NDSolve with a curve

Replies
5
Views
186
  • Last Post
Replies
1
Views
1K
  • Last Post
Replies
2
Views
531
Replies
4
Views
608
Replies
1
Views
223
  • Last Post
Replies
3
Views
1K
Replies
2
Views
476
Replies
4
Views
485
Replies
5
Views
2K
Replies
0
Views
402
Top