Group Abstract Group Abstract

Message Boards Message Boards

Obtain Prony Coefficients from the following data?

Posted 7 years ago

I'm very new to Mathematica. I have been having the most difficult fitting my data to a Prony series to obtain coefficients. My data is listed as:

data ={{-7.41908,0.202581}, 
{-7.08513,0.22534}, 
{-6.80688,0.263415  },   
{-6.75203,0.27437   },    
{-6.47366,0.352769  },   
{-6.41908,0.372474  },   
{-6.14086,0.521425  },   
{   -6.13608,0.507203 },  
{   -6.08513,0.537803 },  
{   -5.80688,0.732571 },  
{   -5.8041,0.713165  },   
{   -5.75203,0.753371 },  
{   -5.47366,0.999272 },  
{   -5.4698,0.978897  },   
{   -5.41908,1.03047  },   
{   -5.14086,1.35962  },   
{   -5.13608,1.3339   },    
{   -5.08513,1.40366  },   
{   -4.80688,1.85884  },   
{   -4.8041,1.82376   },    
{   -4.75203,1.92504  },   
{   -4.47366,2.57341  },   
{   -4.4698,2.56778   },    
{   -4.41908,2.67567  },   
{   -4.36051,2.85621  },   
{   -4.14086,3.53946  },   
{   -4.13608,3.53409  },   
{   -4.08513,3.67948  },   
{   -4.02733,3.90283  },   
{   -3.80726,4.77778  },   
{   -3.80281,4.77227  },   
{   -3.75189,4.96328  },   
{   -3.69424,5.25015  },   
{   -3.47393,6.38345  },   
{   -3.46948,6.36833  },   
{   -3.41855,6.58298  },   
{   -3.36091,6.93619  },   
{   -3.1406,8.17887   },    
{   -3.13614,8.14628  },   
{   -3.02757,8.90897  },   
{   -2.80726,10.9395  },   
{   -2.80649,10.8011  },   
{   -2.80281,10.7765  },   
{   -2.69424,11.7196  },   
{   -2.47313,13.718   },    
{   -2.46948,13.6073  },   
{   -2.36091,14.8401  },   
{   -2.13981,17.9584  },   
{   -2.13614,17.8678  },   
{   -2.02757,19.8201  },   
{   -1.80648,25.1663  },   
{   -1.69424,28.8535  },   
{   -1.57108,34.0035  },   
{   -1.47315,39.0339  },   
{   -1.36091,46.0734  },   
{   -1.23773,55.7655  },   
{   -1.13981,65.2136  },   
{   -1.02757,78.5576  },   
{   -0.90441,96.9397  },   
{   -0.80648,114.854  },   
{   -0.69424,140.088  },   
{   -0.57108,174.772  },   
{   -0.47315,208.272  },   
{   -0.36091,254.819  },   
{   -0.23774,317.221  },   
{   -0.20832,328.147  },   
{   -0.13981,366.807  },   
{   0.095588,528.616  },   
{   0.125032,538.08   },    
{   0.19352,592.818   },    
{   0.428922,817.148  },   
{   0.458354,823.643  },   
{   0.526852,895.643  },   
{   0.762255, 1176.53 },  
{   0.791684, 1189.2  },   
{   0.860185, 1283.84 },  
{   1.095588, 1668.42 },  
{   1.125019, 1704.64 },  
{   1.19352,  1836.48  },   
{   1.221943, 1830.4  },   
{   1.226187, 1847.67 },  
{   1.428922, 1964.63 },  
{   1.458352, 1976.94 },  
{   1.555295, 2005.88 },  
{   1.55954,  2017.68  },   
{   1.762255, 2063.7  },   
{   1.791684, 2071.22 },  
{   1.888617, 2090.3  },   
{   1.892861, 2093.55 },  
{   2.095588, 2138.75 },  
{   2.125019, 2146.72 },  
{   2.221949, 2171.14 },  
{   2.226192, 2174.12 },  
{   2.428922, 2237.78 },  
{   2.458351, 2248.93 },  
{   2.555283  ,    2282.36    }, 
{   2.559527  ,    2285.98    }, 
{   2.791685  ,    2377.96    }, 
{   2.888616  ,    2407.15    }, 
{   2.892861  ,    2406.96    }, 
{   3.125019  ,    2492.99    }, 
{   3.221949  ,    2504.64    }, 
{   3.226192  ,    2504.83    }, 
{   3.458351  ,    2537.75    }, 
{   3.555282  ,    2527.52    }, 
{   3.559526  ,    2528.78    }, 
{   3.791685  ,    2494.84    }, 
{   3.888615  ,    2473.19    }, 
{   3.89286   , 2471.26 },  
{   4.221949  ,    2364.14    }, 
{   4.226192  ,    2359.41    }, 
{   4.555282  ,    2206.02    }, 
{   4.559526  ,    2193.85    }, 
{   4.888615  ,    1960.51    }, 
{   4.89286   , 1956.46 },  
{   5.221949  ,    1483.65    }, 
{   5.226192  ,    1474.91    }}

My prony series is listed as:

func=Normal [Series[((p_i^2)*E_i*(w^2))/(1+((p_i^2)*(w^2))),{w,0,22}]];

my fit is

FindFit[data,func,{E_i,p_i},w]

The results never fit the data.

I am very new to this and I am in great need of some assistance. I sure that the solution may be simple.

Thanks ahead of time.

POSTED BY: Justin Hendrix
11 Replies

Ok. In the meantime I figured out that Prony seems to be a name.

Do you perhaps mean something like this (ignore the error message that appears - at least in my system)

prony = e0 + Sum[e[i] Exp[-(t/tau[i])], {i, 1, 19}]
param = Flatten[Join[{e0}, Table[{e[i], tau[i]}, {i, 1, 19}]]]
fit = FindFit[data, prony, param, t]
Plot[prony /. fit, {t, 0, 150}, Epilog -> Point /@ data,  PlotRange -> All]
POSTED BY: Hans Dolhaine

The data plot is decreasing in both directions. Why do you expect a good fit to a Prony series?

POSTED BY: Daniel Lichtblau
Posted 7 years ago

My mistake :

data = {{   3.81E-08  ,    0.202581   }
{   8.22E-08  ,    0.22534    }
{   1.56E-07  ,    0.263415   }
{   1.77E-07  ,    0.27437    }
{   3.36E-07  ,    0.352769   }
{   3.81E-07  ,    0.372474   }
{   7.23E-07  ,    0.521425   }
{   7.31E-07  ,    0.507203   }
{   8.22E-07  ,    0.537803   }
{   1.56E-06  ,    0.732571   }
{   1.57E-06  ,    0.713165   }
{   1.77E-06  ,    0.753371   }
{   3.36E-06  ,    0.999272   }
{   3.39E-06  ,    0.978897   }
{   3.81E-06  ,    1.03047    }
{   7.23E-06  ,    1.35962    }
{   7.31E-06  ,    1.3339 }
{   8.22E-06  ,    1.40366    }
{   1.56E-05  ,    1.85884    }
{   1.57E-05  ,    1.82376    }
{   1.77E-05  ,    1.92504    }
{   3.36E-05  ,    2.57341    }
{   3.39E-05  ,    2.56778    }
{   3.81E-05  ,    2.67567    }
{   4.36E-05  ,    2.85621    }
{   7.23E-05  ,    3.53946    }
{   7.31E-05  ,    3.53409    }
{   8.22E-05  ,    3.67948    }
{   9.39E-05  ,    3.90283    }
{   0.000155861   , 4.77778 }
{   0.000157467   , 4.77227 }
{   0.000177057   , 4.96328 }
{   0.000202191   , 5.25015 }
{   0.000335792   , 6.38345 }
{   0.000339252   , 6.36833 }
{   0.000381459   , 6.58298 }
{   0.000435605   , 6.93619 }
{   0.000723441   , 8.17887 }
{   0.000730896   , 8.14628 }
{   0.000938485   , 8.90897 }
{   0.00155861    ,  10.9395  }
{   0.0015614 ,   10.8011   }
{   0.00157467    ,  10.7765  }
{   0.0020219 ,   11.7196   }
{   0.00336408    ,  13.718   }
{   0.00339252    ,  13.6073  }
{   0.00435605    ,  14.8401  }
{   0.00724748    ,  17.9584  }
{   0.00730896    ,  17.8678  }
{   0.00938484    ,  19.8201  }
{   0.0156141 ,   25.1663   }
{   0.020219  ,    28.8535    }
{   0.0268483 ,   34.0035   }
{   0.0336398 ,   39.0339   }
{   0.0435605 ,   46.0734   }
{   0.0578453 ,   55.7655   }
{   0.0724747 ,   65.2136   }
{   0.0938483 ,   78.5576   }
{   0.124621  ,    96.9397    }
{   0.156142  ,    114.854    }
{   0.20219   , 140.088 }
{   0.268485  ,    174.772    }
{   0.336397  ,    208.272    }
{   0.435605  ,    254.819    }
{   0.578436  ,    317.221    }
{   0.618985  ,    328.147    }
{   0.724746  ,    366.807    }
{   1.2462    ,  528.616  }
{   1.33362   , 538.08  }
{   1.56142   , 592.818 }
{   2.68486   , 817.148 }
{   2.87312   , 823.643 }
{   3.36397   , 895.643 }
{   5.78435   , 1176.53 }
{   6.18991   , 1189.2  }
{   7.24745   , 1283.84 }
{   12.462    ,  1668.42  }
{   13.3358   , 1704.64 }
{   15.6142   , 1836.48 }
{   16.6703   , 1830.4  }
{   16.834    ,  1847.67  }
{   26.8486   , 1964.63 }
{   28.7311   , 1976.94 }
{   35.9166   , 2005.88 }
{   36.2694   , 2017.68 }
{   57.8435   , 2063.7  }
{   61.8991   , 2071.22 }
{   77.3779   , 2090.3  }
{   78.1378   , 2093.55 }
{   124.62    ,  2138.75  }
{   133.358   , 2146.72 }
{   166.705   , 2171.14 }
{   168.342   , 2174.12 }
{   268.486   , 2237.78 }
{   287.31    ,  2248.93  }
{   359.156   , 2282.36 }
{   362.683   , 2285.98 }
{   618.992   , 2377.96 }
{   773.778   , 2407.15 }
{   781.377   , 2406.96 }
{   1333.58   , 2492.99 }
{   1667.05   , 2504.64 }
{   1683.42   , 2504.83 }
{   2873.1    ,  2537.75  }};

This master curve should not decrease on both sides. This was a mistake due to an aggregation of frequency curves.

I need to use Prony series to acquire the coefficents to plot the results in a time domain.

using E(t) = E0 +Ei*exp[-t/pi] (Summation of terms)

POSTED BY: Justin Hendrix

Put the data in proper Mathematica syntax. That means commas to separate list elements, and*10^(-8) instead of E-08.

POSTED BY: Daniel Lichtblau
Posted 7 years ago
POSTED BY: Justin Hendrix
POSTED BY: Daniel Lichtblau
Posted 7 years ago

Forgive me , but I'm still a little confused with results. How do you acquire the coefficients from this?

pi and Ei ?

POSTED BY: Justin Hendrix

What I computed is a bit different from your proposed form. It gives a sum of complex exponential. The coefficients are 'coeffs' and the exponents are 'freqs' in my code. Look up "Prony's method" for more details on what it provides.

POSTED BY: Daniel Lichtblau

Sorry for not knowing enough english: what is a Prony series? And what do you mean by

E(t) = E0 +Ei*exp[-t/pi] (Summation of terms) ?

What is Ei, and what is pi in your problem?

Perhaps you could write down the first 3 or four terms of your series, if possible in Mma-consistent form.

Concerning your new data given above you might want to have a look at

pp = FindFit[data, (a t)/(1 + b t), {a, b}, t]
f3 = (a t)/(1 + b t) /. pp
Plot[f3, {t, 0, 150}, Epilog -> Point@data, PlotRange -> All]
POSTED BY: Hans Dolhaine
Posted 7 years ago

Thank you Hans.

Fitting the results to a gaussian would be useful for the second half of these results. I currently need to fit them to an expansion that would get values to be eventually converted.

i borrowed your expression for Prony's equation. ffe = Ei+Normal[Series[(((pi^2)Ei(w^2))/(1+((pi^2)*(w^2)))),{w,0,19}]]

Where Prony =Ee+ Normal[Series[((((pi^2)Ei(w^2))/(1+((pi^2)*(w^2))))),{w,0,10}]] Pfit = Prony/. FindFit[data,Prony,{{Ee,1},{Ei,1},{pi,0.1}},w] SeriesCoefficent[Pfit,10]

gives me coefficents the results still dont fit. I may not be too sure how Prony's equation expands.

I am aware that people are able to do this in other software. Is there a way to convert this to sine, cosine?

POSTED BY: Justin Hendrix

Justin, your datapoints look like the overlay of two spectral lines. Why don't you try to fit them with two gaussians (given below as ffe)?

ffe = a Exp[-b (x - c)^2] + u Exp[-v (x - w)^2];
f2 = ffe /. FindFit[data,  ffe, {{a, 2000}, {b, 1}, {c, 4}, {u, 500}, {v, 1}, {w, 1.5}}, x]

and then

Plot[f2, {x, -2, 5}, Epilog -> Point /@ data]
POSTED BY: Hans Dolhaine
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard