acer

32313 Reputation

29 Badges

19 years, 312 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

What are your initial conditions?

Your equation appears to be missing a multiplication symbol * between n and the left opening backet beside it.

There is no special mechanism to allow multiple people to edit the same .mw file at the same time.

@C_R In terms of students, and demonstrating proofs, if might be fun to code up some of these.

One tricky aspect is that I'd prefer to be able to apply such single-steps to subexpressions of a current line in a running proof. That'd make it more textbook-like. Yet usual context-menus are not so convenient for subexpression conversions; one way to mimic it is to populate a context-menu's submenu, on-the-fly, populated with precomputed replacements determined with much type-checking/matching. (There is also a right-panel subexpression menu thingy, which can do subexpression replacements, in-situ, but is not really user-extensible.) It would not be such quick fun to code it up as a Tutor.

Regular context-menu extensions can be put reasonably easily into the ModuleLoad of a package module, eg. like L.

@dharr Just because it might be of interest to the OP...

restart;

V(phi):=-(1-((M**2)/((deltac)*(1+(qc-1)*phi)**((qc+1)/(2*qc-2))+(deltah)*(1+(qh-1)*phi)**((qh+1)/(2*qh-2)))**3)*((deltac/2)*(qc+1)*(1+(qc-1)*phi)**((3-qc)/(2*qc-2))+(deltah/2)*Tch*(qh+1)*(1+(qh-1)*phi)**((3-qh)/(2*qh-2))))**(-2)*(((1+(alpha/M)**2*(2*deltac/(3*qc-1)+2*deltah/(Tch*(3*qh-1)))))*(2*deltac/(3*qc-1)*(1+(qc-1)*phi)**((3*qc-1)/(2*qc-2))+2*deltah/(Tch*(3*qh-1))*(1+Tch*(qh-1)*phi)**((3*qh-1)/(2*qh-2))-2*deltac/(3*qc-1)-2*deltah/(Tch*(3*qh-1)))-phi-(1/2)*(alpha/M)**2*((2*deltac/(3*qc-1)*(1+(qc-1)*phi)**((3*qc-1)/(2*qc-2))+2*deltah/(Tch*(3*qh-1))*(1+Tch*(qh-1)*phi)**((3*qh-1)/(2*qh-2)))**2-(2*deltac/(3*qc-1)+2*deltah/(Tch*(3*qh-1)))**2)+(M**2*((1+(alpha/M)**2*(2*deltac/(3*qc-1)+2*deltah/(Tch*(3*qh-1))))))*((((deltac*(1+(qc-1)*phi)**((qc+1)/(2*qc-2)))+(deltah*(1+Tch*(qh-1)*phi)**((qh+1)/(2*qh-2)))))**(-1)-1/(deltac+deltah))-(M**2/2)*((((deltac*(1+(qc-1)*phi)**((qc+1)/(2*qc-2)))+(deltah*(1+Tch*(qh-1)*phi)**((qh+1)/(2*qh-2)))))**(-2)-(deltac+deltah)**(-2))+alpha**2*phi-alpha**2*(((2*deltac/(3*qc-1)*(1+(qc-1)*phi)**((3*qc-1)/(2*qc-2))+2*deltah/(Tch*(3*qh-1))*(1+Tch*(qh-1)*phi)**((3*qh-1)/(2*qh-2))))/((((deltac*(1+(qc-1)*phi)**((qc+1)/(2*qc-2)))+(deltah*(1+Tch*(qh-1)*phi)**((qh+1)/(2*qh-2))))))-((2*deltac/(3*qc-1)+2*deltah/(Tch*(3*qh-1))))/(deltac+deltah))):
#
w := simplify(eval(diff(V(phi),phi$2),{phi=0,deltah=1-deltac}));

((((-qh-1)*Tch+qc+1)*deltac+Tch*(qh+1))*M^2-2*alpha^2)/(M^2*(-2+(((-qh-1)*Tch+qc+1)*deltac+Tch*(qh+1))*M^2))

form := map(sort,(M^2-(alpha*M0)^2)/(M^2*(M^2-M0^2)),M);

(M^2-alpha^2*M0^2)/(M^2*(M^2-M0^2))

simplify([solve(identity(w=form,M),{M0})])

[{M0 = -2/(-2*(deltac-1)*(qh+1)*Tch+2*deltac*(qc+1))^(1/2)}, {M0 = 2/(-2*(deltac-1)*(qh+1)*Tch+2*deltac*(qc+1))^(1/2)}]

Download A1_ac.mw

@C_R The small module L may be augmented to rebind lhs and rhs as well.

Logic_2DInput_lrhs.mw

(You could also guard against incorrect number of arguments, if you'd prefer some customized error message, etc.)

What exactly are you hoping to construct using the plot3d command? Please be clear.

@jrive An alternative approach to your example is to use a particular option with the simplify command. This calling sequence is called simplify-with-side-relations.

For this given example, that command can handle just the first substitution, or the entire problem.

sol1 := C*vout*vin/(Iout*L*k^2);

C*vout*vin/(Iout*L*k^2)

simplify(sol1, {vin/Iout = omega0*Lm});

C*vout*omega0*Lm/(L*k^2)

eval(%, [Lm = k*L, C = 1/(omega0*L)]);

vout/(L*k)

simplify(sol1, {vin/Iout = omega0*Lm,
                Lm = k*L, C = 1/(omega0*L)});

vout/(L*k)

Download jrive_ex4b.mw

@delvin You've mistakenly attempted to enter the various lines of a proc definition across multiple paragraphs. But it has to be entered in a single paragraph (or execution group).

@delvin There's no mystery as to how to end a Maple statement with a full colon -- it's a key on your keyboard.

Sometimes it's worthwhile checking the size of potentially large expressions, before printing them. There's often only so much insight to be had from looking at wallpaper of formulas. Simplifying large expressions before printing them can also be useful.

03_ac.mw

(You might want some other, alternate rearrangement of the terms, but if so you then haven't described it.)

Please put your followup example here, instead of spawning a wholly separate new Question thread for it.

@Thomas Dean with the local declared...

restart;

kernelopts(version);

`Maple 2022.2, X86 64 LINUX, Oct 23 2022, Build ID 1657361`

eqs := [u     + v     + w     = 1,   u*x   + v*y   + w*z   = 1/2,
        u*x^2 + v*y^2 + w*z^2 = 1/3, u*x^3 + v*y^3 + w*z^3 = 1/4,
        u*x^4 + v*y^4 + w*z^4 = 1/5, u*x^5 + v*y^5 + w*z^5 = 1/6]:

soln := [solve(eqs, explicit)]:

andmap(t -> local eq; is(`and`(seq(eval(eq,t),eq=eqs))), soln);

true

andmap(proc (t) local eq; is(`and`(seq(eval(eq, t), eq = eqs))) end proc, soln)

true

Download seqlocal.mw

@RezaZanjirani You are very welcome. I'm glad that you have it working as you want.

Note that what I did in your worksheet (in my Reply above) is the same approach that I'd shown in the first example&attachment in my Answer.

@Carl Love I recalled some of the OP's earlier postings using the same basic code layout. Some of his "parameters" are the global names to which he's assigned values, rather than some procedure's parameters having values passed into a call.

ps. It sure does help when people provide their actual code in an attachment to the Question.

@RezaZanjirani It seems to work, respecting the rhs&lhs of the inequality, as well as preserving the symbol c unevaluated, whether one uses,
   Typesetting:-Typeset(p__s < c)
or,
   Typesetting:-Typeset(c > p__s)

Scenario_ac.mw

Scenario_ac2.mw

So I'm not sure I understand what you mean when you state, "But it does not work on my own code".

ps. Your code has the input as c>p__s , by the way, though you indicate elsewhere that you want it as p__s<c.

@sand15 A fundamental danger of your trick is that some denominator involved in the computation for the generic x[i,j] could be mathematically zero when replaced by the B[i,j] expressions. Subsequent evaluation of the final result can then fall prey to the division-by-zero time-bomb.

First 60 61 62 63 64 65 66 Last Page 62 of 591