MATLAB: How can i solve an equation with an integral when the upper bound is the unknown variable

integralMATLABsolve

I want to solve the following equation: asin((R2+RO)*sin(a)/(2*Ro))*Ro==int(t*sqrt(vx(t)^2+vy(t)^2)) with the lower bound of the integral known and the upper bound being t1, which needs to be solved. How do i use in integral in a solve function?

Best Answer

Hi,
.
If:
- all variables except t (upper bound) are known,
- assuming that Walter (as usual) is right with his commentary and that arcsine is meant instead of a * sin
- and RO = Ro
.
you can solve it like this:
syms R2 RO a Ro t vx_t0 vy_t0 t0 vx_t1 vy_t1 t1
f = asin((R2+RO)*sin(a)/(2*RO))*RO == int(t1*sqrt(vx_t1^2+vy_t1^2)) - int(t0*sqrt(vx_t0^2+vy_t0^2))
divides the integral into the upper - lower bound with the corresponding variables. When solving for t1 and simplifying the result you get:
sol_t1 = t1 == simplify(solve(f,t1))
or as a function handle:
t1_fun = @(R2,RO,a,t0,vx_t0,vx_t1,vy_t0,vy_t1)(RO.*asin((sin(a).*(R2+RO).*(1.0./2.0))./RO).*2.0+t0.*vy_t0.^2.*log(vx_t0+sqrt(vx_t0.^2+vy_t0.^2))+t0.*vx_t0.*sqrt(vx_t0.^2+vy_t0.^2))./(vx_t1.*sqrt(vx_t1.^2+vy_t1.^2)+vy_t1.^2.*log(vx_t1+sqrt(vx_t1.^2+vy_t1.^2)))
Of course, this only works if the above conditions are met. Then you can calculate your upper limit (here: t1) in this way.
Best regards
Stephan
Related Question