Isolate equation with two variables
조회 수: 2 (최근 30일)
이전 댓글 표시
I'd like to separate two unknown symbolic equations for their variables.
For example using separable partial differential equations to solve the laplace equation:
syms f(x) g(y) u(x,y);
u=f(x)*g(y);
eqn=a*diff(u,2,x)+c*diff(u,2,y)==0;
isolate(eqn,x)
I want to use this for unknown user input and transform it to something like
-c*g(y)/diff(g(y), y, y)==a*f(x)/diff(f(x), x, x)
however, the isolate function only puts all arguments of y or x on one side as its not possible to solve for them leaving the equation in form of
g(y)*diff(f(x), x, x) + f(x)*diff(g(y), y, y) == 0
a and c are users inputs, however there is more input and laplace is only an example so that I can't just separate it manually.
Is there any way to get the equations in the form I need?
Thanks in advance
댓글 수: 0
답변 (1개)
arushi
2024년 5월 28일
Hi Arne,
To separate the variables in a partial differential equation like the Laplace equation, you can use the method of separation of variables. The goal is to rewrite the equation in a form where one side depends only on ( x ) and the other side depends only on ( y ). This is possible when the equation is homogeneous and linear.
Here’s how you can implement this in MATLAB :
syms f(x) g(y) lambda a c
eqn1 = diff(f,2) == -lambda*(c/a)*f;
eqn2 = diff(g,2) == lambda*g;
% Now you can solve eqn1 and eqn2 for f(x) and g(y) respectively
Hope this helps.
댓글 수: 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!