Isolate equation with two variables
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposte (1)
arushi
il 28 Mag 2024
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 Commenti
Vedere anche
Categorie
Scopri di più su Calculus in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!