How to solve simultaneous equation?

3 views (last 30 days)
jaejin kim
jaejin kim on 7 Oct 2020
Answered: Pranav Verma on 16 Oct 2020
First, I input this code. y == C*( (sin(w*t) )^2 / (A + sqrt(R*y + B^2)))
syms A R B C y w t;
eqn = y == C*( (sin(w*t) )^2 / (A + sqrt(R*y + B^2)));
[n,d] = numden(rhs(eqn));
ysol = solve(eqn * d, y, 'maxdegree', 3)
Second, y == C*( (sin(w*t) )^2 / (A*log(y) + B*y + R))
syms A R B C y w t;
eqn = y == C*( (sin(w*t) )^2 / (A*log(y) + B*y + R));
[n,d] = numden(rhs(eqn));
ysol = solve(eqn == 1, y);
Warning: Unable to find explicit solution. For options, see help.
> In solve (line 317)
Why don't solve the second equation? Couldn't the equation originally solve?
And If you can afford it, I hope you solve an additional problem.
The first solution is very complicated. I hope to get simpler solution or approximation.
I want to remove meaningless or really small terms.
I expect the solution is about a*sin(wt) + b*(sin(wt)^2) .
For example, A = 2.213, R = 0.736, B^2 = 0.182, C = 10, w = 2000
Isn't there a way to simply change the solution I got?
Any help will be greatly appreciated. Thanks in advance.

Answers (1)

Pranav Verma
Pranav Verma on 16 Oct 2020
Hi Jaejin,
From the issue that you have mentioned, my understanding is that you are trying to solve y == 1 which must be provided in the solve function as:
ysol = solve(eqn*d, y);
instead of:
ysol = solve(eqn == 1, y);
The solution to the second equation mentioned in the question could not be found by the solve function which is why it throws the warning "Unable to find explicit solution." and hence the solve function returns an empty sym in “ysol” variable. There might be a possibility that there exists no solution to the equation you have mentioned.
You can try expanding the logarithmic term in the equation (log y) using the series expansion formula to some terms and then try to put the equation in the solve function to derive a solution.
For your second query regarding a simpler solution, please refer to the below page where it mentions different methods avaiable in MATLAB for simplifying the solution obtained:

Community Treasure Hunt

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

Start Hunting!

Translated by