Mathematica Fitting solution function of NDSolve with a curve

AI Thread Summary
The discussion focuses on using NDSolve to solve an initial value problem (IVP) and obtaining a function f3[x]. The user seeks to fit this function to a power law model of the form at^b over the interval t in [0, 1]. Initial observations suggest that t^0.6 fits well, but the user finds a more precise fit using the FindFit function, yielding parameters a and b. The final model derived is approximately 0.96556 t^0.573358, with adjustments made for the increment used in the data table. This approach provides a systematic way to achieve a curve fit for the given function.
member 428835
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?
 
Physics news on Phys.org
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.
 

Similar threads

Replies
1
Views
2K
Replies
10
Views
6K
Replies
2
Views
1K
Replies
4
Views
1K
Replies
1
Views
2K
Replies
1
Views
2K
Replies
4
Views
3K
Replies
1
Views
4K
Back
Top