Using SOLVE with integration which has no explicit solution
Show older comments
Using the symbolic toolbox(Matlab R2012a), I want to solve for the root of f(y)=0. In the example below, the answer should be y=0. However, if I run the following codes, I get errors indicated further below. It seems that the integration with no explicit solution is causing the problem. I would appreciate any ideas for fixing this problem. Thanks.
-------------------------------
syms x y
f = y - int(exp(-(log(x))^2)*(y + y/x), x, 0.1, 1);
solve(f, y)
---------------------------------
Error using mupadengine/feval (line 157) MuPAD error: Error: Second argument must be either of form x or x=a..b. [int]
Error in solve (line 160) sol = eng.feval('symobj::solvefull',eqns,vars);
2 Comments
Walter Roberson
on 20 Apr 2014
f = -(1/2)*y*(sqrt(Pi)*exp(1/4)*erf(ln(2)+ln(5)+1/2)-sqrt(Pi)*exp(1/4)*erf(1/2)+sqrt(Pi)*erf(ln(2)+ln(5))-2)
and solve(f,y) gives y = 0
Walter Roberson
on 20 Apr 2014
The error message suggests the possibility that in your actual code, you have given "y" a value.
Answers (0)
Categories
Find more on Code Performance 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!