Info

此问题已关闭。 请重新打开它进行编辑或回答。

Solve a nonlinear system.

3 次查看(过去 30 天)
José Bavio
José Bavio 2011-12-27
关闭: MATLAB Answer Bot 2021-8-20
I would like to solve this system. It gives no solution when it is suposed to.
This is the code:
syms s t
Q_estim1=[-1 1;2 -2];
h1=diag([1 2]); prob_perd=0.01; b=2;
aux=expm(Q_estim1*100);
pi_inf1=aux(1,:);
alfa1=log(pi_inf1*expm((Q_estim1+h1*s)*t)*ones(2,1))*1/(s*t);
eq1=diff(alfa1,s);
eq2=diff(alfa1,t);
solve('eq1-prob_perd/(s^2*t)','eq2-prob_perd/(s*t^2)-b/t^2')
I don't need analytic solution. Any help will be gratly apreciated.
  3 个评论
José Bavio
José Bavio 2011-12-27
prob_perd is constant.
bym
bym 2011-12-27
ah...right
you are mixing floating point and symbolic operations which can lead to trouble. Best to use symbolic to a point then use subs() to plug in numerical values

回答(1 个)

Walter Roberson
Walter Roberson 2011-12-27
When you pass a literal string to solve() then values set at the MATLAB level will not be substituted in. Remove the quotes.
solve(eq1-prob_perd/(s^2*t),eq2-prob_perd/(s*t^2)-b/t^2)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by