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

1 view (last 30 days)
MINATI on 16 Apr 2018
Commented: MINATI on 16 Apr 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)];

Walter Roberson on 16 Apr 2018
MINATI on 16 Apr 2018
yes

Torsten on 16 Apr 2018
```f0 = deval(sol,0);
f0(3)
```

Best wishes

Torsten.

#### 1 Comment

MINATI on 16 Apr 2018
Thanks a lot Torsten
yah it works

Walter Roberson on 16 Apr 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 Comment

MINATI on 16 Apr 2018
Thanks Walter It works