MATLAB-finding roots and summations

  • Thread starter Thread starter Dsab123
  • Start date Start date
  • Tags Tags
    Roots
Click For Summary
SUMMARY

The discussion focuses on solving the polynomial equation p(z) = z^4 + 4.25*z^2 + 1 using MATLAB to find its four roots. The roots are computed using the 'solve' function, yielding complex results: -2i, 2i, -i/2, and i/2. The second part of the homework involves defining a complex-valued function Z(t) that sums the products of these roots and their exponential forms. The user seeks assistance with implementing the summation in MATLAB, particularly using a for loop to iterate through the roots.

PREREQUISITES
  • Familiarity with MATLAB syntax and functions
  • Understanding of polynomial equations and their roots
  • Knowledge of complex numbers and exponential functions
  • Basic programming concepts, specifically loops in MATLAB
NEXT STEPS
  • Learn how to use MATLAB's 'syms' and 'solve' functions for symbolic computation
  • Research MATLAB for loops and their syntax for iterative calculations
  • Explore the concept of complex functions and their applications in MATLAB
  • Study MATLAB's 'exp' function and its use with complex numbers
USEFUL FOR

Students and educators in mathematics or engineering fields, particularly those working with MATLAB for symbolic computation and complex analysis.

Dsab123
Messages
2
Reaction score
0

Homework Statement



(all this is included in the attachment, btw)

p(z)=z^4+4.25*z^2+1

1. use MATLAB to find the four roots Ck of
p(z)= 0

2. For all complex constants ck (different than Ck) define the complex valued function
Z(t)= 4\Sigmak=1 ck*exp(Ck*t)

^^that is a sigma sign with variable k going from one to four


Homework Equations



p(z)=z^4+4.25*z^2+1
a=4.25

The Attempt at a Solution



Number 1 I can do fine, my code is as follows:

>> syms x
>> y=(x^4+4.25*x^2+1)
>> >> solve (y)
ans =
(-2)*i
2*i
-i/2
i/2

The problem is when I get to problem 2, because I have just about no idea of how to compute a sum in matlab. I've tried a for loop with k going from one to for, after naming each of the roots C1, C2, C3, C4.

Also, I'm having some trouble figuring out what it means by 'complex constants ck'..
sorry I'm not much help in understanding this haha.


3 and 4 i think I can figure out
Any help would be very much appreciated
 

Attachments

Physics news on Phys.org
I don't do much with symbolic in Matlab, but something like this should work.

>> syms x
>> y=(x^4+4.25*x^2+1)
>> roots = solve (y)
Z=0;
syms t
for j=1:length(roots)
Z = Z + roots(j)*exp(roots(j)*t)
end
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
Replies
15
Views
3K
  • · Replies 8 ·
Replies
8
Views
2K
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K