how to find f"(0) where f=y(1),f'=y(2),f"=y(3)

4 vues (au cours des 30 derniers jours)
MINATI
MINATI le 16 Avr 2018
Commenté : MINATI le 16 Avr 2018
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
Walter Roberson
Walter Roberson le 16 Avr 2018
Is res your initial conditions?
MINATI
MINATI le 16 Avr 2018
yes

Connectez-vous pour commenter.

Réponse acceptée

Torsten
Torsten le 16 Avr 2018
f0 = deval(sol,0);
f0(3)

Best wishes

Torsten.

  1 commentaire
MINATI
MINATI le 16 Avr 2018
Thanks a lot Torsten
yah it works

Connectez-vous pour commenter.

Plus de réponses (1)

Walter Roberson
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);
  1 commentaire
MINATI
MINATI le 16 Avr 2018
Thanks Walter It works

Connectez-vous pour commenter.

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!

Translated by