Azzera filtri
Azzera filtri

Multivariable Integration w.r.t to 1 variable: 2nd variable is a function of 1st

1 visualizzazione (ultimi 30 giorni)
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.
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.

Risposta accettata

Torsten
Torsten il 30 Dic 2023
Modificato: Torsten il 30 Dic 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 Commenti
Torsten
Torsten il 30 Dic 2023
Modificato: Torsten il 30 Dic 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
Dyuman Joshi il 31 Dic 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.

Accedi per commentare.

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by