Hi,
I have som trouble to understand how the int function is used.
I want to solve the integration constant myself. But matlab gives a constant in the int step.
v=int(a,t);
This line gives
-(g*(2*cos(t*w) + t*w + 2))/(2*w)
Which is wrong in my opinion. The solution is -(g*(2*cos(t*w) + t*w ))/(2*w) + C
Which means that C have already been calculated (C=-g/w). How can I prevent matlab from calculating C? So i can add C by myself.
(I understand that i can add the same constant v=int(a,t)+g/w. But then i need to calculate the constant first..)
Br
This is my code:
syms t g w c1
a= g*sin(w*t)-g/2;
ll=pi/6/w;
ul=5*pi/6/w;
v=int(a,t);
v1=v+c1;
C1_ =solve(subs(v1,t,ll)==0,c1);
simplify(C1_)
v=v+C1_;
simplify(v)
s=int(v,t,ll,ul);
s=vpa(s)
2 Comments
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/638510-integration-using-symbolic-how-about-the-constant#comment_1115945
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/638510-integration-using-symbolic-how-about-the-constant#comment_1115945
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/638510-integration-using-symbolic-how-about-the-constant#comment_1120220
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/638510-integration-using-symbolic-how-about-the-constant#comment_1120220
Sign in to comment.