Multivariable Integration w.r.t to 1 variable: 2nd variable is a function of 1st
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Aviral Srivastava
el 29 de Dic. de 2023
Comentada: Dyuman Joshi
el 31 de Dic. de 2023
I need to find the integral of the function:
, where g is an algebraic polynomial. I have been using the symbolic toolbox but the integral cant be evaluated and I obtain just the command as the output. The integration is w.r.t y, but there is a catch y itself is a function of x (my phyical model is such, but x and y represent two different quantitites). Moreover the limits of the integration w.r.t to y are functions of x. This is possible with the int function of sym toolbox but can't use as above mentioned.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1579001/image.png)
I am trying using integral through a numerical approach which looks like this:
k = @(T) T;
w = @(k,T) log(1 - exp(-k^2 + 1/T))
a = @(T) double(T);
b = @(T) double(2*T);
W = @(T) integral(@(k) w(k,T), a, b )
This time I get two errors during execution: i) a and b must be floating scalars
ii) W just returns the exact line of the command again viz: "integral(@(k) w(k,T), a, b )"
If any can suggest a way out, it will be really helpful.
0 comentarios
Respuesta aceptada
Torsten
el 30 de Dic. de 2023
Editada: Torsten
el 30 de Dic. de 2023
If y is a function of x, your integrand equals F(y(x~))*y'(x~) dx~. Thus your integral equals
integral_{x~=f_lower(x)}^{x~=f_upper(x)} F(y(x~))*y'(x~) dx~
and the result is a function of x.
So what is f_lower(x), f_upper(x) and y(x) in your case ?
11 comentarios
Torsten
el 30 de Dic. de 2023
Editada: Torsten
el 30 de Dic. de 2023
Finally could you let me know if there is a way to approach this using the symbolic toolbox, as my existing framework is using that approach only.
W(2) is a symbolic expression - thus you are back in the realm of symbolic computations.
I don't think you can convert W = W(T) into a symbolic function since a numerical function (integral) is involved.
Dyuman Joshi
el 31 de Dic. de 2023
There's a good chance that the symbolic integral can not be computed.
If you want a numerical value, it will be better to go with numerical integration as Torsten has shown above.
Más respuestas (0)
Ver también
Categorías
Más información sobre Assumptions en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!