Find a variable as function of other variable with equations system using Symbolic ToolBox
Mostrar comentarios más antiguos
I have 3 equations that connects between 4 variables, let's say:
syms a b c d;
r=b+d;
e=pi/2;
eq1 = c - a*sin(d) + b*cos(d) == 0;
eq2 = r - c*tan(e) - a*cos(d) - b*sin(d) == 0;
eq3 = b == e*r + a*tan(e);
Now I would like to find c(d), means, I would like to find what is c as a function of other variable, in this case - d.
Then perform other operations on c(d) such as differntiate etc.
What would be the best/easiest way to do that using Symbolic Toolbox?
Thanks.
2 comentarios
Walter Roberson
el 4 de Abr. de 2020
10 radians is an unusual angle, but that is probably not so important for your question.
Evyatar Sivan
el 4 de Abr. de 2020
Respuesta aceptada
Más respuestas (1)
Ameer Hamza
el 4 de Abr. de 2020
try this example
syms a b c d;
r=b+d;
e=pi/2;
eq1 = c - a*sin(d) + b*cos(d) == 0;
eq2 = r - c*tan(e) - a*cos(d) - b*sin(d) == 0;
eq3 = b == e*r + a*tan(e);
sol = solve([eq1 eq2 eq3], [a b c]);
C = sol.c; % c as function of d
% Now find its derivative
dC_dd = diff(C,d); % dc/dd
% you can also integrate it
IC = int(C,d);
Categorías
Más información sobre Assumptions en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!