hi ; i need help
I have this equation with 2 parametres a and b
syms b x a
solve ((2*cos(x) - b*(sin(x) + sin(a*x))) == 0) %chooses 'x' as the unknown and returns
I use solve but it return
Warning: Cannot find explicit solution.

1 comentario

VBBV
VBBV el 6 de Abr. de 2023
Movida: VBBV el 6 de Abr. de 2023
Consider these input values for a and b, for which solve function cant handle the solution. In such cases, use vpasolve to solve equation numerically as recommended by Matlab
syms x real
a = 4; % assume some value
b = 1.5; % assume value
sol=solve ((2*cos(x) - b*(sin(x) + sin(a*x))) == 0,[x]) %
Warning: Unable to solve symbolically. Returning a numeric solution using vpasolve.
sol = 
0.31726439340850840945560345483897
sol = vpasolve((2*cos(x) - b*(sin(x) + sin(a*x))) == 0,[x])
sol = 
0.31726439340850840945560345483897

Iniciar sesión para comentar.

 Respuesta aceptada

VBBV
VBBV el 6 de Abr. de 2023

0 votos

syms b x a
sol=solve ((2*cos(x) - b*(sin(x) + sin(a*x))) == 0,[x a b])
sol = struct with fields:
x: [2×1 sym] a: [2×1 sym] b: [2×1 sym]
%chooses 'x' as the unknown and returns
sol.x
ans = 
sol.a
ans = 
sol.b
ans = 

5 comentarios

VBBV
VBBV el 6 de Abr. de 2023
You need to have 3 equations to solve for x , a and b. But you have only 1 eqn. Can you elaborate what you are trying to find ?
alize beemiel
alize beemiel el 6 de Abr. de 2023
i need to solve this equation with this parameter
cause this parameter change
VBBV
VBBV el 6 de Abr. de 2023
syms x real
a = 1; % assume some value
b = 1; % assume value
sol=solve ((2*cos(x) - b*(sin(x) + sin(a*x))) == 0,[x]) %
sol = 
The equation doesn't have explicit solution as warning suggests which means no closed form solution exists, However, if you consider real finite range of values for parameters a and b then you may possibly get a solution. So it depends on what range of values you consider for parameters in the equation
alize beemiel
alize beemiel el 6 de Abr. de 2023
this is what i want by using matlab
alize beemiel
alize beemiel el 6 de Abr. de 2023
thank you Sir ..for your help and your time

Iniciar sesión para comentar.

Más respuestas (1)

Chunru
Chunru el 6 de Abr. de 2023

0 votos

There is no close form solution when a and b are arbitrary constant for the equation.
If you want to find the numerical solution of the equation with specified a and b, you can use vpasolve:
syms b x a
solve ((2*cos(x) - b*(sin(x) + sin(a*x))) == 0)
Warning: Unable to find explicit solution. For options, see help.
ans = Empty sym: 0-by-1
a = 2; b=0.1;
vpasolve ((2*cos(x) - b*(sin(x) + sin(a*x))) == 0) %chooses 'x' as the unknown and returns
ans = 
7.7984925986314595610243884059956

3 comentarios

alize beemiel
alize beemiel el 6 de Abr. de 2023
i dont need numerical solution i need expression of x=with (a and b as parameters)
some one tell me to use inverse Lagrange theorem its look complicate for me ...there is another alternative or something with Matlab to solve my equation?
using nonlinear methods or something in Matlab
Chunru
Chunru el 6 de Abr. de 2023
MATLAB tell you that its solver could not find the explicit solution.
alize beemiel
alize beemiel el 6 de Abr. de 2023
thank you for all
i will try to use Newton Raphson Methode maybe its give me an approximate solution

Iniciar sesión para comentar.

Categorías

Más información sobre Symbolic Math Toolbox en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 6 de Abr. de 2023

Comentada:

el 6 de Abr. de 2023

Community Treasure Hunt

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

Start Hunting!

Translated by