MaplePrimes Questions

Hi experts,

I want to compute the following formula using Maple but It returns the formula of integration only.

int(sin(x)/(a*b+a^2*sin(x)^2-d^2*cos(x)^2)(c+cos(x)), x = 0 .. x)

Could you please help to give me some suggestion about how to solve it?

Thank a lot.

Hey there,

I'm trying to numerically intergrate a function s(K,i,j) dK using runge kutta over a 2D grid of i,j values. Essentialy, performing the same sort of integral many different times for slightly different combinations of i and j. The function is more or less gaussian, and so the bulk of the result will come from the values of K around the peak of said gaussian. For some combinations of i and j, the function seems to have a singularity on the right edge of the gaussian peak, which causes my script to spit out an error, telling me the calculation cannot be performed further to the right past the singularity. Now, like i said before, the singularity is on the very edge of the gaussian and therefore I am perfectly happy to stop the integration before the singularity, because anything past it wont contribute very much to the result.

How can I use dsolve events to halt my integration just before hitting the singularity?

RK := (i, j) -> dsolve({diff(n(K), K) = K*s(K, a[i], b[j]), n(0) = 0}, numeric, method = rkf45)

 

Hello,

I have this error I'm not sure how to solve

restart;

`assuming`([simplify(int(ln(1+x)^3/(x+a), x = 0 .. 1))], [a > 0]);

combine(expand((eval(%, a = I)+eval(%, a = -I))*(1/2)))

 

What is the precise problem here?

Hello guys, I'm a new user of Maple and I'd love some help.

I'm trying to solve a cubic equation with four variables, and plot the imaginary part of 'w' as a function of 'x' for different values of 'y' and 'z'. When I ask for all the equation roots, the result is huge.

I want to know if there's an "easier" way to select each root of the equation and make it a function without having to "select element" and copy/paste, because I've tried this way and it's not working.

I know this is a stupid question, but I could really use some help.

Thanks for your time!

 

I don't quite understand the behavior of PDEtools[declare].  My reading of the documentation is that PDEtools[declare](y(t)) tells Maple that y is a function of t, and therefore y(t) is displayed as y and the derivative of y is displayed as yt.  I did not expect other variables to be similarly affected but apparently they are.  For instance, in the worksheet below, why is the derivative of p displayed as ps?

restart;

The normal display of derivatives:

diff(y(t),t);
diff(p(s),s);

diff(y(t), t)

diff(p(s), s)

Declare y as a function of t:

PDEtools[declare](y(t));

` y`(t)*`will now be displayed as`*y

diff(y(t),t);    # this is displayed in subscript notation, as expected
diff(p(s),s);    # why is this displayed in subscript notation?

diff(y(t), t)

diff(p(s), s)

 

Download mw.mw

HW5DC.msim

HW5HYD.msim

HW5Pneu.msim

I am trying to (again) extract the equations of the systems which have been done by me, but the equation extraction gave me wrong results.

 

For example;

The DC motor and the inverted pendulum equation must be 3. (third) order and only a differential equation.

The pneumatic motor and the inverted pendulum must be a differential equation (any order).

Also the hydraulic motor and the inverted pendulum must be a differential equation (any order).

 

I tried to use "isolate" command but it did not work for me in this case. How can I get the differential equations of the systems ?

 

I have added the MapleSim simulations and the differential equations that I had.

 

Please help me for this problem chain.

For a very simple sheet:

restart;

with(Statistics);

X := RandomVariable(Uniform(0, 1))

Sample(X, 2)

Maple always show: 0.8147236863931789, 0.9057919370756192 when I click the "execute the entire sheet." on the top.

While, if I only execute Sample(X, 2), then it seems generate random samples.

Why? is this because of the " Pseudo-random algorithm " built in Maple?

 

 

I'm trying to execute the linked code but i am having the following error:

Error, (in sombrea2) cannot determine if this expression is true or false: -(1/4)*105^(1/2) <= (1/4)*105^(1/2)
 

The entire procedure is downloadable here: http://www.mediafire.com/file/llcfhydpjy8tken/maple17.mw/file

If someone can help me to find a solution I'll be very thankful.

I was working on a project about optimal strategies for HIV treatment, models used from [Butler, Kirschner, and Lenhart] 1997. This model explains the spread of HIV viruses in the human body, where there is one control function u(t).

My work is following pontryagin maximum principle. But i have a problem solving the differential equation system, where there are 6 differential equations with 6 initial conditions. Everything works normally and I get a numerical solution for the system

restart;
with(linalg);
with(DEtools);
with(plots);

Model declaration

dx[1] := -T*V*k*u+B*T*r-T*m1+A; dx[2] := T*V*k*u-Ti*m2; dx[3] := N*Ti*m2-V*m3; H := A*T-(1-u)^2+add(dx[i]*L[i], i = 1 .. 3); satu := -(diff(H, T)); dua := -(diff(H, Ti)); tiga := -(diff(H, V)); empat := diff(H, L[1]); lima := diff(H, L[2]); enam := diff(H, L[3])

eq1 := diff(L1(t), t) = -A-(-V(t)*k*u(t)+B*r-m1)*L1(t)-u(t)*k*V(t)*L2(t); eq2 := diff(L2(t), t) = -N*m2*L3(t)+m2*L2(t); eq3 := diff(L3(t), t) = T(t)*k*u(t)*L1(t)-T(t)*k*u(t)*L2(t)+m3*L3(t); eq4 := diff(T(t), t) = -T(t)*V(t)*k*u(t)+B*T(t)*r-T(t)*m1+A; eq5 := diff(Ti(t), t) = T(t)*V(t)*k*u(t)-Ti(t)*m2; eq6 := diff(V(t), t) = N*Ti(t)*m2-V(t)*m3

Value for parameter

 u(t):=-1/(2)*L1(t)*k*V(t)*T(t)+1/(2)*L2(t)*k*V(t)*T(t)+1; s:=10;  m1:=0.02;  m2:=0.5;  m3:=4.4;  r:=0.03;  Tm:=1500;  k:=0.000024;  N:=300;    A:=1;  B:=1-(T(t)+Ti(t))/(Tm): 

Numerical Solution with BVP
 

fcns := {L1(t), L2(t), L3(t), T(t), Ti(t), V(t)}; a := dsolve({eq1, eq2, eq3, eq4, eq5, eq6, L1(20) = 0, L2(20) = 0, L3(20) = 0, T(0) = 800, Ti(0) = 0.4e-1, V(0) = 1.5}, fcns, type = numeric, method = bvp[midrich])

The plot

odeplot(a, [[t, u(t)], [t, V(t)]], 0 .. 20, numpoints = 1000)

Output

Blue: V(t)
Red: u(t)
Based on graphs v (t) and u (t) have negative values, whereas in fact v (t) shows many viruses where it is never negative (this is irrational) and u (t) is limited in interval [0,1]. My question are:
How to provide positive assumptions for the system solution?
So v (t), T (t), Ti (t) are never negative?

Hello.

Can you please tell how the guess vector is defined in Newton's method in "fsolve" if not set initial interval for unknowns? Maybe someone knows what "norm of errors", "new norm" and "incr" in "infolevel[fsolve]" are?

Thanks!

In my expresions I have an integer, nx, which actually has values of only +1 and -1 but I do not specify which.

THe results come out as powers of nx, say nx^n, where n is a positive integer.

How do I reduce the expression nx^n,= 1 for n even and nx^n,= nx for n odd?

I have the following system

pendsys := { diff(x(t),t) = a * x(t) + y(t), diff(y(t),t) = -x(t) + a * y(t) }:

with critical point being (0,0). After plotting the phase portrait, I found out that (0,0) is (asymptotically) stable when a<0 and unstable when a>0. Also, (0,0) is a center when a = 0. Also, as initial condition, I have x(0)=0, y(0)=1. I was thinking we have Hopf bifurcation at a = 0. My question is, how do I plot the bifurcation diagram for this system?

 

tes_A.mwtes_A.mw

Maple 2018.2.1, using Physicsupdates 266.

I undertsand method=Fourier needs boundary conditions to work, but I do not think this error message is right. Compare

 

restart;
pde := diff(u(r, theta), r, r)+diff(u(r, theta), theta, theta) = 0;
iv := u(2, theta) = 3*sin(2*theta)+1;
pdsolve([pde,iv], u(r,theta), method = Fourier)

With

restart;
pde := diff(u(r, theta), r, r)+diff(u(r, theta), theta, theta) = 0;
pdsolve(pde, u(r,theta), method = Fourier)

Error, (in pdsolve/info) wrong extra arguments: {method = Fourier}
 

pdsolve should return no solution instead. The way it is above, I thought at first I had wrong syntax with the "method = Fourier" settings and I think this error message can be misleading to a user.
 

Why doesn't PlotVector plot the arrows all in one size?  (as seen in the Maple help page here)

 

Dear Maple users

Sometimes I use the Explore command in order to watch how plots containing parameters change when the parameters are changed via sliders. I tried to do the same with an odeplot. I can make it work, but I cannot do it the same way as I use to do with ordinary plots: I like to define the plot outside the Explore command, because those Explore commands can be quite cluttered and hard to overview. It is not that bad in my attached example below. Sometimes I have display commands handling several plots ... 

In the attached file I show first how it works when the odeplot is inside the Explore command, but when I later move it outside, it won't work. Why this difference between ordinary plots and odeplots? Or maybe there is a workaround to make it work having the odeplot command outside ...

Regards,

Erik

 

odeplots_in_an_Explore_command.mw

First 744 745 746 747 748 749 750 Last Page 746 of 2434