acer

32333 Reputation

29 Badges

19 years, 326 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

@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.

@FDS To the right of an Answer's title is a thumbs-up icon and (if you posted the Question) a cup icon.

Anyone (with reputation score of at least 10) can vote-up an Answer by clicking the thumbs-up icon.

The person who posts the Question can also accept it as best by clicking the cup icon.

Naturally, you are free to do this for any of the Questions you post in this forum.

@Rouben Rostamian  The worksheet attached by simplevn1967 was saved by him using Maple 17 (released 2013).

@lemelinm The effect of your first suggestion -- to control the color of the surface "grid" lines differently from the color/shading of the surface -- is already mostly possible to achieve, and without having to recompute the surface's data points (eg. z-values).

The key here is to compute (once) the plot values, either as pure surface or pure wireframe style. Then the other can be constructed by overriding that option, ie. without recomputing the values.

For example, (and you could also adjust other qualities of these wire-frame lines, eg. thickness=2 , etc),

with(plots):
P := plot3d(-x^3+y^2,x=-1..1,y=-1..1,style=surface):
display(P,display(P,overrideoption,
                  color="Orange",style=wireframe));

Naturally, that example applied the override only to a single surface. One might well not want to have it as a blanket effect on all compound parts of a VolumeOfRevolution result. (But even there, it can be done selectively, with a bit of care.)

I'd agree that a simple choice of options for the effect you've described would be more user-friendly. On the other hand, there are several other things I'd rather take priority. Eg, separate x/z, y/z, x/y aspect ratios for the axes.

ps. I think that jtreiman's original suggestions (at top) produce a result that is easier to interpret than the default for the command in question.

@Christopher2222 Calls to time() ought to be calls to time[real]().

You could do that something like this:

caring_phase_pemanenan_predator_dgn_parametersesuai_jurnal_ac3.mw

I indexed table T by t-values, only because I don't know how you plan to access the maxima later. You could also index by the ordinal, `found`, etc.

It's not clear from your latest question whether you want the global maximum (over t=0..100, say) or all the local maxima each time around (when diff(x(t),t) is zero).

Here's a simple way to get that global max from the phaseportrait data itself, and the corresponding time, for one of the initial values.
caring_phase_pemanenan_predator_dgn_parametersesuai_jurnal_ac2.mw

There are several more complicated ways (eg, wrapping x(t) in a proc that does extra tracking), or using dsolve/numeric's events options, etc. That kind of approach can also come in useful if you want to save values "each time around", or each time diff(x(t),t)=0, etc. Let us know if you need.

First 61 62 63 64 65 66 67 Last Page 63 of 592