Borrar filtros
Borrar filtros

Finding unknown coefficients of a polynomial

1 visualización (últimos 30 días)
Saurav Agarwal
Saurav Agarwal el 25 de Mayo de 2012
Hi,
Matlab Version 2010b
I need to find the coefficients a0 a1 a2 a3 a4 a5 a6 a7
But the program is taking a very long time to run and I have to break the run.
function []=Traject()
syms y_t0 y_t4 x_t0 t t0 t1 t3 t4 a0 a1 a2 a3 a4 a5 a6 a7
clc;
del_pp1=(t-t0)/(t4-t0);
a_y=y_t4-y_t0;
y=y_t0+a_y*del_pp1^2*(3-2*del_pp1);
x=a0+a1*y+a2*y^2+a3*y^3+a4*y^4+a5*y^5+a6*y^6+a7*y^7;
D_x=diff(x,t);
DD_x=diff(D_x,t);
t2=(t4+t0)/2;
tb=(t4+3*t0)/4;
te=(3*t4+t0)/4;
eqn1=subs(x,t,t1)-x_t0-subs(DD_x,t,t1)*(t1-t0)^2/6
eqn2=subs(DD_x,t,t1)*(t1-t0)/2-subs(D_x,t,t1)
eqn3=subs(DD_x,t,tb)
eqn4=subs(D_x,t,t2)
eqn5=subs(DD_x,t,t2)
eqn6=subs(DD_x,t,te)
eqn7=subs(D_x,t,t3)+subs(DD_x,t,t3)*(t4-t3)/2
eqn8=subs(x,t,t3)+subs(D_x,t,t3)*(t4-t3)+subs(DD_x,t,t3)*(t4-t3)^2/3-x_t0
solve(eqn1,eqn2,eqn3,eqn4,eqn5,eqn6,eqn7,eqn8,a0,a1,a2,a3,a4,a5,a6,a7)
end
Please help me out. I guess I am doing something wrong or I just have to wait for a much longer time.
Regards.

Respuestas (0)

Categorías

Más información sobre Numbers and Precision en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by