how to use solve
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
alize beemiel
el 6 de Abr. de 2023
Comentada: alize beemiel
el 6 de Abr. de 2023
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
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]) %
sol = vpasolve((2*cos(x) - b*(sin(x) + sin(a*x))) == 0,[x])
Respuesta aceptada
VBBV
el 6 de Abr. de 2023
syms b x a
sol=solve ((2*cos(x) - b*(sin(x) + sin(a*x))) == 0,[x a b])
%chooses 'x' as the unknown and returns
sol.x
sol.a
sol.b
5 comentarios
Más respuestas (1)
Chunru
el 6 de Abr. de 2023
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)
a = 2; b=0.1;
vpasolve ((2*cos(x) - b*(sin(x) + sin(a*x))) == 0) %chooses 'x' as the unknown and returns
3 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!