Increase precision of vpasolve method?

5 Ansichten (letzte 30 Tage)
I G
I G am 6 Sep. 2018
I am using vpasolve method to find solution of equation. It is necessary to compare solution with vpasolve for y with numerical solution of some other equation with ode45, where components of numerical solution with ode45bare stored in pv, variable for comparing is p4uk.
My goal is to get same plot, but there exist some difference. I have tried to find some mistake in my equations, but everything seems ok, I checked on different ways. So is there some solution to increase solution of vpasolve, where I can get good solution?
beta=1;
ri=2;
kn=0.1;
m=1;
a1=1;
a2=0.5;
sig=1;
[zv,pv]=ode45(@fun_z,[1 0],[1; 0; 0; 0]);
R=ri-zv*(ri-1);
p4uk=pv(:,1)+kn*pv(:,2)+kn^2*pv(:,3)+kn^3*pv(:,4);
warning('off','all');
syms y;
Pp = zeros(1,length(zv));
for j=1:length(zv)
Pp(j)=double(vpasolve(32.*beta.*m.*((ri-zv(j).*(ri-1)).^3-1)./(3.*(ri-1).*(ri-zv(j).*(ri-1)).^3)+(1-y.^2)./2+8.*a1.*kn.*(1-y)+16.*a2.*kn.*kn.*log(1./y)==0,y,1));
end
p_knjiga=Pp;
plot(zv,p4uk,zv,p_knjiga,'x');
Where this is fun_z.m file:
function f=fun_z(z,p)
beta=1;
f=zeros(4,1);
ri=2;
sig=1;
R=ri-z*(ri-1);
f(1)=-32.*beta./(R.^4.*p(1));
f(2)=(-8*f(1)./R-f(1)*p(2))./p(1);
f(3)=(-p(2).*f(2)-8.*f(2)./R-8.*f(1)./(R.^2.*p(1))-f(1).*p(3))./p(1);
f(4)=(-f(2)*p(3)-f(3)*p(2)+8*(-f(3)/R- (f(2)./p(1)-p(2)*f(1)/(p(1).*p(1)))/(R.*R)) -f(1)*p(4))/p(1);

Antworten (0)

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange

Produkte


Version

R2015a

Community Treasure Hunt

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

Start Hunting!

Translated by