Skip to main content
deleted 6 characters in body
Source Link
user42582
  • 4.3k
  • 1
  • 12
  • 32

Below are the data in a Mathematica friendly format

data = {{143.75, 0.0793}, {487.5, 0.2002}, {831.25, 0.5153}, {1175., 0.8803}, {1518.75, 0.9933}, {1862.5, 0.9361}, {2206.25, 0.8575}, {2550., 0.8051}, {2893.75, 0.7677}, {3237.5, 0.7691}, {3581.25, 0.7717}, {3925., 0.7945}, {4268.75, 0.8263}, {4612.5, 0.8464}, {4956.25, 0.8688}, {5300., 0.881}, {5643.75, 0.8906}, {5987.5, 0.9019}, {6331.25, 0.9152}} 

The following plot is provided to establish that there were no errors introduced during data import:

Blockquote

After evaluating FindFit (with a few adjustments due to the way I recoded the various consts etc not really important) the output I obtained was the following:

Blockquote

The data and the fitted data are displayed below:

Blockquote

Now, since model/.fit1 evaluates to an expression containing f, one way to retrieve the fitted values is to evaluate the following:

BlockBlock[{y},   (* get*get the x-coordinates (freqs) *)   With[{x = Part[data, All, 1]},   (* replace*replace all occurrences of f in the *fitted* modelthe*fitted*model with the x's *x's*)     y = model /. fit1 /. Transpose[{Thread[f -> x]}]; ]; (* retrieve output*retrieve *output*) Transpose[{x, y}] ] ] 

The following plot is produced using the Show from the question by replacing the first Plot with ListPlot:

Blockquote

Below are the data in a Mathematica friendly format

data = {{143.75, 0.0793}, {487.5, 0.2002}, {831.25, 0.5153}, {1175., 0.8803}, {1518.75, 0.9933}, {1862.5, 0.9361}, {2206.25, 0.8575}, {2550., 0.8051}, {2893.75, 0.7677}, {3237.5, 0.7691}, {3581.25, 0.7717}, {3925., 0.7945}, {4268.75, 0.8263}, {4612.5, 0.8464}, {4956.25, 0.8688}, {5300., 0.881}, {5643.75, 0.8906}, {5987.5, 0.9019}, {6331.25, 0.9152}} 

The following plot is provided to establish that there were no errors introduced during data import:

Blockquote

After evaluating FindFit (with a few adjustments due to the way I recoded the various consts etc not really important) the output I obtained was the following:

Blockquote

The data and the fitted data are displayed below:

Blockquote

Now, since model/.fit1 evaluates to an expression containing f, one way to retrieve the fitted values is to evaluate the following:

Block{y},   (* get the x-coordinates (freqs) *)   With[{x = Part[data, All, 1]}   (* replace all occurrences of f in the *fitted* model with the x's *)  y = model /. fit1 /. Transpose[{Thread[f -> x]}]; ]; (* retrieve output *) Transpose[{x,y}] ] 

The following plot is produced using the Show from the question by replacing the first Plot with ListPlot:

Blockquote

Below are the data in a Mathematica friendly format

data = {{143.75, 0.0793}, {487.5, 0.2002}, {831.25, 0.5153}, {1175., 0.8803}, {1518.75, 0.9933}, {1862.5, 0.9361}, {2206.25, 0.8575}, {2550., 0.8051}, {2893.75, 0.7677}, {3237.5, 0.7691}, {3581.25, 0.7717}, {3925., 0.7945}, {4268.75, 0.8263}, {4612.5, 0.8464}, {4956.25, 0.8688}, {5300., 0.881}, {5643.75, 0.8906}, {5987.5, 0.9019}, {6331.25, 0.9152}} 

The following plot is provided to establish that there were no errors introduced during data import:

Blockquote

After evaluating FindFit (with a few adjustments due to the way I recoded the various consts etc not really important) the output I obtained was the following:

Blockquote

The data and the fitted data are displayed below:

Blockquote

Now, since model/.fit1 evaluates to an expression containing f, one way to retrieve the fitted values is to evaluate the following:

Block[{y}, (*get the x-coordinates (freqs)*) With[{x = Part[data, All, 1]}, (*replace all occurrences of f in the*fitted*model with the x's*)    y = model /. fit1 /. Transpose[{Thread[f -> x]}]; (*retrieve output*) Transpose[{x, y}] ] ] 

The following plot is produced using the Show from the question by replacing the first Plot with ListPlot:

Blockquote

Source Link
user42582
  • 4.3k
  • 1
  • 12
  • 32

Below are the data in a Mathematica friendly format

data = {{143.75, 0.0793}, {487.5, 0.2002}, {831.25, 0.5153}, {1175., 0.8803}, {1518.75, 0.9933}, {1862.5, 0.9361}, {2206.25, 0.8575}, {2550., 0.8051}, {2893.75, 0.7677}, {3237.5, 0.7691}, {3581.25, 0.7717}, {3925., 0.7945}, {4268.75, 0.8263}, {4612.5, 0.8464}, {4956.25, 0.8688}, {5300., 0.881}, {5643.75, 0.8906}, {5987.5, 0.9019}, {6331.25, 0.9152}} 

The following plot is provided to establish that there were no errors introduced during data import:

Blockquote

After evaluating FindFit (with a few adjustments due to the way I recoded the various consts etc not really important) the output I obtained was the following:

Blockquote

The data and the fitted data are displayed below:

Blockquote

Now, since model/.fit1 evaluates to an expression containing f, one way to retrieve the fitted values is to evaluate the following:

Block{y}, (* get the x-coordinates (freqs) *) With[{x = Part[data, All, 1]} (* replace all occurrences of f in the *fitted* model with the x's *) y = model /. fit1 /. Transpose[{Thread[f -> x]}]; ]; (* retrieve output *) Transpose[{x,y}] ] 

The following plot is produced using the Show from the question by replacing the first Plot with ListPlot:

Blockquote