Integration with variable limit
이전 댓글 표시
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
KSSV
2021년 6월 16일
What have you attempted for your home work?
Vivek Sharma
2021년 6월 16일
KSSV
2021년 6월 16일
Copy and paste code here...
Vivek Sharma
2021년 6월 16일
Vivek Sharma
2021년 6월 16일
편집: Vivek Sharma
2021년 6월 16일
Walter Roberson
2021년 6월 16일
I do not see any 2D integration in the pdf? I only see simple integrals of x*dt for t ranges
Vivek Sharma
2021년 6월 16일
답변 (1개)
Walter Roberson
2021년 6월 16일
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)
카테고리
도움말 센터 및 File Exchange에서 Programming에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!