필터 지우기
필터 지우기

Solving a Second Order Piecewise Quadratic Equation

조회 수: 2 (최근 30일)
MarshallSc
MarshallSc 2021년 12월 3일
답변: Walter Roberson 2021년 12월 3일
How can I solve a second order quadraic nonlinear equation for each components of two matrices. For example, having:
a=rand(10,10); b=rand(10,10);
For the equation:
I'm looking for the analytical solution. I tried to write a code but I don't know what solver to use, ODE45 or dsolve.
Also, if I want to solve the gradient of this equation (getting the antiderivative of the equation to make it first order equation) which will be solmething like this:
How can I solve them? I'd appreciate it if someone can help me!
  댓글 수: 2
Walter Roberson
Walter Roberson 2021년 12월 3일
Is that x double-prime, quantities individually squared, quantities then individually multiplied by themselves?
Is that x double-prime, quantities individually squared, matrix-multiply by itself (inner product)?
Is that x double-prime, matrix-multiply by itself (inner product) to do the part, then again matrix-multiplied by itself?
That is, I am not clear as to why you are not using ?
MarshallSc
MarshallSc 2021년 12월 3일
편집: MarshallSc 2021년 12월 3일
Well, yes, since they are the same, it will be in the form of . I wrote it in this way because sometimes, the two xs are not the same (not in this case), and I was going to ask a follow up question to see how I can solve a set of these equations if the two xs are not the same (x1, x2) and we have another equation with different a, b (say c,d), so it will be a system of equations.

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

채택된 답변

Walter Roberson
Walter Roberson 2021년 12월 3일
syms a b x(t)
x__prime = diff(x)
x__prime(t) = 
x__prime__prime = diff(x__prime)
x__prime__prime(t) = 
eqn = a/(x__prime__prime*x__prime__prime) == b
eqn(t) = 
sol = dsolve(eqn)
sol = 
syms x_2(t)
x_2__prime = diff(x_2)
x_2__prime(t) = 
x_2__prime__prime = diff(x_2__prime)
x_2__prime__prime(t) = 
eqn_2 = a/(x__prime__prime * x_2__prime__prime) == b
eqn_2(t) = 
sol_2 = dsolve(eqn_2)
sol_2 = 
I think for sol_2 there is a fundamental problem that you are asking to solve one equation with respect to two functions.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by