Solving a Second Order Piecewise Quadratic Equation
4 次查看(过去 30 天)
显示 更早的评论
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
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 ?
采纳的回答
Walter Roberson
2021-12-3
syms a b x(t)
x__prime = diff(x)
x__prime__prime = diff(x__prime)
eqn = a/(x__prime__prime*x__prime__prime) == b
sol = dsolve(eqn)
syms x_2(t)
x_2__prime = diff(x_2)
x_2__prime__prime = diff(x_2__prime)
eqn_2 = a/(x__prime__prime * x_2__prime__prime) == b
sol_2 = dsolve(eqn_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 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Particle & Nuclear Physics 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!