MaplePrimes Posts

MaplePrimes Posts are for sharing your experiences, techniques and opinions about Maple, MapleSim and related products, as well as general interests in math and computing.

Latest Post
  • Latest Posts Feed
  • This October 21st, Maplesoft will be hosting a full-production, live streaming webinar featuring Dr. Robert Lopez, Emeritus Professor and Maple Fellow. You might have caught Dr. Lopez's Clickable Calculus webinar series before, but this webinar is your chance to meet the man behind the voice and watch him use Clickable Math techniques live!

    In this webinar, Dr. Lopez will present examples of what "resequencing concepts and skills" looks like when implemented with Maple's point-and-click syntax-free paradigm. He will demonstrate how Maple can not only be used to elucidate the concept, but also, how it can be used to illustrate and implement the manipulations that ultimately the student must master.

    Click here for more information and registration.

    A wealth of knowledge is on display in MaplePrimes as our contributors share their expertise and step up to answer others’ queries. This post picks out one such response and further elucidates the answers to the posted question. I hope these explanations appeal to those of our readers who might not be familiar with the techniques embedded in the original responses.

    Before I begin, a quick note that the content below was primarily created by one of our summer interns, Pia, with guidance and advice from me.

    The Question: Rearranging the expression of equations

    SY G wanted to be able to re-write an equation in terms of different variables.  SY G presented this example: 

    I have the following two equations:

    x1 = a-y1-d*y2;
    x2 = a-y2-d*y1;

    I wish to express the first equation in terms of y1 and x2, so that

    x1 = c - b*y1+d*x2;

    where c=a-a*d and b=1-d^2. How can I get Maple to rearrange the original equation x1 in term of y1, x2, c and b?

    This question was answered by nm who provided code with a systematic approach:

    restart;
    eq1:=x1=a-y1-d*y2:
    eq2:=x2=a-y2-d*y1:
    z:=expand(subs(y2=solve(eq2,y2),eq1)):
    z:=algsubs((a-a*d)=c,z):
    algsubs((1-d^2)=b,z);

    On the other hand, Carl Love answered this enquiry using a more direct and simple code:

    simplify(x1=a-y1-d*y2, {a-y2-d*y1= x2, 1-d^2= b, a-a*d= c});

    Let’s talk more about the expand, algsubs, subs, and simplify commands

    First let’s take a look at the method nm used to solve the problem using the commands expand, subs, solve and algsubs.

    The expand command, expand(expr, expr1, expr2, ..., exprn), distributes products over sums. This is done for all polynomials. For quotients of polynomials, only sums in the numerator are expanded; products and powers are left alone.

    The solve command, solve(equations, variables), solves one or more equations or inequalities for their unknowns.

    The subs command, subs(x=a,expr), substitutes a for x in the expression expr.

    The function algsubs, algsubs(a = b, f),performs an algebraic substitution, replacing occurrences of a with b in the expression f.  It is a generalization of the subs command, which only handles syntactic substitution.

    Let’s tackle the Maple code written by nm step by step:

    1) restart;
    The restart command is used to clear Maple’s internal memory

    2)  eq1:=x1=a-y1-d*y2:
          eq2:=x2=a-y2-d*y1:
    The names eq1 and eq2 were assigned to the equations SY G provided.

    3) z:=expand(subs(y2=solve(eq2,y2),eq1)):
    A new variable, z, was created, which will end up being x1 written in the terms SY G wanted.

    • solve(eq2,y2)
      • the solve command was used to solve the expression eq2 for the variable y2.

    • subs(y2=solve(eq2,y2),eq1)
      • The subs command was used to replace in expression eq1, y2 as determined by the solve step. 

    • expand(subs(y2=solve(eq2,y2),eq1))
      • The expand command was used to distribute products over sums. Note: this step served to ensure that the final output looked exactly how SY G wanted.

    4) z:=algsubs((a-a*d)=c,z):
    First, nm equated a-a*d to c, so later the algsubs command could be applied to substitute the new variable c into the expression z.

    5) algsubs((1-d^2)=b,z);
    Again, nm equated 1-d^2 to b, so later the algsubs command could be applied to substitute the new variable b into the expression z.

    An alternate approach

    Now let us check out Carl Love’s approach. Carl Love uses the simplify command in conjunction with side relations.

    The simplify command has many calling sequences and one of them is the simplify(expr,eqns), that is known as simplify/siderels. A simplification of expr with respect to the side relations eqns is performed. The result is an expression which is mathematically equivalent toexpr but which is in normal form with respect to the specified side relations. Basically you are telling Maple to simplify the expression (expr) using the parameters (eqns) you gave to it.

     

    I hope that you find this useful. If there is a particular question on MaplePrimes that you would like further explained, please let me know. 

     Obtain the tri-stimulus XYZ values from the CIE Color matching functions.

     Show the gamut of maximum chroma for the standard observer model with a D65 Illuminant.

     Approximate the white point of a Planckian source and compare to D65.

     Translate the maximum chroma gamut in xy to Lab (CIE L*a*b*) for perceived gamut (Violet and Magenta come together)

     Map the RGB color cube of fully saturated color into Lab and compare to perceivable colors.

    10/6/15  Initial Document

    •12/28/15 Improve RGB gamut with more data points: Procedures added for RGB to Lab: Wavlength Colors now based on CIEDE2000 model for Lab.                   

     

     Here is the latest version of this document, the MSL_data must be in a directory set in the mw file;

    MSL_data.xlsx    Vision_RGB_Gamut.mw

    In this paper we will demonstrate the many differences of implementation in the modeling of mechanical systems using embedded components through Maplesoft. The mechanical systems are used for different tasks and therefore have different structure in its design; as to the nature of the used functional elements placed on them, they vary greatly. This diversity is reflected in approaches and practices in modeling.

    The following cases focus on mechanical components of the units manufacturing and processing machines. We can generate graphs for analysis using different dynamic pair ametros; all in real-time considerations in its manufacturing costs from the equations of conservation of energy.
    Therefore modeling with Maplesoft ensures the smooth optimum performance in mechanical systems, highlighting the sustainability criteria for other areas of engineering.

     

    XXXIII_Coloquio_SMP_2015.pdf

    XXXIII_Coloquio_UNASAM_2015.mw

    (in spanish)

    L.AraujoC.

     

     

    Apparently inconsistent behaviour of the BesselJ() function.

    Examples: BesselJ(-3, 0)  ... gives 0 (correct)

    but BesselJ(-3.0, 0), BesselJ(-3, 0.0)  and BesselJ(-3, 0.0) all give Float(infinity) (wrong! - should be 0.0)

    The problem seems to occur for all negative integer values of the first argument (the order) when the second argument is 0 or 0.0.


    One of the interesting things about the Physics package is that it was designed from scratch to extend the domain of operations of the Maple system from commutative variables to one that includes commutative, anticommutative and nonocommutative variables, as well as abstract vectors and related (nabla) differential operators. In this line we have, among others, the following Physics commands working with this extended domain: `*` , `.` , `^` , diff , Expand , Normal , Simplify , Gtaylor , and Coefficients .

     

    More recently, Pascal Szriftgiser (from Laboratoire PhLAM, Université Lille 1, France), suggested a similar approach to factorize expressions involving noncommutative variables. This is a pretty complicated problem though. Pascal's suggestion, however, spinned around an idea beautiful for its simplicity, similar to what is done in the experimental Physics command, PerformOnAnticommutativeSystem , that is, to transform the problem into one that can be treated with the command that works only with commutative variables and from there extract the result for noncommutative ones.The approach has limitations but it is surprising how far one can go using imaginative algebraic manipulations to extend these commands that otherwise only work with commutative variables.

     

    In brief, we now have a new command, Physics:-Factor, with already powerful performance for factorizing algebraic expressions that involve commutative, noncommutative and anticommutative variables, making Maple's mathematical capabilities more advanced in very interesting directions. This command is in fact useful not just in advanced theoretical physics, but for instance also when working with noncommutative symbols representing abstract matrices (that can have dependency, and so they can be differentiated before saying anything about their components, multiplied, and be present int  expressions that in turn can be expanded, simplified and now also factorized), and also useful with expressions that include differential operators, now that within Physics you can compute with the the covariant and noncovariant derivatives D_  and d_ algebraically. For instance, how about solving differential equations using Physics:-Factor (reducing their order by means of factoring the involved differential operators) ? :)

     

    What follows are some basic algebraic examples illustrating the novelty, and as usual to reproduce the results in this worksheet you need to update your Physics library with the one available in the Maplesoft R&D Physics webpage.

     

    Physics:-Version()[2]

    `2015, September 25, 7:48 hours`

    (1)

    with(Physics); -1; Setup(quantumoperators = {a, b, c, d, e}, mathematicalnotation = true)

    [mathematicalnotation = true, quantumoperators = {a, b, c, d, e}]

    (2)

    First example, because of using mathematical notation, noncommutative variables are displayed in different color (olive)

    Physics:-`*`(Physics:-`^`(alpha, 2), Physics:-`^`(a, 2))+Physics:-`*`(Physics:-`*`(Physics:-`*`(alpha, sqrt(2)), a), b)+Physics:-`*`(Physics:-`*`(Physics:-`*`(Physics:-`*`(4, sqrt(2)), lambda), Physics:-`^`(b, 2)), c)+Physics:-`*`(Physics:-`*`(Physics:-`*`(Physics:-`*`(Physics:-`*`(4, lambda), alpha), b), c), a)+Physics:-`*`(Physics:-`*`(Physics:-`*`(Physics:-`*`(Physics:-`*`(4, lambda), sqrt(2)), b), c), b)+Physics:-`*`(Physics:-`*`(16, Physics:-`^`(lambda, 2)), Physics:-`^`(Physics:-`*`(b, c), 2))+Physics:-`*`(Physics:-`*`(Physics:-`*`(Physics:-`*`(Physics:-`*`(4, alpha), lambda), a), b), c)+Physics:-`*`(Physics:-`*`(Physics:-`*`(sqrt(2), alpha), b), a)+Physics:-`*`(2, Physics:-`^`(b, 2))

    alpha^2*Physics:-`^`(a, 2)+alpha*2^(1/2)*Physics:-`*`(a, b)+4*2^(1/2)*lambda*Physics:-`*`(Physics:-`^`(b, 2), c)+4*lambda*alpha*Physics:-`*`(b, c, a)+4*2^(1/2)*lambda*Physics:-`*`(b, c, b)+16*lambda^2*Physics:-`^`(Physics:-`*`(b, c), 2)+4*lambda*alpha*Physics:-`*`(a, b, c)+alpha*2^(1/2)*Physics:-`*`(b, a)+2*Physics:-`^`(b, 2)

    (3)

    Physics:-Factor(alpha^2*Physics:-`^`(a, 2)+alpha*2^(1/2)*Physics:-`*`(a, b)+4*2^(1/2)*lambda*Physics:-`*`(Physics:-`^`(b, 2), c)+4*lambda*alpha*Physics:-`*`(b, c, a)+4*2^(1/2)*lambda*Physics:-`*`(b, c, b)+16*lambda^2*Physics:-`^`(Physics:-`*`(b, c), 2)+4*lambda*alpha*Physics:-`*`(a, b, c)+alpha*2^(1/2)*Physics:-`*`(b, a)+2*Physics:-`^`(b, 2))

    Physics:-`^`(4*lambda*Physics:-`*`(b, c)+a*alpha+2^(1/2)*b, 2)

    (4)

    A more involved example from a physics problem, illustrating that the factorization is also happening within function's arguments, as well as that we can also correctly expand mathematical expressions involving noncommutative variables

    PDEtools:-declare((a, b, c, g)(x, y)):

    a(x, y)*`will now be displayed as`*a

     

    b(x, y)*`will now be displayed as`*b

     

    c(x, y)*`will now be displayed as`*c

     

    g(x, y)*`will now be displayed as`*g

    (5)

    Physics:-Intc(Physics:-`^`(Physics:-`*`(Physics:-`*`(Physics:-`*`(4, Physics:-Dagger(b(x, y))), c(x, y)), lambda)+Physics:-`*`(Physics:-`*`(Physics:-`*`(alpha, f(t)), a(x, y)), Physics:-Dagger(a(x, y)))+Physics:-`*`(Physics:-`*`(sqrt(2), g(x, y)), b(x, y)), 2), x, y)

    Int(Int(Physics:-`^`(4*lambda*Physics:-`*`(Physics:-Dagger(b(x, y)), c(x, y))+alpha*f(t)*Physics:-`*`(a(x, y), Physics:-Dagger(a(x, y)))+2^(1/2)*g(x, y)*b(x, y), 2), x = -infinity .. infinity), y = -infinity .. infinity)

    (6)

    So first expand ...

    expand(Int(Int(Physics:-`^`(4*lambda*Physics:-`*`(Physics:-Dagger(b(x, y)), c(x, y))+alpha*f(t)*Physics:-`*`(a(x, y), Physics:-Dagger(a(x, y)))+2^(1/2)*g(x, y)*b(x, y), 2), x = -infinity .. infinity), y = -infinity .. infinity))

    Int(Int(16*lambda^2*Physics:-`*`(Physics:-Dagger(b(x, y)), c(x, y), Physics:-Dagger(b(x, y)), c(x, y))+4*lambda*alpha*f(t)*Physics:-`*`(Physics:-Dagger(b(x, y)), c(x, y), a(x, y), Physics:-Dagger(a(x, y)))+4*lambda*2^(1/2)*g(x, y)*Physics:-`*`(Physics:-Dagger(b(x, y)), c(x, y), b(x, y))+4*alpha*f(t)*lambda*Physics:-`*`(a(x, y), Physics:-Dagger(a(x, y)), Physics:-Dagger(b(x, y)), c(x, y))+alpha^2*f(t)^2*Physics:-`*`(a(x, y), Physics:-Dagger(a(x, y)), a(x, y), Physics:-Dagger(a(x, y)))+alpha*f(t)*2^(1/2)*g(x, y)*Physics:-`*`(a(x, y), Physics:-Dagger(a(x, y)), b(x, y))+4*2^(1/2)*g(x, y)*lambda*Physics:-`*`(b(x, y), Physics:-Dagger(b(x, y)), c(x, y))+2^(1/2)*g(x, y)*alpha*f(t)*Physics:-`*`(b(x, y), a(x, y), Physics:-Dagger(a(x, y)))+2*g(x, y)^2*Physics:-`^`(b(x, y), 2), x = -infinity .. infinity), y = -infinity .. infinity)

    (7)

    Now retrieve the original expression by recursing over the arguments and so factoring the integrand

    Physics:-Factor(Int(Int(16*lambda^2*Physics:-`*`(Physics:-Dagger(b(x, y)), c(x, y), Physics:-Dagger(b(x, y)), c(x, y))+4*lambda*alpha*f(t)*Physics:-`*`(Physics:-Dagger(b(x, y)), c(x, y), a(x, y), Physics:-Dagger(a(x, y)))+4*lambda*2^(1/2)*g(x, y)*Physics:-`*`(Physics:-Dagger(b(x, y)), c(x, y), b(x, y))+4*alpha*f(t)*lambda*Physics:-`*`(a(x, y), Physics:-Dagger(a(x, y)), Physics:-Dagger(b(x, y)), c(x, y))+alpha^2*f(t)^2*Physics:-`*`(a(x, y), Physics:-Dagger(a(x, y)), a(x, y), Physics:-Dagger(a(x, y)))+alpha*f(t)*2^(1/2)*g(x, y)*Physics:-`*`(a(x, y), Physics:-Dagger(a(x, y)), b(x, y))+4*2^(1/2)*g(x, y)*lambda*Physics:-`*`(b(x, y), Physics:-Dagger(b(x, y)), c(x, y))+2^(1/2)*g(x, y)*alpha*f(t)*Physics:-`*`(b(x, y), a(x, y), Physics:-Dagger(a(x, y)))+2*g(x, y)^2*Physics:-`^`(b(x, y), 2), x = -infinity .. infinity), y = -infinity .. infinity))

    Int(Int(Physics:-`^`(4*lambda*Physics:-`*`(Physics:-Dagger(b(x, y)), c(x, y))+alpha*f(t)*Physics:-`*`(a(x, y), Physics:-Dagger(a(x, y)))+2^(1/2)*g(x, y)*b(x, y), 2), x = -infinity .. infinity), y = -infinity .. infinity)

    (8)

    This following one looks simpler but it is actually more complicated:

    Physics:-`*`(Physics:-Commutator(a, b), c)

    Physics:-`*`(Physics:-Commutator(a, b), c)

    (9)

    expand(Physics:-`*`(Physics:-Commutator(a, b), c))

    Physics:-`*`(a, b, c)-Physics:-`*`(b, a, c)

    (10)

    The complication consists of the fact that the standard factor  command, that assumes products are commutative, can never deal with factors like Physics:-Commutator(a, b) = a*b-a*b because if products were commutative these factors are equal to 0. Of course we not just us factor but include a number of algebraic manipulations before using it, so that the approach handles these cases nicely anyway

    Physics:-Factor(Physics:-`*`(a, b, c)-Physics:-`*`(b, a, c))

    Physics:-`*`(Physics:-`*`(a, b)-Physics:-`*`(b, a), c)

    (11)

    This other one is more complicated:

    Physics:-`*`(Physics:-`*`(a, b)-Physics:-`*`(b, a), a+Physics:-`*`(beta, b)+Physics:-`^`(c, 2))

    Physics:-`*`(Physics:-`*`(a, b)-Physics:-`*`(b, a), a+beta*b+Physics:-`^`(c, 2))

    (12)

    When you expand,

    expand(Physics:-`*`(Physics:-`*`(a, b)-Physics:-`*`(b, a), a+beta*b+Physics:-`^`(c, 2)))

    Physics:-`*`(a, b, a)+beta*Physics:-`*`(a, Physics:-`^`(b, 2))+Physics:-`*`(a, b, Physics:-`^`(c, 2))-Physics:-`*`(b, Physics:-`^`(a, 2))-beta*Physics:-`*`(b, a, b)-Physics:-`*`(b, a, Physics:-`^`(c, 2))

    (13)

    you see that there are various terms involving the same noncommutative operands, just multiplied in different order. Generally speaking the limitation (n this moment) of the approach is: "there cannot be more than 2 terms in the expanded form containing the same operands" . For instance in (13) the 1st and 4th terms have the same operands, that are actually also present in the 5th term but there you also have beta and for that reason (involving some additional manipulations) it can be handled:

    Physics:-Factor(Physics:-`*`(a, b, a)+beta*Physics:-`*`(a, Physics:-`^`(b, 2))+Physics:-`*`(a, b, Physics:-`^`(c, 2))-Physics:-`*`(b, Physics:-`^`(a, 2))-beta*Physics:-`*`(b, a, b)-Physics:-`*`(b, a, Physics:-`^`(c, 2)))

    Physics:-`*`(Physics:-`*`(a, b)-Physics:-`*`(b, a), a+beta*b+Physics:-`^`(c, 2))

    (14)

    Recalling, in all these examples, the task is actually accomplished by the standard factor  command, and the manipulations consist of ingeniously rewriting the given problem as one that involves only commutative variables, and from extract the correct result for non commutative variables.

     

    To conclude, here is an example where the approach implemented does not work (yet) because of the limitation mentioned in the previous paragraph:

    Physics:-`^`(Physics:-Commutator(a, b)+c, 2)

    Physics:-`^`(Physics:-Commutator(a, b)+c, 2)

    (15)

    expand(Physics:-`^`(Physics:-Commutator(a, b)+c, 2))

    Physics:-`*`(a, b, a, b)-Physics:-`*`(a, Physics:-`^`(b, 2), a)+Physics:-`*`(a, b, c)-Physics:-`*`(b, Physics:-`^`(a, 2), b)+Physics:-`*`(b, a, b, a)-Physics:-`*`(b, a, c)+Physics:-`*`(c, a, b)-Physics:-`*`(c, b, a)+Physics:-`^`(c, 2)

    (16)

    In this expression, the 1st, 2nd, 4th and 5th terms have the same operands a, b, a, b and then there are four terms containing the operands a, b, c. We do have an idea of how this could be done too ... :) To be there in one of the next Physics updates.

    NULL

    NULL


    Download Physics[Factor].mw

    Edgardo S. Cheb-Terrab
    Physics, Differential Equations and Mathematical Functions, Maplesoft

    We have a new video about plotting with procedures, specifically on how to avoid an error related to evaluation that many people make. 

    The worksheet I used in the video is available here:  PlottingWithProcedures.mw

    By the way, this mistake doesn't occur just in the context of plotting. Users of Optimization commands (and other commands that allow functions to be expressed as either an expression in a variable or as a procedure) frequently run into this problem too.

     

    We are happy to announce that Maple T.A. now supports the Learning Tools Interoperability® (LTI) standard, which means that Maple T.A. can be easily integrated with course management systems that support LTI. Maplesoft officially supports LTI connectivity with Canvas, Blackboard Learn™, Brightspace™, Moodle™, and Sakai.

    Using the LTI standard, you can integrate Maple T.A. directly into your existing course management or learning management platforms. This allows for single-sign on in one central location and Maple T.A. assignment delivery and grade pushing right inside of your existing solutions.

    If you would like to use the LTI connectivity feature, please contact Maplesoft Technical Support at support@maplesoft.com. They will provide the instructions and files you need to set up your connection, and answer any questions you may have about how the integration works on your platform.

    Jonny
    Maplesoft Product Manager, Maple T.A.

    A wealth of knowledge is on display in MaplePrimes as our contributors share their expertise and step up to answer others’ queries. This post picks out one such response and further elucidates the answers to the posted question. I hope these explanations appeal to those of our readers who might not be familiar with the techniques embedded in the original responses.

    Before I begin, a quick note that the content below was primarily created by one of our summer interns, Pia, with guidance and advice from me.

    The Question: Source Code of Math Apps

    Eberch, a new Maple user, was interested in learning how to build his own Math Apps by looking at the source code of some of the already existing Math Apps that Maple offers.

    Acer helpfully suggested that he look into the Startup Code of a Math App, in order to see definitions of procedures, modules, etc. He also recommended Eberch take a look at the “action code” that most of the Math Apps have which consist of function calls to procedures or modules defined in the Startup Code. The Startup Code can be accessed from the Edit menu. The function calls can be seen by right-clicking on the relevant component and selecting Edit Click Action.

    Acer’s answer is correct and helpful. But for those just learning Maple, I wanted to provide some additional explanation.

    Let’s talk more about building your own Math Apps

    Building your own Math Apps can seem like something that involves complicated code and rare commands, but Daniel Skoog perfectly portrays an easy and straightforward method to do this in his latest webinar. He provides a clear definition of a Math App, a step-by-step approach to creating a Math App using the explore and quiz commands, and ways to share your applications with the Maple community. It is highly recommended that you watch the entire webinar if you would like to learn more about the core concepts of working with Maple, but you can find the Math App information starting at the 33:00 mark.

    I hope that you find this useful. If there is a particular question on MaplePrimes that you would like further explained, please let me know. 

    The GroupTheory package in Maple includes facilities for working with finitely presented groups - groups defined by finitely many generators and defining relations.  We now have a video tutorial that covers the basics of this aspect of the package.  As always, we appreciate feedback and suggestions regarding this feature, or new features that you would like to see in the GroupTheory package.

    Maple's dsolve numeric can solve delay ODEs and DAEs as of Maple 18. However, if I am not wrong, it cannot solve delay equations with a time dependent history. In this post I show two examples.

    Example 1:

    y1(t) and y2(t) with time dependent history. Use of piecewise helps this problem to be solved efficiently. Hopefully Maple will add history soon in its capability.

    Example 2: 

    This is a very a complicated stiff problem from immunology. As of now, I believe only Maple can solve this (other than RADAR5 from Prof. Hairer). Details and plots are posted in the attached code.

     

    Let me know if any one has a delay problem that needs to be solved. I have tested many delay problems in Maple (they work fine). The attached examples required addtional tweaking, hence the post.

     

    I want to take this opportunity to congratulate and thank Maple's dsolve numeric/delay solvers for their fantastic job. Maple is world leader not because of example1, but because of its ability to solve example 2.

     

     

    restart;

     This code is written by Dayaram Sonawane and Venkat R. Subramnian, University of Washington. You will need Maple 18 or later for this. For those who are wanting to solve these problems in earlier versions, I can help them by offering a procedure based approach (less efficient).

    Example1 The first example solved is a state dependent delay problem (http://www.mathworks.com/help/matlab/math/state-dependent-delay-problem.html).

     

    eq1:= diff(y1(t),t)=y2(t);

    eq1 := diff(y1(t), t) = y2(t)

    (1)

    eq2:=diff(y2(t),t)=-y2(exp(1-y2(t)))*y2(t)^2*exp(1-y2(t));

    eq2 := diff(y2(t), t) = -y2(exp(1-y2(t)))*y2(t)^2*exp(1-y2(t))

    (2)

     Both y1(t) and y2(t) have time dependent history (y1(t)=log(t) and y2(t)=1/t, t<-0.1). If I am not mistaken one cannot solve this directly using Maple's dsolve numeric command. However, a simple trick can be used to redefine the equations for y1(t) and y2(t) as below

    eq3:=diff(y1(t),t)=piecewise(t<=0.1,1/t,y2(t));

    eq3 := diff(y1(t), t) = piecewise(t <= .1, 1/t, y2(t))

    (3)

    eq4:=diff(y2(t),t)=piecewise(t<=0.1,-1/t^2,-y2(exp(1-y2(t)))*y2(t)^2*exp(1-y2(t)));

    eq4 := diff(y2(t), t) = piecewise(t <= .1, -1/t^2, -y2(exp(1-y2(t)))*y2(t)^2*exp(1-y2(t)))

    (4)

     The problem is solved from a small number close to t = 0 (1e-4) to make Maple's dsolve numeric remember the history till t = 0.1

    epsilon:=1e-4;

    epsilon := 0.1e-3

    (5)

    sol:=dsolve({eq3,eq4,y1(epsilon)=log(epsilon),y2(epsilon)=1/epsilon},type=numeric,delaymax=5):

    with(plots):

    odeplot(sol,[t,y1(t)],0.1..5,thickness=3,axes=boxed);

     

    odeplot(sol,[t,y2(t)],0.1..5,thickness=3,axes=boxed);

     

    sol(5.0);log(5.0);1/5.0;

    [t = 5.0, y1(t) = 1.60942323180838, y2(t) = .199998786891688]

    1.609437912

    .2000000000

    (6)

    Tweaking the tolerances and epsilon will get the solution even more closer to the expected answers.

     

     

     Example 2

     The next problem discussed is very stiff, complicated and as of today, according Professor Hairer (one of the world's leading authority in numerical solutions of ODEs, DAEs), cannot be solved by any other code other than his RADAR (5th order implicit Runge Kutta modified for delay equations, Guglielmi N. and Hairer E. (2001) Implementing Radau IIa methods for stiff delay differential equations. Computing 67:1-12). This problem requires very stringent tolerances. For more information read, http://www.scholarpedia.org/article/Stiff_delay_equations. I can safely say that Maple can boast that it can solve this delay differential equation by using a switch function (instead of Heaviside/picecewise function). Code is attached below and results are compared with the output from RADAR code.  Note that dsolve/numeric is probably taking more time steps compared to RADAR, but the fact that Maple's dsolve numeric solved this model (which cannot be solved in Mathematica or MATLAB[needs confirmation for MATLAB]) should make Maple's code writers proud. It is very likely that we will be trying to submit an educational/research article on this topic/example soon to a journal. For some weird reasons, stiff=true gives slightly inaccurate results.

    restart:

     

    radar5data:=readdata("C:\\Users\\Venkat16core-office\\Google Drive\\waltmanproblem\\sol.txt",[string,string,float,string,string,float,float,float,float,float,float]):

    nops(radar5data);

    1059

    (7)

    radar5data[1059];

    ["X", "=", 300.000000, "Y", "=", 0.6154486288e-15, 0.3377120916e-6, 0.4221403310e-6, 0.2142554563e-5, 299.9999999, 299.6430338]

    (8)

    eq[1]:=diff(y[1](t),t)=-r*y[1](t)*y[2](t)-s*y[1](t)*y[4](t);

    eq[1] := diff(y[1](t), t) = -r*y[1](t)*y[2](t)-s*y[1](t)*y[4](t)

    (9)

    eq[2]:=diff(y[2](t),t)=-r*y[1](t)*y[2](t)+alpha*r*y[1](y[5](t))*y[2](y[5](t))*H1;#Heaviside(t-35);

    eq[2] := diff(y[2](t), t) = -r*y[1](t)*y[2](t)+alpha*r*y[1](y[5](t))*y[2](y[5](t))*H1

    (10)

    eq[3]:=diff(y[3](t),t)=r*y[1](t)*y[2](t);

    eq[3] := diff(y[3](t), t) = r*y[1](t)*y[2](t)

    (11)

    eq[4]:=diff(y[4](t),t)=-s*y[1](t)*y[4](t)-gamma1*y[4](t)+beta*r*y[1](y[6](t))*y[2](y[6](t))*H2;#Heaviside(t-197);

    eq[4] := diff(y[4](t), t) = -s*y[1](t)*y[4](t)-gamma1*y[4](t)+beta*r*y[1](y[6](t))*y[2](y[6](t))*H2

    (12)

    eq[5]:=diff(y[5](t),t)=H1*(y[1](t)*y[2](t)+y[3](t))/(y[1](y[5](t))*y[2](y[5](t))+y[3](y[5](t)));#eq[7]:=y[7](t)=HH(t);

    eq[5] := diff(y[5](t), t) = H1*(y[1](t)*y[2](t)+y[3](t))/(y[1](y[5](t))*y[2](y[5](t))+y[3](y[5](t)))

    (13)

    eq[6]:=diff(y[6](t),t)=H2*(10.^(-12)*0+y[2](t)+y[3](t))/(10.^(-12)*0+y[2](y[6](t))+y[3](y[6](t)));

    eq[6] := diff(y[6](t), t) = H2*(y[2](t)+y[3](t))/(y[2](y[6](t))+y[3](y[6](t)))

    (14)

    H1:=1/2+1/2*tanh(100*(t-35));H2:=1/2+1/2*tanh(100*(t-197));

    H1 := 1/2+(1/2)*tanh(100*t-3500)

    H2 := 1/2+(1/2)*tanh(100*t-19700)

    (15)

    alpha:=1.8;beta:=20.;gamma1:=0.002;r:=5.*10^4;s:=10.^5;

    alpha := 1.8

    beta := 20.

    gamma1 := 0.2e-2

    r := 50000.

    s := 100000.

    (16)

    seq(eq[i],i=1..6);

    diff(y[1](t), t) = -50000.*y[1](t)*y[2](t)-100000.*y[1](t)*y[4](t), diff(y[2](t), t) = -50000.*y[1](t)*y[2](t)+90000.0*y[1](y[5](t))*y[2](y[5](t))*(1/2+(1/2)*tanh(100*t-3500)), diff(y[3](t), t) = 50000.*y[1](t)*y[2](t), diff(y[4](t), t) = -100000.*y[1](t)*y[4](t)-0.2e-2*y[4](t)+1000000.*y[1](y[6](t))*y[2](y[6](t))*(1/2+(1/2)*tanh(100*t-19700)), diff(y[5](t), t) = (1/2+(1/2)*tanh(100*t-3500))*(y[1](t)*y[2](t)+y[3](t))/(y[1](y[5](t))*y[2](y[5](t))+y[3](y[5](t))), diff(y[6](t), t) = (1/2+(1/2)*tanh(100*t-19700))*(y[2](t)+y[3](t))/(y[2](y[6](t))+y[3](y[6](t)))

    (17)

    ics:=y[1](0)=5.*10^(-6),y[2](0)=10.^(-15),y[3](0)=0,y[4](0)=0,y[5](0)=1e-40,y[6](0)=1e-20;

    ics := y[1](0) = 0.5000000000e-5, y[2](0) = 0.1000000000e-14, y[3](0) = 0, y[4](0) = 0, y[5](0) = 0.1e-39, y[6](0) = 0.1e-19

    (18)

    #infolevel[all]:=10;

    sol:=dsolve({seq(eq[i],i=1..6),ics},type=numeric,delaymax=300,initstep=1e-6,abserr=[1e-21,1e-21,1e-21,1e-21,1e-9,1e-9],[y[1](t),y[2](t),y[3](t),y[4](t),y[5](t),y[6](t)],relerr=1e-9,maxstep=10,optimize=false,compile=true,maxfun=0):

     

     

     note that compile = true was used for efficiency

    t11:=time():sol(300);time()-t11;

    [t = 300., y[1](t) = 0.615611371327094e-15, y[2](t) = 0.337706811581908e-6, y[3](t) = 0.422136411682798e-6, y[4](t) = 0.214253771204037e-5, y[5](t) = 299.999986716780, y[6](t) = 299.643054284209]

    .141

    (19)

    with(plots):

    nd:=nops(radar5data);

    nd := 1059

    (20)

    radar5data[nd];

    ["X", "=", 300.000000, "Y", "=", 0.6154486288e-15, 0.3377120916e-6, 0.4221403310e-6, 0.2142554563e-5, 299.9999999, 299.6430338]

    (21)

     Values at t = 300 match with expected results.

    pr[1]:=plot([seq([radar5data[i][3],log(radar5data[i][6])/log(10)],i=1..nd)],style=point,color=green):

    p[1]:=odeplot(sol,[t,log(y[1](t))/log(10)],0..300,axes=boxed,thickness=3):

    display({pr[1],p[1]});

     

    pr[2]:=plot([seq([radar5data[i][3],log(radar5data[i][7])/log(10)],i=1..nd)],style=point,color=green):

    p[2]:=odeplot(sol,[t,log(y[2](t))/log(10)],0..300,axes=boxed,thickness=3,numpoints=1000):

    display({pr[2],p[2]});

     

    pr[3]:=plot([seq([radar5data[i][3],log(radar5data[i][8])/log(10)],i=2..nd)],style=point,color=green):

     

    p[3]:=odeplot(sol,[t,log(y[3](t))/log(10)],0..300,axes=boxed,thickness=3):

    display({pr[3],p[3]});

     

    pr[4]:=plot([seq([radar5data[i][3],log(radar5data[i][9])/log(10)],i=496..nd)],style=point,color=green,view=[197..300,-9..-5]):

    p[4]:=odeplot(sol,[t,log(y[4](t))/log(10)],197..300,axes=boxed,thickness=3,view=[197..300,-9..-5]):

    display({pr[4],p[4]});

     

    pr[5]:=plot([seq([radar5data[i][3],radar5data[i][10]],i=1..nd)],style=point,color=green):

    p[5]:=odeplot(sol,[t,y[5](t)],0..300,axes=boxed,thickness=3):

    display({pr[5],p[5]});

     

    pr[6]:=plot([seq([radar5data[i][3],radar5data[i][11]],i=1..nd)],style=point,color=green):

    p[6]:=odeplot(sol,[t,y[6](t)],0..300,axes=boxed,thickness=3):

    display({pr[6],p[6]});

     


    Download delayimmunetopost.mws

    As a very good application for viewing and calculation of the components of acceleration either tangential or normal. Besides immediately it is shown an Application for physics.

    Componentes_de_la_Acelelación.mw

    (in spanish)

    L. Araujo C.

     

     

    Here we see the projection of a vector onto another using different concepts ranging from linear algebra to vector calculus. Implemented components thus seen in three-dimensional space.

     

    Proyecciones_Vectoriales.mw

    (in spanish)

    L.Araujo C.

    Bryon, since you are the mapleprimes.com programmer I am requesting that you add replies to the users list.  They are not brought up under users answers.

    We have see all posts by... see all questions by... and see all answers by... however those categories miss every reply posted by the user.

    Maple 2015 has a new command, dataplot, for plotting datasets. It was designed to be easy to use and it offers several new features that are not available in Maple's other plotting commands. A few months ago, I recorded a video that gives an overview of the command. If you have any questions or comments about dataplot, feel free to post here. I'm also including the worksheet that is shown in the video: DataplotWebinar.mw

    First 72 73 74 75 76 77 78 Last Page 74 of 305