How to add two symbolic functions?

5 visualizaciones (últimos 30 días)
Khalil Ishaq
Khalil Ishaq el 12 de Dic. de 2016
Respondida: Walter Roberson el 12 de Dic. de 2016
The code below is to solve for differentiation symbolically; however, I cant add the qo1 and qo2. Any help is appreciated.
function []=Derivatives()
syms kLa RPM qsMax Sm Ki Ks Com V Xm Ko Yx qs qM mum qo qo1 YOSan YOSen dXmdt dComdt u
%%Given Relations
qs=symfun(qsMax*(Sm/(Ks+Sm+Sm*Sm/Ki))*(Com/(Ko+Com)),[qsMax Ks Sm Ki Ko Com]);
mum=symfun((qs-qM)*Yx,[qM Yx]);
qo1=symfun(((YOSan-YOSen)*mum*(0.96/0.375)),[YOSan YOSen]);
qo2=symfun(YOSen*qs,[YOSen]);
qo=plus(qo1,qo2);
%%Rates Symbolically
dXmdt=symfun(mum*Xm-(u/V)*Xm,[Xm u V Xm]);
dComdt=symfun(kLa*(Costar-Com)-qo*Xm-(u/V)*Com,[kLa Costar Com qo Xm u V ]);
diff(dXmdt,Xm)

Respuesta aceptada

Walter Roberson
Walter Roberson el 12 de Dic. de 2016
qo = symfun(plus(qo1(YOsan, YOsen), qo2(YOsen)), [YOsan, YOsen]) ;
That is, invoke them with symbolic arguments to get a symbolic expression, add the expressions, and create a symbolic function from the results.
You will find that most of the time it is easier to work with symbolic expressions rather than symbolic functions.

Más respuestas (0)

Categorías

Más información sobre Symbolic Math Toolbox en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by