Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Using max when there is symbolic variable
Replies: 3   Last Post: Jul 1, 2013 10:40 AM

 Search Thread: Advanced Search

 Messages: [ Previous | Next ]
 asif khan Posts: 16 Registered: 6/24/13
Re: Using max when there is symbolic variable
Posted: Jun 30, 2013 3:49 AM
 Plain Text Reply

On Saturday, June 29, 2013 5:01:09 PM UTC+5:30, Maya wrote:
> Hi,
>
>
>
> I am trying to solve this problem:
>
> p_i=max(0,(-1+sqrt(1-4*c_i*d_i+4*(c_i-d_i)*c_i*d_i/(x*a_i))/2*c_i*d_i) if c_i>d_i
>
> and p_i=0 otherwise. p_i, c_i,d_i are diagonal elements of matrices P, C, D and A. I need to find x and after that to calculate p_i, but I do not know how to implement max because at first x is a symbolic variable.
>
>
>
> I would appreciate if anyone could help me.
>
> Maya

syms c_i d_i a_i x
>> expand(-1+sqrt(1-4*c_i*d_i+4*(c_i-d_i)*c_i*d_i/(x*a_i))/2*c_i*d_i)

ans =

(c_i*d_i*((4*c_i^2*d_i)/(a_i*x) - (4*c_i*d_i^2)/(a_i*x) - 4*c_i*d_i + 1)^(1/2))/2 - 1

solve(-1+sqrt(1-4*c_i*d_i+4*(c_i-d_i)*c_i*d_i/(x*a_i))/2*c_i*d_i)

ans =

(c_i*d_i*(4*c_i - 4*d_i))/(a_i*(4*c_i*d_i + 4/(c_i^2*d_i^2) - 1))

this the value of x if p_i=0

i dont understand your problem exactly....

you want to find max(0,somenumber). is it?

here somenumber is a variable.... is it?

Date Subject Author
6/29/13 Anja
6/29/13 Anja
6/30/13 asif khan
7/1/13 Steven Lord

© The Math Forum at NCTM 1994-2018. All Rights Reserved.