![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/504793/image.jpeg)
Solve non-separateable equation
조회 수: 1 (최근 30일)
이전 댓글 표시
I have a equation like this . Its just a simplified form of my actual equation to illustrate my query. The output y and input time t are non seperatable.
![equation](https://www.mathworks.com/matlabcentral/answers/uploaded_files/504673/equation.jpeg)
I wanted to solve it in Matlab to find the value of y for the time interval t
I saw examples of fsolve and fzero. But all of them are for seperatable functions. How can I solve this one?
I tried this too. But Error
y^2 = @(x)y*x^2 +(1+x)/(y+1);
t = linspace(-3.5,3.5);
plot(t,y(t),t,zeros(size(t)),'k-')
xlabel('x')
ylabel('y(x)')
댓글 수: 0
채택된 답변
John D'Errico
2021년 1월 31일
편집: John D'Errico
2021년 1월 31일
The usual name for this is an implicit function. There is no relationship where you can solve directly for y as a function of x. Actually, in the function you wrote, it is technically possible, but you said this is not your real problem.)
Of course, this syntax is meaningless in MATLAB:
y^2 = @(x)y*x^2 +(1+x)/(y+1);
You have an implicit function. The simplest way to solve the problem is to use fimplicit to plot it.
Fxy = @(x,y) -y.^2 + y.*x.^2 + (1 + x)./(1 + y);
fimplicit(Fxy,[-3.5,3.5])
xlabel X
ylabel Y
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/504793/image.jpeg)
As you can see in the plot, for ANY given x, there are multiple values of y. So it is not a single valued function, but one with multiple branches, and a singularity.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Calculus에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!