Insert f coefficient in pdetool
1 view (last 30 days)
Show older comments
Hi all,
y = parabolic(y0,time,b,p,e,t,c,a,f,d)
I need to indicate that the coefficient f depends on the solution "y" and a constant "F" calculated in the previous step. It is clear how to do it when f depends on (x,y,t), however, I don't know how to introduce another parameter. I would need something like
y = parabolic(y0,time,b,p,e,t,c,a,'fcoeff(y,F)',d)
where fcoeff(y,F) is a user function. However, I keep getting this error
Undefined function or variable 'F'
It only recognizes the variables x,y,t. Any suggestion?
0 Comments
Answers (1)
Bill Greene
on 27 Apr 2014
Do you calculate F in fcoeff? If so, you can make it a global variable and it will retain its value between calls to fcoeff.
One complicating factor is that the parabolic function uses the variable time step ODE solver, ode15s, internally. So fcoeff gets called at unevenly-spaced and possibly non-monotonically increasing time points. You may need to save several values of F along with the times where they are computed and select a particular one or interpolate between values to obtain the value of F you need.
Bill
See Also
Categories
Find more on Mathematics and Optimization in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!