how to find f"(0) where f=y(1),f'=y(2),f"=y(3)
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
dydx=[y(2); y(3); 2*a1*y(2)*(y(2)+y(5))-a1*y(3)*(y(1)+y(4));
y(5); y(6); 2*a1*y(5)*(y(2)+y(5))-a1*y(6)*(y(1)+y(4));
y(8); A*Pr*a2*y(7)*(y(2)+y(5))-Pr*a2*y(8)*(y(1)+y(4))];
res=[ya(1); ya(2)-1; ya(4); ya(5)-p; ya(7)-1; yb(2); yb(5); yb(7)];
2 commentaires
Réponse acceptée
Plus de réponses (1)
Walter Roberson
le 16 Avr 2018
%construct initial values any way suitable for you
a1 = rand();
a2 = rand();
A = rand();
Pr = rand();
ya = rand(1,7);
yb = rand(1,7);
p = rand();
%now find the values
dxdy = @(t,y) [y(2); y(3); 2*a1*y(2)*(y(2)+y(5))-a1*y(3)*(y(1)+y(4));
y(5); y(6); 2*a1*y(5)*(y(2)+y(5))-a1*y(6)*(y(1)+y(4));
y(8); A*Pr*a2*y(7)*(y(2)+y(5))-Pr*a2*y(8)*(y(1)+y(4))];
res=[ya(1); ya(2)-1; ya(4); ya(5)-p; ya(7)-1; yb(2); yb(5); yb(7)];
tspan = [0 5];
[t, y] = ode45(dxdy, tspan, res);
f = y(:,1);
f_prime = y(:,2);
f_primeprime = y(:,3);
Voir également
Catégories
En savoir plus sur Startup and Shutdown dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!