what is the syntaxis for numerical solvers?
1 次查看(过去 30 天)
显示 更早的评论
Hi, for the last hour I am trying to start the numerical solver..
The copy-past from "help"
numeric::solve([sin(x) = y^2 - 1, cos(x) = y], [x, y]);
gives
Error: Unexpected MATLAB operator
for '::'
I can also use the other syntaxis option, which works fine in my script:
syms ha r2 positive; [h,rcone] = solve( hh(ha,r2) == 0, VV(ha,r2) == V0);
If use this, how do I define the range of ha and r2 in which I want the solutions?
0 个评论
采纳的回答
Petr
2012-12-12
3 个评论
Walter Roberson
2012-12-13
Note this from the numeric::solve documentation page:
Note: In contrast to the symbolic solver solve, the numerical solver does not react to properties of identifiers set via assume. To use these properties, call float ( hold( solve )(arguments)) instead.
更多回答(4 个)
Azzi Abdelmalek
2012-12-12
编辑:Azzi Abdelmalek
2012-12-12
sol=solve('sin(x) = y^2 - 1', 'cos(x) = y')
%or
sol=solve('sin(x) -y^2 + 1', 'cos(x) - y')
2 个评论
Walter Roberson
2018-12-13
编辑:Walter Roberson
2018-12-13
In older versions of MATLAB,
solve('x = exp(x+y)', 'x')
In more modern versions
syms x y
solve(x == exp(x+y), x)
However, MATLAB is not able to find a solution. A solution exists, and is
-lambertw(-exp(y))
but MATLAB is not strong on Lambert W processing.
Zuhaib
2012-12-12
it depend on your equation .. write function used in your equation for search in hepl of matlab
0 个评论
Walter Roberson
2012-12-12
numeric::solve is a MuPAD call that cannot be directly used from MATLAB. Use
feval(symengine, 'numeric::solve', [sym('sin(x) = y^2 - 1'), sym('cos(x) = y')], [sym('x'), sym('y')])
If you have R2011b or later (I think it is), you can use
syms x y
feval(symengine, 'numeric::solve', [sin(x) = y^2 - 1, cos(x) = y], [x, y])
Chibuzo Chukwu
2018-12-13
How do I make x the subject of this equation.using matlab
x = exp(x+y)
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!