Edit: My approach was wrong, I have solved this - please see comments
I've been scouring the answers and the docs but I'm having trouble figuring out the answer to this one. In particular, Olksander R.'s answer was particularly helpful.
I have a single PDE I'm trying to fit to a dataset (R is a constant):
a'[T] == A/B Exp[-Ea/(R T)] (1 - a[T])^n a[T]^m
Five total data points were collected, and they define more than one of the variables in the partial differential equation. Please note that the dadT variable represents the left-hand-side of the PDE.
BVal = {2, 5, 10, 15, 20};
Tval = {448, 461, 473, 480, 484};
aVals = {0.659090909, 0.617021277, 0.58, 0.568627451, 0.528301887};
dadT = {0.025, 0.023404255, 0.02, 0.021960784, 0.016981132};
Plugging these values in to the PDE gives me a set of 5 equations, with some of the variables parameterized and some needing to be fit.
I'm not sure how to handle the fact that I have data for the "left-hand-side" of the equation.
Edit: I added an equality of the a'[T] value with it's measured value.
I still intend to fit (Transpose[{aVals,dadT}]) with NonlinearModelFit later.
a'[T]==(A E^(-((0.120272 Ea)/T)) (1-a[T])^n a[T]^m)/B
a'[448]==0.025==1/2 0.340909^n 0.659091^m A E^(-0.000268465 Ea)
a'[461]==0.0234043==1/5 0.382979^n 0.617021^m A E^(-0.000260894 Ea)
a'[473]==0.02==1/10 0.42^n 0.58^m A E^(-0.000254275 Ea)
a'[480]==0.0219608==1/15 0.431373^n 0.568627^m A E^(-0.000250567 Ea)
a'[484]==0.0169811==1/20 0.471698^n 0.528302^m A E^(-0.000248496 Ea)
Where now I need to determine {A, B, n, m, Ea}.
I found some great answers using ParametricNDSolveValue to create parameterized system for NonlinearModelFit to then regress to the values of variables. Edit: My system of equations spits out a ParametricFunction, but it is not readily yielding and interpolating function to then fit:
nDss = ParametricNDSolveValue[system, a, {T, 448, 484}, {A, n, m, B, Ea}]
ParametricFunction[Expression: a, Parameters: {A,n,m,B,Ea}]
Attempting to parameterize the solution to get a single interpolating function gives me the following error:
nDss[.3, 2,.7, .8, .001]
ParametricNDSolveValue::icordinit: The initial values for all the dependent
variables are not explicitly specified. NDSolve will attempt to find
consistent initial conditions for all the variables.
ParametricNDSolveValue::ndnco: The number of constraints (5) (initial
conditions) is not equal to the total differential order of the system plus
the number of discrete variables (1).
If I understand, Mathematica is trying to tell me the I don't have enough inital conditions to solve the PDE. Is that right?
Really, I don't need a solution to the PDE; I need to do a multivariate least-squares fit of my dataset to determined the variables in the PDE. My thinking in using this approach was that my data collection would allow me to parameterize the PDE enough to get some interpolants which could then be used to minimize, like in Oleksandr's answer linked above. Maybe my approach is wrong - any comments are helpful!!!
a[T]instead ofa. What do you get? Also, to what parameterdadTcorresponds to? Is ita'[T]? – Anton Antonov Apr 06 '18 at 15:35a[t]':ParametricNDSolveValue::dvnoarg: The function a appears with no arguments.dadTcorresponds to the valuea'[t]- the derivative of a vs. T – Jake M Apr 06 '18 at 16:31a'[T]nota[T]'– m_goldberg Apr 07 '18 at 01:47a[T]', I meant to typea[T].All three function variables
a,a[T], anda'[T]give me the exact samefunction appears with no argumentserror. – Jake M Apr 08 '18 at 15:31awitha[T]in your equationa'[T] == A/B Exp[-Ea/(R T)] (1 - a[T])^n a[T]^m– swish Apr 10 '18 at 18:28