Difficulty solving simple implicit equation
显示 更早的评论
Hi guys,
I am struggling to solve numerically a pretty simple implicit equation.I want to solve for Im.
Im = ((Imax-Imin).*L +Imin).*sinh(a.*V-Im*R);
R and a are constants (around 50 and 1.3 respectivelly)
V is an 126x1 double - starts at 0 and increases linearly (steps of 0.02) to 2.5
L is an 1x126 array - starts at 1 and decreases exponentially to 0
My simple code is:
syms Im;
S = vpasolve(((Imax-Imin).*letSee +Imin).*sinh(a.*V-Im*R)-Im == 0, Im);
I receive the following error:
Error using mupadengine/feval (line 195)
More equations than variables is only supported for polynomial systems.
Error in sym/vpasolve (line 172)
sol = eng.feval('symobj::vpasolve',eqns,vars,X0);
Any help?
4 个评论
John D'Errico
2022-5-30
编辑:John D'Errico
2022-5-30
It is best to show what you tried. Then someone will just need to show you what to fix. Otherwise someone needs to write the complete solution for you. By showing your code, it also makes it easier for someone to decide to help you, since it is then clear that you did make some effort.
Note that fzero CANNOT be used to solve multiple vectorized problems, and since you tell us that V is a vector and L is also a vector, then you CANNOT use fzero directly. You also CANNOT use vpasolve.
As far as the variables V and L go, you also need to be far more specific what You mean by log and linear. That is, while I can guess that for V to be a linear vector that spans [0,2.5] you have used linspace. But what is L? By being clear, and by actually showing some code, you make it easier for somoen to help you.
So what did you try? SHOW your CODE. Put it into either a comment on your question, or by editting your question, NOT as an answer.
Walter Roberson
2022-5-30
vpasolve could be used together with arrayfun
John D'Errico
2022-5-30
编辑:John D'Errico
2022-5-30
True. But that is not a direct solution, nor one that a new user would be expected to find. A loop is probably simpler. If a direct solution was available, then one could just use solve, and then substitute the sets of vectos in question. Were a solution to exist, it would probably involve either a Lambert W or Wright omega. But the sinh complicated things, instead of a simple exponential. So even without trying it, my guess is the direct solve will fail. And that means a simple loop, using fzero or vpasolve is probably simplest.
However, in anycase, if lmax and lmin are not provided, then both fzero AND vpasolve must fail. So that means there is probably no solution available at all. IF lmax and lmin are not both provided.
Nikolaos Barmpatsalos
2022-5-31
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Equation Solving 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!