How to perform symbolic integration?
Show older comments
I am trying to perform symbolic integration of a complex equation. The code is given below. But every time I run the code the result in the command window displays the last line. What am I doing wrong. Can anyone help me solving this?
clc
clear all
syms phi wt pi
V=((cos(wt)-cos(phi)*((sin(phi)-(phi*cos(phi))))^(1/2))*(sin(phi)));
int(V,phi,wt,pi)
2 Comments
Abolfazl Chaman Motlagh
on 17 Feb 2022
Edited: Abolfazl Chaman Motlagh
on 17 Feb 2022
can you describe what you trying to do. you want to integrate V as a function of phi with lower bound of wt and upperbound of pi ?? or you want an indefinite triple integration over V ??
Md. Golam Zakaria
on 17 Feb 2022
Edited: Md. Golam Zakaria
on 17 Feb 2022
Accepted Answer
More Answers (1)
Do you presume that every integral you write down has a symbolic, analytical solution? Is that perhaps really a good idea?
syms phi wt pi
V=((cos(wt)-cos(phi)*((sin(phi)-(phi*cos(phi))))^(1/2))*(sin(phi)))
In this case, I'd suggest that phi inside and out of the trig functions, and inside a square root is a problem. So when int just gives up, and displays the result as what you wanted to solve, that means it was unable to find a solution.
By the way, declaring pi as a symbolic variable there is probably a bad idea.
vpa(pi)
pi is no longer defined as the number 3.14159..., but now as just a variable named pi. And now MATLAB can now no longer use known properties of pi and how trig functions behave in concert with pi.
1 Comment
Md. Golam Zakaria
on 17 Feb 2022
Categories
Find more on Conversion Between Symbolic and Numeric in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
