Tell me more ×
Computational Science Stack Exchange is a question and answer site for scientists using computers to solve scientific problems. It's 100% free, no registration required.

I am trying to solve the following differential equations on matlab. (They are the equations obtained from the yang-mills-higgs lagrangian for the hoofy polyakov monopole ansatz). This is my function file. I have two variables h and k and their derivatives w.r.t to a variable t. My x(1)=h, x(2)=k, x(3)=dh\dt, x(4)=dk\dt. All the functions have initial value 0.

  function xprime = monopole( t,x )
    %UNTITLED Summary of this function goes here
    %   Detailed explanation goes here

    xprime(1)=x(3);
    xprime(2)=x(4);
    xprime(4)=(1/(t.^2)).*((x(2).^2)-1).*x(2) + 4.*(x(1).^2).*x(2);
    xprime(3)=(2/(t.^2)).*(x(2).^2).*x(1)-(1-(x(1)).^2).*x(1)-(2/t).*x(3);
    xprime=xprime(:);




end

Now when I run the following code >

> t0=0;
    >> tf=10;
    >> x0=[0 0 0 0];
    >> [t,s]=ode45(@monopole,[t0,tf],x0);
    >> plot(t,s(:,1));

I am not getting anything. The graph window appears but it doesnt contain anything. This equations are supposed to have solutions. The dotted curves is what one should get with the curve starting from 1 is k, and from 0 is h.

enter image description here

What is my mistake?

share|improve this question

1 Answer

The value $x=[0,0,0,0]^T$ is an equilibrium solution of your system of ODEs. So MATLAB is computing and plotting the answer -- all zeros. It appears that some entries in your initial vector $x_0$ should be 1 rather than 0.

Judging from your expected solution, x0 is likely supposed to be $[0,1,1,0]^T$. That will produce the same initial values (assuming the slope of the h curves is 1 at the origin).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.