C_R

3412 Reputation

21 Badges

5 years, 316 days

MaplePrimes Activity


These are replies submitted by C_R

Do you have an example?

@SwissMapleBeginner 

You are welcome. Assuming that dharrs solution is what you want, I have added an extact and generic solution, that you can apply to any event in a piecewise fashion. Event by event you can not only redefine the ICs but also the (temperature dependend?) parameters of the ODEs. (Assembling from piecewise solutions a piecewise function for plotting is the better way for plotting as compared to plots,display.)

restart;

ode_sys:=diff(SA2(t),t)=SA1(t)*k12-SA2(t)*k21,
         diff(SA1(t),t)=-k1x*SA1(t);
ics:=SA2(t_ev)=0,SA1(t_ev)=Dose;

diff(SA2(t), t) = SA1(t)*k12-SA2(t)*k21, diff(SA1(t), t) = -k1x*SA1(t)

 

SA2(t_ev) = 0, SA1(t_ev) = Dose

(1)

sols:=dsolve({ode_sys,ics})

{SA1(t) = Dose*exp(-k1x*t)/exp(-k1x*t_ev), SA2(t) = -(-k1x*Dose*k12/(exp(-k21*t_ev)*(k1x-k21))+k21*Dose*k12/(exp(-k21*t_ev)*(k1x-k21)))*exp(-k21*t)/(k1x-k21)-Dose*k12*exp(-k1x*t)/((k1x-k21)*exp(-k1x*t_ev))}

(2)

params:=k12=0.0452821,k21=0.0641682,k1x=0.00426118;

k12 = 0.452821e-1, k21 = 0.641682e-1, k1x = 0.426118e-2

(3)

p:=subs(t_ev=1,Dose=484,params,sols)

{SA1(t) = 484*exp(-0.426118e-2*t)/exp(-0.426118e-2), SA2(t) = -365.8425407*exp(-0.641682e-1*t)/exp(-0.641682e-1)+365.8425406*exp(-0.426118e-2*t)/exp(-0.426118e-2)}

(4)

plot(rhs~(p),t=1..50);

 

 


 

Download Split_from_Event.mw

An excellent initiative. It's a shotgun approach, but why not try it instead of developing an algorithm that tries to classify before selecting a method.
That will be complicated. As an alternative to classification and to increase speed, perhaps machine learning could be applied to a large dataset to create a method selector.

Test case where combine,trig is key

expr2 := (a^8*(r^10 - 10*m*r^9 + 5*(a^2 + 8*m^2)*r^8 - 80*m^3*r^7 + 10*(a^4 + 12*a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+ r^2)^5/9)*m^3*r/((r^2 + cos(theta)^2*a^2)^9*(a^2 - 2*m*r + r^2)^5)

 

 

I just tried to upload and insert contents to your earlier question (I used reply).

This worked.

I am now deleting the upload

@one man 

with Maple 2024 I get:

Error, invalid input: too many and/or wrong type of arguments passed to allvalues; first unused argument is Pi*(2*_Z1+1)

With this change

restart;
f := sin(x)/x:
allvalues({solve(f, x, allsolutions)}[1 .. 2])[];
                          

                    Pi (2 _Z1 + 1), 2 Pi _Z1

the output is still the same.

For _Z1=0 I still get Pi and 0. 0 is what I want to have removed form the solutions.

Found the anwser to Q1

SolveTools:-DisplaySolutions([%])

Still, n=0 should have been excluded from 2Pi*n

@janhardo 

MS word has a quite sophisticated format filter that can be used to find and replace fonts (and other formating features). Are you looking for something like this to edit maple files? 

I don't think that something like this exist. If you find this really usedfull I would send a software change request. Such a feature would be a logic extension of Maple's existing Find/Replace feature.

I could use a Format painter 

@janhardo 

In Maple terms a template is a user defined style set.

If you want to set a persistent font, you have to first create a new style and then create and save it to a user defined style set

The new style can be set as default for new document or applied to existing document (this is an alternative to method I have described above)

You can find more details on styles in the link I have provided.

@mmcdara 

For me it is also several dozens of seconds or nothing (-> abort and reload the page).

For me the upload of a worksheet was always fast but rendering a worksheet for inserting the contents takes time. Maybe the rendering process is executed with lower priority which could explain that it takes sometimes (at higher workloads of the Mapleprimes server?!?) more time.

I do not have the web handling package installed so I cannot reproduce what you observe. However, I have not seen probes on the same port with different properties yet.

  • What happens if you delete the probes and add two new ones? Do you still get the different probe properties?
  • Which variables are listed under advanced variables of the particular port in the properties of the component where you have the probes attached to?
  • Have you added the Capstan probe or was it part of the example worksheet?

There are two more places where you can consult variables/states. One is in the model tree

the other in the simulation results.

Here  you can find a discussion on what is probed and displayed.

I assume that during a developement state more internal variables are accessible than you can see normally. Maybe the Capstan probe displays for some reason a developement view (just a guess).

 

@Rouben Rostamian  

FYI: I found an error. Now the match is "perfect"

In the above model, the initial conditions were erroneously not defined in the inertial frame (frame_a was used which differed slightly). With that change a very good match with the Maple model is achieved.

 

Turntable_Paradox_update.msim

Malpe has a fracdiff command. Have you had a look at this.

Is that the DE you want to solve

fracdiff(u(r),r,1/2)=r^2/25+(sin(u(r))+sin(fracdiff(u(r),r,1/2)))/47+r;

Maybe usefull:

https://www.mapleprimes.com/questions/228656-How-Do-I-Solve-Fractional-Differential

https://www.mapleprimes.com/questions/234553-How-To-Calculate-The--Fractional-Derivative

There is more on Mapleprimes if you search for fracdiff.

@Carl Love 

Your answer makes totally sense provided that there is a solid mathematical and computer science background. This is not the case for most of Maple users (including me). It would be good that such an explanation was part of Maple's help documentation. It seems that the property help page needs some adjustments.

Even with your explanation, I still do not understand why a property realcons is needed. On the real line every value is constant. 

 

Have you read these posts?

First 31 32 33 34 35 36 37 Last Page 33 of 67