Insert f coefficient in pdetool
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
Bill Greene
2014-4-27
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
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Mathematics and Optimization 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!