185 Reputation

5 Badges

3 years, 255 days

MaplePrimes Activity

These are questions asked by jrive

This is the sort of thing that drives me nuts with Maple.

in the example below, how do I factor (L-Lm) so that the answer is in the form L1 :=L(1-k) instead of -L(k-1)?

Lm := (simplify(k*sqrt(L*L)) assuming (0 < L));
                           Lm := k L

L1 := (factor(L - Lm) assuming (0 < L and 0 < Lm and 0 <= k));
                        L1 := -L (k - 1)

in this simple case, it is easy to understand the result.  However, these kind of  representations in more complex solutions may obfuscate the result making it difficult to interpret its meaning, where as the meaning may be more obvious if the simplification or factorization led to a result formatted more similarly to the way a human would do it.  How do I get Maple to simplify things the more "traditional" way?

How do I simplify :

Zin := Rin + omega*L*I + (omega*L)^2/(RL + omega*L*I);

so that there are no imaginary terms in the denominator?  

I've tried, 

assum := Rin::real, omega::real, L::real, RL::real, 0 < Rin, 0 < omega, 0 < RL, 0 < L
Zin := Rin + omega*L*I + (omega*L)^2/(RL + omega*L*I);
(simplify(Zin) assuming assum);

but this doesn't work.

I'm trying to solve a coupled inductor problem.  All I'm trying to do is solve for the currents (which I could do), then solve for resonance by setting the imaginary part of I1 to 0 and solving for omega.  I then want to plug this resonant frequency back into I1 and evaluate it for some component values and coupling coefficient.

The problem is that even though I define the various variables as real,  Maple doesn't seem to recognize them as such.  I suspect I've failed to define one of them, and that is why it is responding like it is, but I can't find it.  

I'm also getting some weird behavior.....for example if I type :  wres0, I get the value I assigned to it --that's fine.  But then, when I type : wres0/(2*pi), I get an error, "Error, unable to parse 'mverbatim"   --- what does this mean?

This should be a pretty straight forward calculation on Maple, but at this point, I think I may be better off doing it by hand!  I appreciate any help you can provide.  Thank you.


 I can't seem to figure out how to use arctan on a complex number in Maple.  I expect arctan(a+jb) assuming a and b are real to return atan(b/a).  Instead, returns arctan(a+Ib).  How do I do this?



assum := R1::real, C1::real, omega::real, vab::real

R1::real, C1::real, omega::real, vab::real


Pab := expand(rationalize(vab/(R1-I/(omega*C1))))``



Pabmag := `assuming`([abs(Pab)], [assum])



Pabang := `assuming`([arctan(Pab)], [assum])




test out how to use arctan....

`assuming`([arctan(a+I*b)], [a::real, b::real])




Download complex_power_RC.mw


I use Syrup to solve for the transfer function of a circuit, and in particular, the voltage at a given node.   If I use the "trans" option, the solution generates the expected result, in the expected format.  Syrup solves the differential equations and the resulting time domain equation is as expected.

If I then use the 'AC'  option, I get the result in the s-domain.  I then solve for the step response, and take the inverse Laplace transform.  The solution is given in terms of sinh and cosh.   

If I plot the voltage in either solution as a function of time, the plots are identical.  So, the sinh/cosh solution must be somehow simplifiable so that it "looks" like the time domain solution I get from the transient analysis.





interface('displayprecision' = 8)



assum := R1::real, C1::real, R2::real, C2::real, R1 > 0, R2 > 0, C1 > 0, C2 > 0, t::realvin::real, vin > 0

vin::real, 0 < vin


ckt := [vin(5), Rm(1.0*10^7), Cm(1.8*10^(-11), ic = 0), `&//`(R1(9.*10^6), C1(1.5*10^(-11), ic = 0)), `&//`(R2(1.*10^6), C2(1.5*10^(-11), ic = 0))]

[vin(5), Rm(10000000.0), Cm(0.1800000000e-10, ic = 0), `&//`(R1(9000000.), C1(0.1500000000e-10, ic = 0)), `&//`(R2(1000000.), C2(0.1500000000e-10, ic = 0))]




ckt1 := [vin(0), Rm(0.10e8), Cm(0.18e-10, ic = 2.5), `&//`(R1(0.9e7), C1(0.15e-10, ic = 2.25)), `&//`(R2(0.1e7), C2(0.15e-10, ic = .25))]

[vin(0), Rm(0.10e8), Cm(0.18e-10, ic = 2.5), `&//`(R1(0.9e7), C1(0.15e-10, ic = 2.25)), `&//`(R2(0.1e7), C2(0.15e-10, ic = .25))]



Solution doing Transient Analysis

deqs, rest := Solve(ckt, 'tran', 'returnall')

sol1 := dsolve(deqs):

Reassign rest to include the solution.

rest := eval(rest,sol1):

Compute the voltage across the capacitor Cm.

tmp1:=simplify(eval(v[Cm](t), sol1));







p10 := plot(tmp1, t = 0 .. 0.00050000, color = 'blue', linestyle = 'dash')

p10 := plot(tmp1, t = 0 .. 0.5e-3, color = 'blue', linestyle = 'dash')


Solution from AC analysis:

sol, rest := Solve(ckt, 'returnall')

vnode2 := eval(v[2], sol)







Impulse Response

temp1 := invlaplace(vnode2, s, t)






Step Response

temp2 := invlaplace(vnode2/s, s, t)



p1 := plot({temp2, (1-exp(-1))*2.5}, t = 0 .. 0.5e-3)

temp3 := solve(temp2 = (1-exp(-1))*2.5, t)



p2 := plot([temp3, temp3], [0, 2.5])

display({p1, p10, p2})



What is going on?  Where are the sinh and cosh terms in the solution coming from and why wont it simplify so that it looks like the other solution if they are identical?  Is there something special I need to do when using the invlaplace function?


Download help_maple.mw



1 2 3 4 5 6 7 Page 3 of 7