reemeaaaah

90 Reputation

7 Badges

11 years, 269 days

MaplePrimes Activity


These are replies submitted by reemeaaaah

@Rouben Rostamian  

Thanks for help. It worked!

@Carl Love 

This is exactly what I was looking for. This will allow me to use the specific data.

Thank you

@Markiyan Hirnyk 

Thank you for the link and the rplacing note whish also saved space.

@Carl Love 

 

Perfect! 

Thank you so much; this will save a lot of time.

@Carl Love 

 

Thank you very much!

The steps are very clear and helped me. I appreciate it 

@Joe Riel 

Thank you for your replay.

For the given example I am solving equation (eq) 3 times each time with random value of  S=A[i]. Then from the 3 solutions that I have I am examining certain time i.e t=2 so I have 3 different intervals B1,B2 and B3 each start with 2 (that's why first element always 2) . After that I am taking only the maximum interval, which is in our case here B3 to do more work on it.

Yes, the purpose is to find the largest second element. However I need it as an interval to complete my work. 

Thank you for your helpful suggestion I will try it.

@Kitonum 

great

yes that's fixed it. 

Thank you so much

@Carl Love 

Thank you for your replay. 

when I applied your line to my code I get this error message:

Error, sort: 2nd argument must be a function that always returns true or false

Thank you

@Kitonum 

Thank you for your replay. I added your two line to my code after the final do loop but it seems it's not working. I am  getting B4 instead of datamax:= [2., 51.78712780854305]. Did I apply it wrong? 

Maple code:

restart;

n := 3;

for i to n do A[i] := RandomTools:-Generate(distribution(Uniform(.5, .75))) end do;

eq := diff(X(t), t) = -S*X(t);

ic[1] := X(0) = 150;

for i to n do s[i] := dsolve({ic[1], subs(S = A[i], eq)}, X(t), range = 0 .. 10, numeric) end do;

for i to n do B[i] := eval([t, X(t)], s[i](2)) end do;

sort([B[i]], proc (x, y) options operator, arrow; is(y[2] < x[2]) end proc);

datamax := %[1];

output:
B1:=[2., 36.718220544331125]
B2:=[2., 35.08378362904457]
B3:=[2., 51.78712780854305]
[B[4]]
B[4]

 

Thanks

@Carl Love 

Wow! I didn't know that it could be done this way. Thanks for simplfing my complicated code. It works great.

thank you very much appreciate it

Thank you for your replay. 

The range of values of k and mu already in the slider. The problem solved when I used “subs dummy” and now it works.

Thank you

Thank you for your replay. 

The range of values of k and mu already in the slider. The problem solved when I used “subs dummy” and now it works.

Thank you

Thank you very much. the situation is now clear 

thanks

Thank you very much. the situation is now clear 

thanks

Hello,

Thank you for replay. This piecewise(0 > x(t) and x(t) > 1, 0, x(t) > 1, 1) makes sure that 0<=x(t)<=1 and x(t) is nonnegative. But since Maple consider it 0 otherwise I am having negative values for x(t). 

Thank you

1 2 3 4 Page 1 of 4