Ergebnis enthält "oder"

조회 수: 1 (최근 30일)
Artur Walter
Artur Walter 2023년 11월 8일
댓글: Dyuman Joshi 2023년 11월 22일
Ich erhalte
eqn(x) = y(x) == 0 | y(x)*diff(y(x), x, x) + diff(y(x), x)^2 == 0
Wie kann ich auf zweite Bedingung zugreifen?
  댓글 수: 3
Artur Walter
Artur Walter 2023년 11월 10일
I typed
f = y(x)^2 * (diff(y(x), x))^2
eqn = functionalDerivative(f,y) == 0
Dyuman Joshi
Dyuman Joshi 2023년 11월 22일
@Artur Walter, see my answer below.

댓글을 달려면 로그인하십시오.

답변 (2개)

Dyuman Joshi
Dyuman Joshi 2023년 11월 16일
syms y(x)
f = y(x)^2 * (diff(y(x), x))^2;
eqn = functionalDerivative(f,y) == 0;
%Get the equation mentioned in the question description by using simplify()
eqn = simplify(eqn)
eqn(x) = 
%Children of the expression
z = children(eqn)
z = 1×2 cell array
{[y(x) == 0]} {[y(x)*diff(y(x), x, x) + diff(y(x), x)^2 == 0]}
%Access the second condition
condition2 = z{2}
condition2 = 

Aiswarya
Aiswarya 2023년 11월 16일
Hallo, ich würde die Frage auf Englisch beantworten.
(Hi,
I would be answering the question in English)
I understand that on equating a differential expression to zero, you obtained a conditional expression as a result.
The result obtained from the 'functionalDerviative' is a symbolic function and there is no direct way to just extract the second part of the "or" expression. However you can access the second condition by assuming condition for 'y' as shown in the following image.
You can use the assume function (https://www.mathworks.com/help/symbolic/sym.assume.html) to set non zero condition for y. And then simplify the equation to obtain just the second condition.

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!