Integration with variable limit

7 vues (au cours des 30 derniers jours)
Vivek Sharma
Vivek Sharma le 16 Juin 2021
Commenté : Vivek Sharma le 16 Juin 2021
Hope you all are fit and sailing the storm perfectly.
I need help in writing a MATLAB code for the problem attached herewith .
I shall be thankful to you.
Thank you,
Vivek Sharma
  7 commentaires
Walter Roberson
Walter Roberson le 16 Juin 2021
I do not see any 2D integration in the pdf? I only see simple integrals of x*dt for t ranges
Vivek Sharma
Vivek Sharma le 16 Juin 2021
Yes sir, its simple integral x*dt And the range of t is coming from iteration.
It is my try, as i said i am new bee for MATLAB.
Please any help!

Connectez-vous pour commenter.

Réponses (1)

Walter Roberson
Walter Roberson le 16 Juin 2021
x=0.01
That x is numeric
for i=1:m
That assigns i as a numeric variable.
T_equ(i)=(T_1+T_2(i))/2;
That assigns to T_equ() indexed at the numeric variable i
syms T_2(i) T_eq(i)
That declares that T_2 and T_eq are symbolic functions with argument i . This will not be the numeric i : this will reassign i to be an (unresolved) symbolic variable. The line there is equivalent to
i = sym('i');
T_2 = symfun('T_2(i)', i);
T_equ = symfun('T)equ(i)', i);
Notice that the numeric i is gone after this.
f=x;
x is numeric, so f will be numeric
T_2max=T_2(i);
That will invoke the symbolic function T_2 with parameter i (which is symbolic now). The result will be the unresolved T_2(i) except it will not be a symbolic function that is returned.
int(f,T_2(i),T_2min, T_2max);
f will be numeric. int() is not defined for a numeric first parameter.
If you were to use
int(sym(f),T_2(i),T_2min, T_2max);
then you would be set up to try to integrate the symbolic value 1/100 with respect to the variable T_2(i) with particular lower and upper bound. But T_2(i) is the symbolic function call T_2(i) rather than being a simple variable, and int() does not permit integrating with respect to a function call.
I do not know why you are going through all that trouble?
syms t T T__2
int(sym(x), t, T__2, T)
  1 commentaire
Vivek Sharma
Vivek Sharma le 16 Juin 2021
Thank you so much Sire!

Connectez-vous pour commenter.

Catégories

En savoir plus sur Programming dans Help Center et File Exchange

Produits


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by