want to be a permanent vegan

Mr. yang song

15 Reputation

3 Badges

9 years, 247 days

a vegan, a buddhist , a good man.

MaplePrimes Activity


These are questions asked by want to be a permanent vegan

This is the code example_hw2.mw which derives from hw2_I1.mw.

hw2_I1.mw works but example_hw2.mw doesn't work and the differences between two codes are two new function I added to the dsolve which are η(t) and I2(t). The I2(t) is the second part of I1(t) at the interval t>t* which subject to Phi(t*)=0.

So how to make the sentence 'if |(H(t))/(omega)|>1 then eta(t)=0 else eta(t)=arccos(-(H(t))/(omega))' and 'I2(t) = (int(p(t), x = -eta(t) .. eta(t)))/Pi' work?

 

This is the code  hw2_final.mw

 

Let me explain it.

I am sure that the mistakes must be about the expresstion of the I1(t) and I2(t). Actually if you delete I1(t) and I2(t) , the whole code works and get the picture at the bottom. 

What I want is to put the expresstion of the I1(t) and I2(t) into 'sol:=dsolve...' and 'plots...' to get the picture of I1(t) and I2(t) with respect to t. Before the t* which subject to Phi(t*)=0 (The blue line in the picture at the bottom is Phi) I want I1(t) and after t* I want I2(t).

I1(t) = (int(sqrt(2*(H(t)+omega*cos(q(t)))), q(t) = q(t)-2*Pi .. q(t), numeric))/Pi.    what I want of this experesstion is to get  'int(sqrt(2*(H(t)+omega*cos(q(t)))' from  'q(t)-2*Pi' to 'q(t)' by numeric method.This q(t) is the solution of the ODE sys.

For example(the number I used is not true,just for example) , at the point t=20, q(t)=30-2*Pi.

so I1(t)= (int(sqrt(2*(H(t)+omega*cos(x))), x = 30-2*Pi .. 30, numeric))/Pi.The I2(t) I want is similar to I1(t).

 

How can I solve it?

when the variable is in limits of integration?

hw2_example.mw

there exist an error : 

Error, (in int) unable to compute a numeric answer for symbolic limits, q = -3.141592654+arccos(11./(1.+.1000000000*t)) .. 3.141592654-1.*arccos(11./(1.+.1000000000*t))

How to make this code work?

My goal is to plot the integral J with respect to t and as you can see J is a piecewise function.

This is my code.   hw2_numerical_2.mw

 

Actually it's a problem about adiabatic invariants.

If you want to know the backgroud please see this link.

www.mapleprimes.com/questions/206645-How-To--Numerically--Solve-It-

and plot  function I? This I is the area which I wrote at the paper.

Could you give me the code which can be used to solve the ODE by numerical method and plot I with respect to t?

I think I have write down everything clearly but if you feel confused please ask me.

I am eager to know the code. Thanks very much!

1 2 3 Page 2 of 3