Insert f coefficient in pdetool
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (1)
Bill Greene
le 27 Avr 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
Voir également
Catégories
En savoir plus sur Mathematics and Optimization dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!